From be6535b3dca5c5af4ef83c7a2c4fcd941d2bd4b2 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 15 Nov 2011 18:30:12 +0000 Subject: [PATCH] Remove Value::getNameStr. It has been deprecated for a while and provides no additional value over getName(). llvm-svn: 144657 --- llvm/include/llvm/Value.h | 11 ----------- llvm/lib/VMCore/Value.cpp | 4 ---- 2 files changed, 15 deletions(-) diff --git a/llvm/include/llvm/Value.h b/llvm/include/llvm/Value.h index a71e2fdefd72..9b47143b7fdc 100644 --- a/llvm/include/llvm/Value.h +++ b/llvm/include/llvm/Value.h @@ -117,19 +117,8 @@ public: /// getName() - Return a constant reference to the value's name. This is cheap /// and guaranteed to return the same reference as long as the value is not /// modified. - /// - /// This is currently guaranteed to return a StringRef for which data() points - /// to a valid null terminated string. The use of StringRef.data() is - /// deprecated here, however, and clients should not rely on it. If such - /// behavior is needed, clients should use expensive getNameStr(), or switch - /// to an interface that does not depend on null termination. StringRef getName() const; - /// getNameStr() - Return the name of the specified value, *constructing a - /// string* to hold it. This is guaranteed to construct a string and is very - /// expensive, clients should use getName() unless necessary. - std::string getNameStr() const; - /// setName() - Change the name of the value, choosing a new unique name if /// the provided name is taken. /// diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp index b9a1e54935d2..291df917706c 100644 --- a/llvm/lib/VMCore/Value.cpp +++ b/llvm/lib/VMCore/Value.cpp @@ -156,10 +156,6 @@ StringRef Value::getName() const { return Name->getKey(); } -std::string Value::getNameStr() const { - return getName().str(); -} - void Value::setName(const Twine &NewName) { // Fast path for common IRBuilder case of setName("") when there is no name. if (NewName.isTriviallyEmpty() && !hasName())