diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-22 19:36:54 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-22 19:36:54 +0000 |
commit | 9d89df169027035bf692b3d397bb93cff7bdc860 (patch) | |
tree | 7a51da6c1a08fe29ff3485b41b5a503fff641a6f /include/llvm | |
parent | f61b2371c8ec6e0ff2da8f2bd2a606ba755bb2fe (diff) | |
download | external_llvm-9d89df169027035bf692b3d397bb93cff7bdc860.zip external_llvm-9d89df169027035bf692b3d397bb93cff7bdc860.tar.gz external_llvm-9d89df169027035bf692b3d397bb93cff7bdc860.tar.bz2 |
Hide MetadataContext implementation details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Metadata.h | 29 | ||||
-rw-r--r-- | include/llvm/Value.h | 4 |
2 files changed, 13 insertions, 20 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index d16b7dc..2ea00e0 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -20,8 +20,6 @@ #include "llvm/Type.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/StringMap.h" #include "llvm/ADT/ilist_node.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ValueHandle.h" @@ -30,6 +28,7 @@ namespace llvm { class Constant; class Instruction; class LLVMContext; +class MetadataContextImpl; //===----------------------------------------------------------------------===// // MetadataBase - A base class for MDNode, MDString and NamedMDNode. @@ -224,20 +223,15 @@ public: /// must start with an alphabet. The regular expression used to check name /// is [a-zA-Z$._][a-zA-Z$._0-9]* class MetadataContext { -public: - typedef std::pair<unsigned, TrackingVH<MDNode> > MDPairTy; - typedef SmallVector<MDPairTy, 2> MDMapTy; - typedef DenseMap<const Instruction *, MDMapTy> MDStoreTy; - friend class BitcodeReader; -private: - - /// MetadataStore - Collection of metadata used in this context. - MDStoreTy MetadataStore; - - /// MDHandlerNames - Map to hold metadata handler names. - StringMap<unsigned> MDHandlerNames; + // DO NOT IMPLEMENT + MetadataContext(MetadataContext&); + void operator=(MetadataContext&); + MetadataContextImpl *const pImpl; public: + MetadataContext(); + ~MetadataContext(); + /// registerMDKind - Register a new metadata kind and return its ID. /// A metadata kind can be registered only once. unsigned registerMDKind(StringRef Name); @@ -254,7 +248,8 @@ public: MDNode *getMD(unsigned Kind, const Instruction *Inst); /// getMDs - Get the metadata attached to an Instruction. - void getMDs(const Instruction *Inst, SmallVectorImpl<MDPairTy> &MDs) const; + void getMDs(const Instruction *Inst, + SmallVectorImpl<std::pair<unsigned, TrackingVH<MDNode> > > &MDs) const; /// addMD - Attach the metadata of given kind to an Instruction. void addMD(unsigned Kind, MDNode *Node, Instruction *Inst); @@ -276,9 +271,7 @@ public: /// ValueIsDeleted - This handler is used to update metadata store /// when a value is deleted. void ValueIsDeleted(const Value *) {} - void ValueIsDeleted(Instruction *Inst) { - removeAllMetadata(Inst); - } + void ValueIsDeleted(Instruction *Inst); void ValueIsRAUWd(Value *V1, Value *V2); /// ValueIsCloned - This handler is used to update metadata store diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 6b393f6..c09fdfb 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -42,7 +42,7 @@ class raw_ostream; class AssemblyAnnotationWriter; class ValueHandleBase; class LLVMContext; -class MetadataContext; +class MetadataContextImpl; //===----------------------------------------------------------------------===// // Value Class @@ -83,7 +83,7 @@ private: friend class ValueSymbolTable; // Allow ValueSymbolTable to directly mod Name. friend class SymbolTable; // Allow SymbolTable to directly poke Name. friend class ValueHandleBase; - friend class MetadataContext; + friend class MetadataContextImpl; friend class AbstractTypeUser; ValueName *Name; |