@@ -836,9 +836,9 @@ TYPE_PARSER(construct<OmpInitClause>(
836
836
TYPE_PARSER(construct<OmpAlignedClause>(Parser<OmpObjectList>{},
837
837
maybe(":" >> nonemptyList(Parser<OmpAlignedClause::Modifier>{}))))
838
838
839
- TYPE_PARSER(construct<OmpUpdateClause>(
840
- construct<OmpUpdateClause>(Parser<OmpDependenceType>{}) ||
841
- construct<OmpUpdateClause>(Parser<OmpTaskDependenceType>{})))
839
+ TYPE_PARSER( //
840
+ construct<OmpUpdateClause>(parenthesized( Parser<OmpDependenceType>{}) ) ||
841
+ construct<OmpUpdateClause>(parenthesized( Parser<OmpTaskDependenceType>{})))
842
842
843
843
TYPE_PARSER(construct<OmpOrderClause>(
844
844
maybe(nonemptyList(Parser<OmpOrderClause::Modifier>{}) / ":"),
@@ -1079,7 +1079,7 @@ TYPE_PARSER( //
1079
1079
parenthesized(nonemptyList(name)))) ||
1080
1080
"UNTIED" >> construct<OmpClause>(construct<OmpClause::Untied>()) ||
1081
1081
"UPDATE" >> construct<OmpClause>(construct<OmpClause::Update>(
1082
- parenthesized (Parser<OmpUpdateClause>{}))) ||
1082
+ maybe (Parser<OmpUpdateClause>{}))) ||
1083
1083
"WHEN" >> construct<OmpClause>(construct<OmpClause::When>(
1084
1084
parenthesized(Parser<OmpWhenClause>{}))) ||
1085
1085
// Cancellable constructs
@@ -1313,24 +1313,30 @@ TYPE_PARSER(
1313
1313
endOfLine)
1314
1314
1315
1315
// Directives enclosing structured-block
1316
- TYPE_PARSER(construct<OmpBlockDirective>(first(
1317
- "MASKED" >> pure(llvm::omp::Directive::OMPD_masked),
1318
- "MASTER" >> pure(llvm::omp::Directive::OMPD_master),
1319
- "ORDERED" >> pure(llvm::omp::Directive::OMPD_ordered),
1320
- "PARALLEL MASKED" >> pure(llvm::omp::Directive::OMPD_parallel_masked),
1321
- "PARALLEL MASTER" >> pure(llvm::omp::Directive::OMPD_parallel_master),
1322
- "PARALLEL WORKSHARE" >> pure(llvm::omp::Directive::OMPD_parallel_workshare),
1323
- "PARALLEL" >> pure(llvm::omp::Directive::OMPD_parallel),
1324
- "SCOPE" >> pure(llvm::omp::Directive::OMPD_scope),
1325
- "SINGLE" >> pure(llvm::omp::Directive::OMPD_single),
1326
- "TARGET DATA" >> pure(llvm::omp::Directive::OMPD_target_data),
1327
- "TARGET PARALLEL" >> pure(llvm::omp::Directive::OMPD_target_parallel),
1328
- "TARGET TEAMS" >> pure(llvm::omp::Directive::OMPD_target_teams),
1329
- "TARGET" >> pure(llvm::omp::Directive::OMPD_target),
1330
- "TASK"_id >> pure(llvm::omp::Directive::OMPD_task),
1331
- "TASKGROUP" >> pure(llvm::omp::Directive::OMPD_taskgroup),
1332
- "TEAMS" >> pure(llvm::omp::Directive::OMPD_teams),
1333
- "WORKSHARE" >> pure(llvm::omp::Directive::OMPD_workshare))))
1316
+ TYPE_PARSER(
1317
+ // In this context "TARGET UPDATE" can be parsed as a TARGET directive
1318
+ // followed by an UPDATE clause. This is the only combination at the
1319
+ // moment, exclude it explicitly.
1320
+ (!"TARGET UPDATE"_sptok) >=
1321
+ construct<OmpBlockDirective>(first(
1322
+ "MASKED" >> pure(llvm::omp::Directive::OMPD_masked),
1323
+ "MASTER" >> pure(llvm::omp::Directive::OMPD_master),
1324
+ "ORDERED" >> pure(llvm::omp::Directive::OMPD_ordered),
1325
+ "PARALLEL MASKED" >> pure(llvm::omp::Directive::OMPD_parallel_masked),
1326
+ "PARALLEL MASTER" >> pure(llvm::omp::Directive::OMPD_parallel_master),
1327
+ "PARALLEL WORKSHARE" >>
1328
+ pure(llvm::omp::Directive::OMPD_parallel_workshare),
1329
+ "PARALLEL" >> pure(llvm::omp::Directive::OMPD_parallel),
1330
+ "SCOPE" >> pure(llvm::omp::Directive::OMPD_scope),
1331
+ "SINGLE" >> pure(llvm::omp::Directive::OMPD_single),
1332
+ "TARGET DATA" >> pure(llvm::omp::Directive::OMPD_target_data),
1333
+ "TARGET PARALLEL" >> pure(llvm::omp::Directive::OMPD_target_parallel),
1334
+ "TARGET TEAMS" >> pure(llvm::omp::Directive::OMPD_target_teams),
1335
+ "TARGET" >> pure(llvm::omp::Directive::OMPD_target),
1336
+ "TASK"_id >> pure(llvm::omp::Directive::OMPD_task),
1337
+ "TASKGROUP" >> pure(llvm::omp::Directive::OMPD_taskgroup),
1338
+ "TEAMS" >> pure(llvm::omp::Directive::OMPD_teams),
1339
+ "WORKSHARE" >> pure(llvm::omp::Directive::OMPD_workshare))))
1334
1340
1335
1341
TYPE_PARSER(sourced(construct<OmpBeginBlockDirective>(
1336
1342
sourced(Parser<OmpBlockDirective>{}), Parser<OmpClauseList>{})))
0 commit comments