[llvm-commits] [llvm] r127714 - /llvm/trunk/include/llvm/Target/TargetData.h

Cameron Zwarich zwarich at apple.com
Wed Mar 16 01:14:10 PDT 2011


On 2011-03-16, at 1:08 AM, Duncan Sands wrote:

> Hi Cameron,
> 
>> +  bool fitsInLegalInteger(unsigned Width) const {
>> +    for (unsigned i = 0, e = (unsigned)LegalIntWidths.size(); i != e; ++i)
>> +      if (Width<= LegalIntWidths[i])
>> +        return true;
> 
> if LegalIntWidths is sorted then you only need to do one comparison here.

It isn't sorted, but maybe it makes sense to sort it and do that.

Cameron



More information about the llvm-commits mailing list