diff options
author | Chris Lattner <sabre@nondot.org> | 2008-06-27 21:09:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-06-27 21:09:10 +0000 |
commit | bb0e2487185e401c7fca63d55e59343e060912a2 (patch) | |
tree | b6b4f48495081a9a79f79bab892cc0db79f63780 /include/llvm | |
parent | 25b825b3b848eeb25d49a51f0c78a16db7677465 (diff) | |
download | external_llvm-bb0e2487185e401c7fca63d55e59343e060912a2.zip external_llvm-bb0e2487185e401c7fca63d55e59343e060912a2.tar.gz external_llvm-bb0e2487185e401c7fca63d55e59343e060912a2.tar.bz2 |
Add a new version of Module::getFunction that takes a const char* instead
of a std::string. This avoids copying the string to the heap in common
cases. Patch by Pratik Solanki!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52834 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Module.h | 1 | ||||
-rw-r--r-- | include/llvm/ValueSymbolTable.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/Module.h b/include/llvm/Module.h index bce671d..56207a0 100644 --- a/include/llvm/Module.h +++ b/include/llvm/Module.h @@ -209,6 +209,7 @@ public: /// getFunction - Look up the specified function in the module symbol table. /// If it does not exist, return null. Function *getFunction(const std::string &Name) const; + Function *getFunction(const char *Name) const; /// @} /// @name Global Variable Accessors diff --git a/include/llvm/ValueSymbolTable.h b/include/llvm/ValueSymbolTable.h index 54522df..6f79f6f 100644 --- a/include/llvm/ValueSymbolTable.h +++ b/include/llvm/ValueSymbolTable.h @@ -67,6 +67,7 @@ public: /// @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; /// @returns true iff the symbol table is empty /// @brief Determine if the symbol table is empty |