diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-13 01:42:09 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-13 01:42:09 +0000 |
commit | 0c5c0124acc84754fdf81bf5a98a807ee33c9bae (patch) | |
tree | bba3cae61af33ef739b738ccfa01f20febddbad2 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 72fe2d0b7928257881bdaba31984ccfc127eed08 (diff) | |
download | llvm-0c5c0124acc84754fdf81bf5a98a807ee33c9bae.zip llvm-0c5c0124acc84754fdf81bf5a98a807ee33c9bae.tar.gz llvm-0c5c0124acc84754fdf81bf5a98a807ee33c9bae.tar.bz2 |
AsmWriter/Bitcode: MDExpression
llvm-svn: 229023
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 9feb4ff..6683e3e 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1092,11 +1092,20 @@ static void WriteMDLocalVariable(const MDLocalVariable *N, Record.clear(); } -static void WriteMDExpression(const MDExpression *, const ValueEnumerator &, - BitstreamWriter &, SmallVectorImpl<uint64_t> &, - unsigned) { - llvm_unreachable("write not implemented"); +static void WriteMDExpression(const MDExpression *N, const ValueEnumerator &, + BitstreamWriter &Stream, + SmallVectorImpl<uint64_t> &Record, + unsigned Abbrev) { + Record.reserve(N->getElements().size() + 1); + + Record.push_back(N->isDistinct()); + for (uint64_t I : N->getElements()) + Record.push_back(I); + + Stream.EmitRecord(bitc::METADATA_EXPRESSION, Record, Abbrev); + Record.clear(); } + static void WriteMDObjCProperty(const MDObjCProperty *, const ValueEnumerator &, BitstreamWriter &, SmallVectorImpl<uint64_t> &, unsigned) { |