aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-26 00:17:14 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-26 00:17:14 +0000
commitd1319ef308ffe3e5de2f90ee11892ff43adbea13 (patch)
tree910a959a45b6ef16a5e6d2831c64bdee4eb74d2c
parent03d7651c3652e1f0cc86e79b26585d86818da9cf (diff)
Remove Value::setName(const char*).
- Split into a separate patch because there is a slight functionality change, it is no longer valid to call setName(0), which was equivalent to setName(""). I'm hoping no one depends on this... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77099 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Value.h1
-rw-r--r--lib/VMCore/Value.cpp8
2 files changed, 1 insertions, 8 deletions
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index 584b80e3e4..0ff0f7ebc9 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 9d6af5a334..1b9fe51332 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!");