summaryrefslogtreecommitdiff
path: root/include/llvm/Value.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-25 04:41:11 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-25 04:41:11 +0000
commit6e0d1cb30957a636c53158d3089e6fb88348a57a (patch)
tree1efda7d33cf044d4f99e4a44fdfc6f9328671cc5 /include/llvm/Value.h
parenta66297af3048c9f03ae79d1995dc6bdecfbc46c0 (diff)
downloadllvm-6e0d1cb30957a636c53158d3089e6fb88348a57a.tar.gz
llvm-6e0d1cb30957a636c53158d3089e6fb88348a57a.tar.bz2
llvm-6e0d1cb30957a636c53158d3089e6fb88348a57a.tar.xz
Initial update to VMCore to use Twines for string arguments.
- The only meat here is in Value.{h,cpp} the rest is essential 'const std::string &' -> 'const Twine &'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77048 91177308-0d34-0410-b5e6-96231b3b80d8
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.