diff options
Diffstat (limited to 'include')
-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; |