From 3d2a56d38758943ee8070cacfd9e29754bdb59b3 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 27 Jul 2009 22:39:14 +0000 Subject: [PATCH] Add a comment on Value explaining the current getName() behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77269 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Value.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 7965ca57223..cc70ce13c08 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -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