Add a comment on Value explaining the current getName() behavior.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 27 Jul 2009 22:39:14 +0000 (22:39 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 27 Jul 2009 22:39:14 +0000 (22:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77269 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Value.h

index 7965ca572235d7d57434a00d518e1cec60476dfb..cc70ce13c0818ff7767233d0d264b4c0ffdd0bc5 100644 (file)
@@ -114,6 +114,12 @@ public:
   /// getName() - Return a constant reference to the value's name. This is cheap
   /// and guaranteed to return the same reference as long as the value is not
   /// modified.
+  ///
+  /// This is currently guaranteed to return a StringRef for which data() points
+  /// to a valid null terminated string. This usage is deprecated, however, and
+  /// clients should not rely on it. If such behavior is needed, clients should
+  /// use getNameStr() or switch to an interface that does not depend on null
+  /// termination.
   StringRef getName() const;
 
   /// getNameStr() - Return the name of the specified value, *constructing a