AsmWriter/Bitcode: MDSubrange

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229003 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-02-13 01:10:38 +00:00
parent 7473485c0f
commit b984c49449
11 changed files with 119 additions and 9 deletions

View File

@ -809,11 +809,23 @@ static void WriteGenericDebugNode(const GenericDebugNode *N,
Record.clear();
}
static void WriteMDSubrange(const MDSubrange *, const ValueEnumerator &,
BitstreamWriter &, SmallVectorImpl<uint64_t> &,
unsigned) {
llvm_unreachable("write not implemented");
static uint64_t rotateSign(int64_t I) {
uint64_t U = I;
return I < 0 ? ~(U << 1) : U << 1;
}
static void WriteMDSubrange(const MDSubrange *N, const ValueEnumerator &,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
unsigned Abbrev) {
Record.push_back(N->isDistinct());
Record.push_back(N->getCount());
Record.push_back(rotateSign(N->getLo()));
Stream.EmitRecord(bitc::METADATA_SUBRANGE, Record, Abbrev);
Record.clear();
}
static void WriteMDEnumerator(const MDEnumerator *, const ValueEnumerator &,
BitstreamWriter &, SmallVectorImpl<uint64_t> &,
unsigned) {