diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-23 18:50:53 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-23 18:50:53 +0000 |
commit | e6c42dd6d3cc1e0a8a11224a11bcfbd8c60c6fff (patch) | |
tree | 68d8ca09f495a8f4f68a11580dd1d04e5355b7e9 /lib | |
parent | 8f51a62b41a425f7fe262ff20cee835129ecc072 (diff) | |
download | external_llvm-e6c42dd6d3cc1e0a8a11224a11bcfbd8c60c6fff.zip external_llvm-e6c42dd6d3cc1e0a8a11224a11bcfbd8c60c6fff.tar.gz external_llvm-e6c42dd6d3cc1e0a8a11224a11bcfbd8c60c6fff.tar.bz2 |
Add llvm::Value::getNameRef, for help in API migration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Value.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index b3c0692..a788652 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -178,6 +178,11 @@ std::string Value::getNameStr() const { Name->getKeyData()+Name->getKeyLength()); } +StringRef Value::getNameRef() const { + if (Name == 0) return StringRef(); + return StringRef(Name->getKeyData(), Name->getKeyLength()); +} + void Value::setName(const std::string &name) { setName(&name[0], name.size()); } @@ -238,7 +243,7 @@ void Value::setName(const char *NameStr, unsigned NameLen) { } // Name is changing to something new. - Name = ST->createValueName(NameStr, NameLen, this); + Name = ST->createValueName(StringRef(NameStr, NameLen), this); } |