diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 23:55:21 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 23:55:21 +0000 |
commit | 03d7651c3652e1f0cc86e79b26585d86818da9cf (patch) | |
tree | b37623b927e150417e2964ee0464745404207d39 /include | |
parent | 460d51e0c029814cd901a2642bcaa7d776ff5929 (diff) | |
download | external_llvm-03d7651c3652e1f0cc86e79b26585d86818da9cf.zip external_llvm-03d7651c3652e1f0cc86e79b26585d86818da9cf.tar.gz external_llvm-03d7651c3652e1f0cc86e79b26585d86818da9cf.tar.bz2 |
Remove Value::{isName, getNameRef}.
Also, change MDString to use a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MDNode.h | 14 | ||||
-rw-r--r-- | include/llvm/Value.h | 5 |
2 files changed, 7 insertions, 12 deletions
diff --git a/include/llvm/MDNode.h b/include/llvm/MDNode.h index 06cc909..551c2e9 100644 --- a/include/llvm/MDNode.h +++ b/include/llvm/MDNode.h @@ -64,25 +64,25 @@ public: /// class MDString : public MetadataBase { MDString(const MDString &); // DO NOT IMPLEMENT - const char *StrBegin; - unsigned StrLength; + StringRef Str; friend class LLVMContextImpl; protected: explicit MDString(const char *begin, unsigned l) - : MetadataBase(Type::MetadataTy, Value::MDStringVal), - StrBegin(begin), StrLength(l) {} + : MetadataBase(Type::MetadataTy, Value::MDStringVal), Str(begin, l) {} public: - unsigned length() const { return StrLength; } + StringRef getString() const { return Str; } + + unsigned length() const { return Str.size(); } /// begin() - Pointer to the first byte of the string. /// - const char *begin() const { return StrBegin; } + const char *begin() const { return Str.begin(); } /// end() - Pointer to one byte past the end of the string. /// - const char *end() const { return StrBegin + length(); } + const char *end() const { return Str.end(); } /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const MDString *) { return true; } diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 1f5bd7f..584b80e 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -118,10 +118,6 @@ public: /// getNameEnd - Return a pointer to the end of the name. const char *getNameEnd() const { return getNameStart() + getNameLen(); } - /// isName - Return true if this value has the name specified by the provided - /// nul terminated string. - bool isName(const char *N) const; - /// getNameLen - Return the length of the string, correctly handling nul /// characters embedded into them. unsigned getNameLen() const; @@ -131,7 +127,6 @@ public: /// construct a string, they are very expensive and should be avoided. StringRef getName() const { return StringRef(getNameStart(), getNameLen()); } std::string getNameStr() const; - StringRef getNameRef() const; void setName(const Twine &Name); void setName(const char *Name, unsigned NameLen); |