diff options
Diffstat (limited to 'include/llvm/ValueSymbolTable.h')
-rw-r--r-- | include/llvm/ValueSymbolTable.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/llvm/ValueSymbolTable.h b/include/llvm/ValueSymbolTable.h index 752dd2f..4f8ebe8 100644 --- a/include/llvm/ValueSymbolTable.h +++ b/include/llvm/ValueSymbolTable.h @@ -23,7 +23,9 @@ namespace llvm { class SymbolTableListTraits; class BasicBlock; class Function; + class NamedMDNode; class Module; + class StringRef; /// This class provides a symbol table of name/value pairs. It is essentially /// a std::map<std::string,Value*> but has a controlled interface provided by @@ -37,6 +39,7 @@ 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: @@ -62,12 +65,11 @@ public: /// @{ public: - /// This method finds the value with the given \p name in the + /// This method finds the value with the given \p Name in the /// the symbol table. - /// @returns the value associated with the \p name + /// @returns the value associated with the \p Name /// @brief Lookup a named Value. - Value *lookup(const std::string &name) const; - Value *lookup(const char *NameBegin, const char *NameEnd) const; + Value *lookup(const StringRef &Name) const { return vmap.lookup(Name); } /// @returns true iff the symbol table is empty /// @brief Determine if the symbol table is empty @@ -110,7 +112,7 @@ private: /// createValueName - This method attempts to create a value name and insert /// it into the symbol table with the specified name. If it conflicts, it /// auto-renames the name and returns that instead. - ValueName *createValueName(const char *NameStart, unsigned NameLen, Value *V); + ValueName *createValueName(const StringRef &Name, Value *V); /// This method removes a value from the symbol table. It leaves the /// ValueName attached to the value, but it is no longer inserted in the |