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

Dale Johannesen dalej at apple.com
Wed Mar 11 18:10:33 PDT 2009


On Mar 11, 2009, at 6:08 PMPDT, Dan Gohman wrote:
> On Mar 11, 2009, at 6:00 PM, Dale Johannesen wrote:
>> +/// A sorting function for the std::set's in the following function
>> which track
>> +/// the values in switches.  This forces deterministic behavior by
>> comparing
>> +/// the values rather than the pointers.
>> +class Sorter {
>> +public:
>> +  bool operator() (ConstantInt * const &p, ConstantInt * const &q)
>> const {
>> +    return p->getSExtValue() < q->getSExtValue();
>
> Hi Dale,
>
> Switch case values can be larger than 64 bits. It'd be better
> to use APInt's slt method to do the comparison here.


OK, I'll do that, thanks.




More information about the llvm-commits mailing list