aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Value.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-26 01:04:10 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-26 01:04:10 +0000
commitc993250dd2a4e4f6629179613b6b0757108319e7 (patch)
tree38bf298a021a5fbfd0daac05bf3861a84b02a62a /include/llvm/Value.h
parent499027fb4826e25919f2ea154ca4db73842560af (diff)
downloadexternal_llvm-c993250dd2a4e4f6629179613b6b0757108319e7.zip
external_llvm-c993250dd2a4e4f6629179613b6b0757108319e7.tar.gz
external_llvm-c993250dd2a4e4f6629179613b6b0757108319e7.tar.bz2
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... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Value.h')
-rw-r--r--include/llvm/Value.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index bee70b2..72669cf 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -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.