Rewrite getName{Start,End,Len} in terms of getName(), instead of vice-versa.
llvm-svn: 77105
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp
index 67cd11a..fa82bac 100644
--- a/llvm/lib/VMCore/Value.cpp
+++ b/llvm/lib/VMCore/Value.cpp
@@ -151,21 +151,11 @@
return false;
}
-/// getNameStart - Return a pointer to a null terminated string for this name.
-/// Note that names can have null characters within the string as well as at
-/// their end. This always returns a non-null pointer.
-const char *Value::getNameStart() const {
- if (Name == 0) return "";
- return Name->getKeyData();
+StringRef Value::getName() const {
+ if (!Name) return StringRef();
+ return Name->getKey();
}
-/// getNameLen - Return the length of the string, correctly handling nul
-/// characters embedded into them.
-unsigned Value::getNameLen() const {
- return Name ? Name->getKeyLength() : 0;
-}
-
-
std::string Value::getNameStr() const {
return getName().str();
}