summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorTyler Nowicki <tnowicki@apple.com>2014-07-31 20:15:14 +0000
committerTyler Nowicki <tnowicki@apple.com>2014-07-31 20:15:14 +0000
commit0c9b34b3ec40f548d2e9eeac7f51731137f18463 (patch)
treef2fe55be4afe976e2e23fd24b4f28cf357d93eea /clang/lib/Parse/ParseStmt.cpp
parent18fab4684d15da6627cb3b92d6a8ad4999a3361d (diff)
downloadbcm5719-llvm-0c9b34b3ec40f548d2e9eeac7f51731137f18463.tar.gz
bcm5719-llvm-0c9b34b3ec40f548d2e9eeac7f51731137f18463.zip
Add a state variable to the loop hint attribute.
This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler. Resubmit with changes to try to fix the build-bot issue. Reviewed by Aaron Ballman llvm-svn: 214432
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r--clang/lib/Parse/ParseStmt.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 38723b1293d..a431270d2b1 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -1817,10 +1817,11 @@ StmtResult Parser::ParsePragmaLoopHint(StmtVector &Stmts, bool OnlyStatement,
// Get loop hints and consume annotated token.
while (Tok.is(tok::annot_pragma_loop_hint)) {
- LoopHint Hint = HandlePragmaLoopHint();
- ConsumeToken();
+ LoopHint Hint;
+ if (!HandlePragmaLoopHint(Hint))
+ continue;
- ArgsUnion ArgHints[] = {Hint.PragmaNameLoc, Hint.OptionLoc, Hint.ValueLoc,
+ ArgsUnion ArgHints[] = {Hint.PragmaNameLoc, Hint.OptionLoc, Hint.StateLoc,
ArgsUnion(Hint.ValueExpr)};
TempAttrs.addNew(Hint.PragmaNameLoc->Ident, Hint.Range, nullptr,
Hint.PragmaNameLoc->Loc, ArgHints, 4,
OpenPOWER on IntegriCloud