summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-13 01:14:11 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-13 01:14:11 +0000
commit87754764199bf7547b5336b35e9a704143c177b7 (patch)
treeb40337d23c6b3e20d9d164dcc92f23b715622f30 /llvm/lib/Bitcode/Writer
parentc7363f1147f8d06c34683480b0cb7e24a395a534 (diff)
downloadbcm5719-llvm-87754764199bf7547b5336b35e9a704143c177b7.tar.gz
bcm5719-llvm-87754764199bf7547b5336b35e9a704143c177b7.zip
AsmWriter/Bitcode: MDEnumerator
llvm-svn: 229004
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 3d1e82d8f8c..dfbfc9c0bea 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -826,11 +826,18 @@ static void WriteMDSubrange(const MDSubrange *N, const ValueEnumerator &,
Record.clear();
}
-static void WriteMDEnumerator(const MDEnumerator *, const ValueEnumerator &,
- BitstreamWriter &, SmallVectorImpl<uint64_t> &,
- unsigned) {
- llvm_unreachable("write not implemented");
+static void WriteMDEnumerator(const MDEnumerator *N, const ValueEnumerator &VE,
+ BitstreamWriter &Stream,
+ SmallVectorImpl<uint64_t> &Record,
+ unsigned Abbrev) {
+ Record.push_back(N->isDistinct());
+ Record.push_back(rotateSign(N->getValue()));
+ Record.push_back(VE.getMetadataOrNullID(N->getRawName()));
+
+ Stream.EmitRecord(bitc::METADATA_ENUMERATOR, Record, Abbrev);
+ Record.clear();
}
+
static void WriteMDBasicType(const MDBasicType *, const ValueEnumerator &,
BitstreamWriter &, SmallVectorImpl<uint64_t> &,
unsigned) {
OpenPOWER on IntegriCloud