diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-29 09:01:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-29 09:01:33 +0000 |
commit | 081134741b40b342fb2f85722c9cea5d412489a8 (patch) | |
tree | 73cd43fda7814ed745c3c31de92ff8c7bbf93721 /lib/Bitcode | |
parent | e3e38ea9fb70cbd8cc33111589c92c0a61674679 (diff) | |
download | external_llvm-081134741b40b342fb2f85722c9cea5d412489a8.zip external_llvm-081134741b40b342fb2f85722c9cea5d412489a8.tar.gz external_llvm-081134741b40b342fb2f85722c9cea5d412489a8.tar.bz2 |
Final step in the metadata API restructuring: move the
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 3 | ||||
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.h | 2 | ||||
-rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 5 |
3 files changed, 3 insertions, 7 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 568968d..7dffafa 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -17,7 +17,6 @@ #include "llvm/DerivedTypes.h" #include "llvm/InlineAsm.h" #include "llvm/IntrinsicInst.h" -#include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/Operator.h" #include "llvm/AutoUpgrade.h" @@ -840,7 +839,7 @@ bool BitcodeReader::ParseMetadata() { for (unsigned i = 1; i != RecordLength; ++i) Name[i-1] = Record[i]; - unsigned NewKind = Context.getMetadata().getMDKindID(Name.str()); + unsigned NewKind = TheModule->getMDKindID(Name.str()); assert(Kind == NewKind && "FIXME: Unable to handle custom metadata mismatch!");(void)NewKind; break; diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h index 7b3a1ae..bb3961a 100644 --- a/lib/Bitcode/Reader/BitcodeReader.h +++ b/lib/Bitcode/Reader/BitcodeReader.h @@ -170,7 +170,7 @@ class BitcodeReader : public ModuleProvider { DenseMap<Function*, std::vector<BlockAddrRefTy> > BlockAddrFwdRefs; public: - explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext& C) + explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext &C) : Context(C), Buffer(buffer), ErrorString(0), ValueList(C), MDValueList(C) { HasReversedFunctionsWithBodies = false; } diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 21548cd..8454e54 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -19,8 +19,6 @@ #include "llvm/DerivedTypes.h" #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Metadata.h" #include "llvm/Module.h" #include "llvm/Operator.h" #include "llvm/TypeSymbolTable.h" @@ -595,9 +593,8 @@ static void WriteModuleMetadataStore(const Module *M, BitstreamWriter &Stream) { // Write metadata kinds // METADATA_KIND - [n x [id, name]] - MetadataContext &TheMetadata = M->getContext().getMetadata(); SmallVector<StringRef, 4> Names; - TheMetadata.getMDKindNames(Names); + M->getMDKindNames(Names); assert(Names[0] == "" && "MDKind #0 is invalid"); if (Names.size() == 1) return; |