aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-15 18:53:54 +0000
committerChris Lattner <sabre@nondot.org>2007-02-15 18:53:54 +0000
commit924b1ca9ee02b648149d76b62e30f5d9c0ebbf27 (patch)
tree63fd07e416181542d2c50bccb3944928c86a7e4a
parentc48aafe6c6d6f63197b1e21f6f5e7fb963fd313f (diff)
Add a new Value::getNameStr method, which is preferred over getName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34310 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Value.h3
-rw-r--r--lib/VMCore/Value.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index 95d86ce782..ddfcbb6979 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -87,7 +87,8 @@ public:
// All values can potentially be named...
inline bool hasName() const { return Name != 0; }
- std::string getName() const;
+ std::string getName() const { return getNameStr(); }
+ std::string getNameStr() const;
ValueName *getValueName() const { return Name; }
void setName(const std::string &name);
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index c7af931359..4d4944c010 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -112,7 +112,7 @@ static bool getSymTab(Value *V, ValueSymbolTable *&ST) {
return false;
}
-std::string Value::getName() const {
+std::string Value::getNameStr() const {
if (Name == 0) return "";
return std::string(Name->getKeyData(),
Name->getKeyData()+Name->getKeyLength());