diff options
-rw-r--r-- | include/llvm/Value.h | 1 | ||||
-rw-r--r-- | lib/VMCore/Value.cpp | 8 |
2 files changed, 1 insertions, 8 deletions
diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 584b80e..0ff0f7e 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -130,7 +130,6 @@ public: void setName(const Twine &Name); void setName(const char *Name, unsigned NameLen); - void setName(const char *Name); // Takes a null-terminated string. /// takeName - transfer the name from V to this value, setting V's name to diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 9d6af5a..1b9fe51 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -167,9 +167,7 @@ unsigned Value::getNameLen() const { std::string Value::getNameStr() const { - if (Name == 0) return ""; - return std::string(Name->getKeyData(), - Name->getKeyData()+Name->getKeyLength()); + return getName().str(); } void Value::setName(const Twine &Name) { @@ -178,10 +176,6 @@ void Value::setName(const Twine &Name) { setName(NameData.begin(), NameData.size()); } -void Value::setName(const char *Name) { - setName(Name, Name ? strlen(Name) : 0); -} - void Value::setName(const char *NameStr, unsigned NameLen) { if (NameLen == 0 && !hasName()) return; assert(getType() != Type::VoidTy && "Cannot assign a name to void values!"); |