summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-13 01:32:09 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-13 01:32:09 +0000
commite146000565c86e7cd70d746a64084f1ea3a7528e (patch)
tree2e1ffeb85e0cca419b5e63bb4ad3481e958cc9bf /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent06a0702e4033573be42105bc51bbfeff628a00da (diff)
downloadbcm5719-llvm-e146000565c86e7cd70d746a64084f1ea3a7528e.tar.gz
bcm5719-llvm-e146000565c86e7cd70d746a64084f1ea3a7528e.zip
AsmWriter/Bitcode: MDNamespace
llvm-svn: 229018
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 4643a7236a4..aa774ba38e0 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1007,11 +1007,20 @@ static void WriteMDLexicalBlockFile(const MDLexicalBlockFile *N,
Record.clear();
}
-static void WriteMDNamespace(const MDNamespace *, const ValueEnumerator &,
- BitstreamWriter &, SmallVectorImpl<uint64_t> &,
- unsigned) {
- llvm_unreachable("write not implemented");
+static void WriteMDNamespace(const MDNamespace *N, const ValueEnumerator &VE,
+ BitstreamWriter &Stream,
+ SmallVectorImpl<uint64_t> &Record,
+ unsigned Abbrev) {
+ Record.push_back(N->isDistinct());
+ Record.push_back(VE.getMetadataOrNullID(N->getScope()));
+ Record.push_back(VE.getMetadataOrNullID(N->getFile()));
+ Record.push_back(VE.getMetadataOrNullID(N->getRawName()));
+ Record.push_back(N->getLine());
+
+ Stream.EmitRecord(bitc::METADATA_NAMESPACE, Record, Abbrev);
+ Record.clear();
}
+
static void WriteMDTemplateTypeParameter(const MDTemplateTypeParameter *,
const ValueEnumerator &,
BitstreamWriter &,
OpenPOWER on IntegriCloud