diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 04:41:11 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 04:41:11 +0000 |
commit | e3572baab5f601c194de60077cec5e022a926b2e (patch) | |
tree | 1efda7d33cf044d4f99e4a44fdfc6f9328671cc5 /lib/VMCore/Value.cpp | |
parent | 3e7381f4511954c5989543abd37e31b176ce21c2 (diff) | |
download | external_llvm-e3572baab5f601c194de60077cec5e022a926b2e.zip external_llvm-e3572baab5f601c194de60077cec5e022a926b2e.tar.gz external_llvm-e3572baab5f601c194de60077cec5e022a926b2e.tar.bz2 |
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 'lib/VMCore/Value.cpp')
-rw-r--r-- | lib/VMCore/Value.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 71dec84..d020c39 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -20,6 +20,7 @@ #include "llvm/Module.h" #include "llvm/MDNode.h" #include "llvm/ValueSymbolTable.h" +#include "llvm/ADT/SmallString.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/LeakDetector.h" @@ -183,8 +184,10 @@ StringRef Value::getNameRef() const { return StringRef(Name->getKeyData(), Name->getKeyLength()); } -void Value::setName(const std::string &name) { - setName(&name[0], name.size()); +void Value::setName(const Twine &Name) { + SmallString<32> NameData; + Name.toVector(NameData); + setName(NameData.begin(), NameData.size()); } void Value::setName(const char *Name) { |