[llvm-commits] [patch][pr12251] Add range metadata to llvm. Make clang produce it.

Chris Lattner clattner at apple.com
Fri Mar 23 14:55:48 PDT 2012


On Mar 23, 2012, at 2:15 PM, Rafael EspĂ­ndola wrote:
>> Finally, this patch does the wrong thing for an enum which is empty, or
>> whose only value is 0. Such an enum has a range of representable values of
>> [0, 1], not [0, 0].
> 
> Has this been changed recently? I am looking at paragraph 7 of
> [dcl.enum] in n3337.  I am getting

I don't have any useful feedback on the algorithmic aspect of this patch, but please structure it like this:

  if (CGM.getCodeGenOpts().OptimizationLevel > 0)
    if (MDNode *RangeInfo = getRangeForLoadFromType(Ty))
      Load->setMetadata(..., RangeInfo);

This makes it easier to read and extend the code, and means that you're really not computing random properties at -O0.

-Chris

 



More information about the llvm-commits mailing list