- inline bool hasName() const { return !Name.empty(); }
- inline const std::string &getName() const { return Name; }
+ 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;
+