diff options
author | Devang Patel <dpatel@apple.com> | 2010-01-12 18:34:06 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-01-12 18:34:06 +0000 |
commit | 26028f27ddd132b3284943e11aca130c2911abc4 (patch) | |
tree | b9ca5788e930a6077497944374e35de9988758fc /include | |
parent | 3bda20112e2c8bf583eddb3c08da1b0d7455baee (diff) | |
download | external_llvm-26028f27ddd132b3284943e11aca130c2911abc4.zip external_llvm-26028f27ddd132b3284943e11aca130c2911abc4.tar.gz external_llvm-26028f27ddd132b3284943e11aca130c2911abc4.tar.bz2 |
Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93247 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Metadata.h | 2 | ||||
-rw-r--r-- | include/llvm/Module.h | 7 | ||||
-rw-r--r-- | include/llvm/ValueSymbolTable.h | 3 |
3 files changed, 6 insertions, 6 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index 282ee85..f490bad 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -184,8 +184,8 @@ private: /// NamedMDNode is always named. All NamedMDNode operand has a type of metadata. class NamedMDNode : public Value, public ilist_node<NamedMDNode> { friend class SymbolTableListTraits<NamedMDNode, Module>; + friend class ilist_traits<NamedMDNode>; friend class LLVMContextImpl; - NamedMDNode(const NamedMDNode &); // DO NOT IMPLEMENT std::string Name; diff --git a/include/llvm/Module.h b/include/llvm/Module.h index a5a2ad4..3c8055d 100644 --- a/include/llvm/Module.h +++ b/include/llvm/Module.h @@ -57,6 +57,7 @@ template<> struct ilist_traits<GlobalAlias> static GlobalAlias *createSentinel(); static void destroySentinel(GlobalAlias *GA) { delete GA; } }; + template<> struct ilist_traits<NamedMDNode> : public SymbolTableListTraits<NamedMDNode, Module> { // createSentinel is used to get hold of a node that marks the end of @@ -69,6 +70,8 @@ template<> struct ilist_traits<NamedMDNode> NamedMDNode *provideInitialHead() const { return createSentinel(); } NamedMDNode *ensureHead(NamedMDNode*) const { return createSentinel(); } static void noteHead(NamedMDNode*, NamedMDNode*) {} + void addNodeToList(NamedMDNode *N); + void removeNodeFromList(NamedMDNode *N); private: mutable ilist_node<NamedMDNode> Sentinel; }; @@ -324,10 +327,6 @@ public: /// NamedMDNode with the specified name is not found. NamedMDNode *getOrInsertNamedMetadata(StringRef Name); - /// addMDNodeName - Insert an entry in the NamedMDNode symbol table mapping - /// Name to NMD. - void addMDNodeName(StringRef Name, NamedMDNode *NMD); - /// @} /// @name Type Accessors /// @{ diff --git a/include/llvm/ValueSymbolTable.h b/include/llvm/ValueSymbolTable.h index 060dba3..53815ba 100644 --- a/include/llvm/ValueSymbolTable.h +++ b/include/llvm/ValueSymbolTable.h @@ -17,6 +17,7 @@ #include "llvm/Value.h" #include "llvm/ADT/StringMap.h" #include "llvm/System/DataTypes.h" +#include "llvm/ADT/ilist_node.h" namespace llvm { template<typename ValueSubClass, typename ItemParentClass> @@ -39,7 +40,6 @@ class ValueSymbolTable { friend class SymbolTableListTraits<Function, Module>; friend class SymbolTableListTraits<GlobalVariable, Module>; friend class SymbolTableListTraits<GlobalAlias, Module>; - friend class SymbolTableListTraits<NamedMDNode, Module>; /// @name Types /// @{ public: @@ -133,6 +133,7 @@ private: /// essentially a StringMap wrapper. class MDSymbolTable { + friend class SymbolTableListTraits<NamedMDNode, Module>; /// @name Types /// @{ private: |