Switch ValueSymbolTable to StringRef based API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76894 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/ValueSymbolTable.h b/include/llvm/ValueSymbolTable.h
index 752dd2f..c9dc82b 100644
--- a/include/llvm/ValueSymbolTable.h
+++ b/include/llvm/ValueSymbolTable.h
@@ -24,6 +24,7 @@
class BasicBlock;
class Function;
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
@@ -62,12 +63,11 @@
/// @{
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 +110,7 @@
/// 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