And the last piece of the constant _expression_ patch is to parse multiple tokens, add the Expr variable to the loop hint attribute, handle template instantiation, get the value at codegen, and of course tests.
Apply the attached patch with -p1 on top of loop_hint_attr_state-svn.patch.
Thanks again for reviewing these while you are on vacation!
Tyler
|
pragma_constant_expression.patch
Description: Binary data
Hi Aaron,
I’ve cut another piece off the constant _expression_ patch. This piece adds the state variable to the loop hint attribute. Would you be able tor review it?
Parts of this patch may seem a little overkill, they are necessary to support constant expressions. Specifically, the way the argument to a loop hint pragma is handled. The single token argument is replaced by an array of tokens which either give a keyword (single token) or a constant _expression_ (multiple tokens). We need to have these cases separated out to pass the hint to the SemaStmtAttr handler. Consequently validation of the keywords must move from SemaStmtAttr handler to the loop hint annotation token handler. It makes the token handler a bit more complicated and the SemaStmtAttr a bit simpler.
A couple of new tests are included as well.
Tyler
<loop_hint_attr_state-svn.patch>
On Mon, Jul 28, 2014 at 5:37 PM, Tyler Nowicki < [email protected]> wrote:
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.
No worries. :-) 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.
Ah, sounds good to me! 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.
Phew. :-) ~Aaron
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
|
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits