[llvm-commits] [llvm] r98490 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Bill Wendling isanbard at gmail.com
Sun Mar 14 15:11:09 PDT 2010


On Mar 14, 2010, at 9:41 AM, Nick Lewycky wrote:

> Bill Wendling wrote:
>> Author: void
>> Date: Sun Mar 14 05:40:28 2010
>> New Revision: 98490
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=98490&view=rev
>> Log:
>> Make returns more consistent with others.
>> 
>> Modified:
>>     llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
>> 
>> Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=98490&r1=98489&r2=98490&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
>> +++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Sun Mar 14 05:40:28 2010
>> @@ -1826,7 +1826,7 @@
>>          // switch.
>>          if (BasicBlock *OnlyPred = BB->getSinglePredecessor())
>>            if (SimplifyEqualityComparisonWithOnlyPredecessor(BI, OnlyPred))
>> -            return SimplifyCFG(BB) || 1;
>> +            return SimplifyCFG(BB) | true;
> 
> Isn't this still awkward wording? How about one line to call SimplifyCFG(BB) and one to return true?
> 
I make no judgement on how it was done in other places. :-) This is the idiom used pretty much everywhere else in that function. I'm not a huge fan, but it should at least be consistent.

-bw





More information about the llvm-commits mailing list