]> granicus.if.org Git - llvm/commitdiff
[IR] Clarify that Value::getName() is not actually cheap.
authorJustin Lebar <jlebar@google.com>
Thu, 29 Dec 2016 00:30:42 +0000 (00:30 +0000)
committerJustin Lebar <jlebar@google.com>
Thu, 29 Dec 2016 00:30:42 +0000 (00:30 +0000)
It involves a hashtable lookup when the Value has a name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290695 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Value.h

index ac37a45a86be5cb9623a90f472c92d4c66d20389..bdafbbf58cc45f191c9791def9fca4b70061dcec 100644 (file)
@@ -245,8 +245,9 @@ private:
 public:
   /// \brief 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 guaranteed to return the same reference as long as the value is not
+  /// modified.  If the value has a name, this does a hashtable lookup, so it's
+  /// not free.
   StringRef getName() const;
 
   /// \brief Change the name of the value.