aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Value.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Value.h')
-rw-r--r--include/llvm/Value.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index 720cc1935b..1f5bd7ff31 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -17,6 +17,7 @@
#include "llvm/AbstractTypeUser.h"
#include "llvm/Use.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Support/Casting.h"
#include <iosfwd>
#include <string>
@@ -128,11 +129,11 @@ public:
/// getName()/getNameStr() - Return the name of the specified value,
/// *constructing a string* to hold it. Because these are guaranteed to
/// construct a string, they are very expensive and should be avoided.
- std::string getName() const { return getNameStr(); }
+ StringRef getName() const { return StringRef(getNameStart(), getNameLen()); }
std::string getNameStr() const;
StringRef getNameRef() const;
- void setName(const std::string &name);
+ void setName(const Twine &Name);
void setName(const char *Name, unsigned NameLen);
void setName(const char *Name); // Takes a null-terminated string.