[llvm] r264823 - IR: Constify LLVMContext::discardValueNames, NFC

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 16:52:22 PDT 2016


Ah, Mehdi in r263088.

Mehdi, do you mind fixing the name?  Or I can do it next time I'm
in the file.

> On 2016-Mar-30, at 16:49, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> 
> Probably.  I like "should".  I'll look through the logs to see
> who added this.
> 
>> On 2016-Mar-30, at 16:28, Sean Silva <chisophugis at gmail.com> wrote:
>> 
>> 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.
>> 
>> -- Sean Silva
>> 
>> On Tue, Mar 29, 2016 at 9:32 PM, Duncan P. N. Exon Smith via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>> Author: dexonsmith
>> Date: Tue Mar 29 23:32:29 2016
>> New Revision: 264823
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=264823&view=rev
>> Log:
>> IR: Constify LLVMContext::discardValueNames, NFC
>> 
>> Modified:
>>    llvm/trunk/include/llvm/IR/LLVMContext.h
>>    llvm/trunk/lib/IR/LLVMContext.cpp
>> 
>> Modified: llvm/trunk/include/llvm/IR/LLVMContext.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/LLVMContext.h?rev=264823&r1=264822&r2=264823&view=diff
>> ==============================================================================
>> --- llvm/trunk/include/llvm/IR/LLVMContext.h (original)
>> +++ llvm/trunk/include/llvm/IR/LLVMContext.h Tue Mar 29 23:32:29 2016
>> @@ -108,7 +108,7 @@ public:
>>   /// Return true if the Context runtime configuration is set to discard all
>>   /// value names. When true, only GlobalValue names will be available in the
>>   /// IR.
>> -  bool discardValueNames();
>> +  bool discardValueNames() const;
>> 
>>   /// Set the Context runtime configuration to discard all value name (but
>>   /// GlobalValue). Clients can use this flag to save memory and runtime,
>> 
>> Modified: llvm/trunk/lib/IR/LLVMContext.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContext.cpp?rev=264823&r1=264822&r2=264823&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/IR/LLVMContext.cpp (original)
>> +++ llvm/trunk/lib/IR/LLVMContext.cpp Tue Mar 29 23:32:29 2016
>> @@ -331,7 +331,7 @@ void LLVMContext::deleteGC(const Functio
>>   pImpl->GCNames.erase(&Fn);
>> }
>> 
>> -bool LLVMContext::discardValueNames() { return pImpl->DiscardValueNames; }
>> +bool LLVMContext::discardValueNames() const { return pImpl->DiscardValueNames; }
>> 
>> void LLVMContext::setDiscardValueNames(bool Discard) {
>>   pImpl->DiscardValueNames = Discard;
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>> 
> 



More information about the llvm-commits mailing list