<div dir="ltr">This function's naming is confusing. Shouldn't it be `getDiscardValueNames` or `shouldDiscardValueNames` or similar? As it stands, our rule about "functions should be verb phrases" makes a name like `discardValueNames` sounds like this function does discarding.<div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 29, 2016 at 9:32 PM, Duncan P. N. Exon Smith via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dexonsmith<br>
Date: Tue Mar 29 23:32:29 2016<br>
New Revision: 264823<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=264823&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=264823&view=rev</a><br>
Log:<br>
IR: Constify LLVMContext::discardValueNames, NFC<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/IR/LLVMContext.h<br>
    llvm/trunk/lib/IR/LLVMContext.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/IR/LLVMContext.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/LLVMContext.h?rev=264823&r1=264822&r2=264823&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/LLVMContext.h?rev=264823&r1=264822&r2=264823&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/LLVMContext.h (original)<br>
+++ llvm/trunk/include/llvm/IR/LLVMContext.h Tue Mar 29 23:32:29 2016<br>
@@ -108,7 +108,7 @@ public:<br>
   /// Return true if the Context runtime configuration is set to discard all<br>
   /// value names. When true, only GlobalValue names will be available in the<br>
   /// IR.<br>
-  bool discardValueNames();<br>
+  bool discardValueNames() const;<br>
<br>
   /// Set the Context runtime configuration to discard all value name (but<br>
   /// GlobalValue). Clients can use this flag to save memory and runtime,<br>
<br>
Modified: llvm/trunk/lib/IR/LLVMContext.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContext.cpp?rev=264823&r1=264822&r2=264823&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContext.cpp?rev=264823&r1=264822&r2=264823&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/LLVMContext.cpp (original)<br>
+++ llvm/trunk/lib/IR/LLVMContext.cpp Tue Mar 29 23:32:29 2016<br>
@@ -331,7 +331,7 @@ void LLVMContext::deleteGC(const Functio<br>
   pImpl->GCNames.erase(&Fn);<br>
 }<br>
<br>
-bool LLVMContext::discardValueNames() { return pImpl->DiscardValueNames; }<br>
+bool LLVMContext::discardValueNames() const { return pImpl->DiscardValueNames; }<br>
<br>
 void LLVMContext::setDiscardValueNames(bool Discard) {<br>
   pImpl->DiscardValueNames = Discard;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>