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

Dan Gohman gohman at apple.com
Wed Mar 11 18:08:30 PDT 2009


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.

Dan




More information about the llvm-commits mailing list