[llvm-commits] [llvm] r77106 - /llvm/trunk/include/llvm/Value.h

Daniel Dunbar daniel at zuster.org
Sat Jul 25 18:04:10 PDT 2009


Author: ddunbar
Date: Sat Jul 25 20:04:10 2009
New Revision: 77106

URL: http://llvm.org/viewvc/llvm-project?rev=77106&view=rev
Log:
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...

Modified:
    llvm/trunk/include/llvm/Value.h

Modified: llvm/trunk/include/llvm/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=77106&r1=77105&r2=77106&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Value.h (original)
+++ llvm/trunk/include/llvm/Value.h Sat Jul 25 20:04:10 2009
@@ -114,9 +114,15 @@
   /// 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.





More information about the llvm-commits mailing list