From fbd6928545adc5b58894d0588cf09a25cfa93e18 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 15 Feb 2007 18:53:54 +0000 Subject: [PATCH] Add a new Value::getNameStr method, which is preferred over getName. llvm-svn: 34310 --- include/llvm/Value.h | 3 ++- lib/VMCore/Value.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 95d86ce7826..ddfcbb69796 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 c7af9313598..4d4944c010c 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());