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 | a0d451f0c3b152920c0bc50ab6c5fb6b9eef89b4 (patch) | |
tree | 73cd43fda7814ed745c3c31de92ff8c7bbf93721 /lib/VMCore/LLVMContextImpl.h | |
parent | 0b1a57873443a0473a6f62af961be56517a2cb8e (diff) | |
download | external_llvm-a0d451f0c3b152920c0bc50ab6c5fb6b9eef89b4.tar.gz external_llvm-a0d451f0c3b152920c0bc50ab6c5fb6b9eef89b4.tar.bz2 external_llvm-a0d451f0c3b152920c0bc50ab6c5fb6b9eef89b4.zip |
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/VMCore/LLVMContextImpl.h')
-rw-r--r-- | lib/VMCore/LLVMContextImpl.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index 2ea2d5e910..ccca789209 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -23,6 +23,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Assembly/Writer.h" +#include "llvm/Support/ValueHandle.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/DenseMap.h" @@ -171,7 +172,17 @@ public: typedef DenseMap<Value*, ValueHandleBase*> ValueHandlesTy; ValueHandlesTy ValueHandles; - MetadataContext TheMetadata; + /// CustomMDKindNames - Map to hold the metadata string to ID mapping. + StringMap<unsigned> CustomMDKindNames; + + typedef std::pair<unsigned, TrackingVH<MDNode> > MDPairTy; + typedef SmallVector<MDPairTy, 2> MDMapTy; + + /// MetadataStore - Collection of per-instruction metadata used in this + /// context. + DenseMap<const Instruction *, MDMapTy> MetadataStore; + + LLVMContextImpl(LLVMContext &C) : TheTrueVal(0), TheFalseVal(0), VoidTy(C, Type::VoidTyID), LabelTy(C, Type::LabelTyID), @@ -187,8 +198,7 @@ public: Int32Ty(C, 32), Int64Ty(C, 64) { } - ~LLVMContextImpl() - { + ~LLVMContextImpl() { ExprConstants.freeConstants(); ArrayConstants.freeConstants(); StructConstants.freeConstants(); |