1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00

Some clients rely on getName{Start,End} not returning 0, even if the length is

0.
 - I could have swore the prev change went through a make check cycle...

llvm-svn: 77106
This commit is contained in:
Daniel Dunbar 2009-07-26 01:04:10 +00:00
parent 518cd20f61
commit 3c3f0d5b63

View File

@ -114,9 +114,15 @@ public:
/// 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 { return getName().begin(); }
const char *getNameStart() const {
if (!Name) return "";
return getName().begin();
}
/// getNameEnd - Return a pointer to the end of the name.
const char *getNameEnd() const { return getName().end(); }
const char *getNameEnd() const {
if (!Name) return "";
return getName().end();
}
/// getNameLen - Return the length of the string, correctly handling nul
/// characters embedded into them.