[PATCH] Support constant expressions, including non-type template parameters, in pragma loop hints

Tyler Nowicki tnowicki at apple.com
Mon Jul 28 14:37:14 PDT 2014


>> Hi,
>> 
>> My internship finishes up this week, and Aaron informed me he won’t be able
>> to respond until next week. Would someone be able to review the patches
>> these patches so I can get them in before I leave?
> 
> Not to make a liar of you (I really am on "vacation"), but I don't
> want you to get stuck waiting on me. :-)
> 
> Minor comments, but with fixing them up, LGTM!

Thanks! Sorry to drag you away from your vacation.

I made your corrections and I will commit the patch. The only think I didn’t do was to change the raw_ostream because this patch is a lead-up to the constant expression patch. AFAIK the only way to print a constant expression is to use printPretty which requires a raw_ostream.  So 'OS << value' in the this patch becomes 'value->printPretty(OS, nullptr, Policy);’ in the next.


>> Index: include/clang/Basic/Attr.td
>> ===================================================================
>> --- include/clang/Basic/Attr.td (revision 214099)
>> +++ include/clang/Basic/Attr.td (working copy)
>> @@ -1815,12 +1815,6 @@
>>     llvm_unreachable("Unhandled LoopHint option.");
>>   }
>> 
>> -  static StringRef getValueName(int Value) {
>> -    if (Value)
>> -      return "enable";
>> -    return "disable";
>> -  }
>> -
> 
> Good catch here, but will this conflict with Mark's upcoming patch? I
> don't think it will, but better to ask now. ;-)

I don’t think so. Mark’s nounroll patch is already in.



More information about the cfe-commits mailing list