From: Justin Lebar Date: Thu, 29 Dec 2016 00:30:42 +0000 (+0000) Subject: [IR] Clarify that Value::getName() is not actually cheap. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a1c1a8d25f2d3849b79df196dc035c0c83c84dd;p=llvm [IR] Clarify that Value::getName() is not actually cheap. 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 --- diff --git a/include/llvm/IR/Value.h b/include/llvm/IR/Value.h index ac37a45a86b..bdafbbf58cc 100644 --- a/include/llvm/IR/Value.h +++ b/include/llvm/IR/Value.h @@ -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.