diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-10 15:34:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-10 15:34:35 +0000 |
commit | 71996e73d8050d2b8805b14a48ab635155b11a12 (patch) | |
tree | 50f63865fa6df6bfca0c5ce40e6365d8dba17441 /include/llvm/Value.h | |
parent | 57a6f30125ad4f83de0147379835e4386872f479 (diff) | |
download | external_llvm-71996e73d8050d2b8805b14a48ab635155b11a12.zip external_llvm-71996e73d8050d2b8805b14a48ab635155b11a12.tar.gz external_llvm-71996e73d8050d2b8805b14a48ab635155b11a12.tar.bz2 |
add Value::getNameStart/getNameLen() accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Value.h')
-rw-r--r-- | include/llvm/Value.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 44c4453..67af6ed 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -88,9 +88,23 @@ public: // All values can potentially be named... inline bool hasName() const { return Name != 0; } + ValueName *getValueName() const { return Name; } + + /// getNameStart - Return a pointer to a null terminated string for this name. + /// Note that names can have null characters within the string as well as at + /// their end. This always returns a non-null pointer. + const char *getNameStart() const; + + /// getNameLen - Return the length of the string, correctly handling nul + /// characters embedded into them. + unsigned getNameLen() const; + + /// 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(); } std::string getNameStr() const; - ValueName *getValueName() const { return Name; } + void setName(const std::string &name); void setName(const char *Name, unsigned NameLen); |