File tree Expand file tree Collapse file tree 6 files changed +13
-15
lines changed Expand file tree Collapse file tree 6 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ struct ConstructId {
3939 }
4040
4141MAKE_CONSTR_ID (OpenMPDeclarativeAllocate, D::OMPD_allocate);
42- MAKE_CONSTR_ID (OpenMPDeclarativeAssumes, D::OMPD_assumes);
4342MAKE_CONSTR_ID (OpenMPDeclareReductionConstruct, D::OMPD_declare_reduction);
4443MAKE_CONSTR_ID (OpenMPExecutableAllocate, D::OMPD_allocate);
4544MAKE_CONSTR_ID (OpenMPRequiresConstruct, D::OMPD_requires);
@@ -94,7 +93,6 @@ struct DirectiveNameScope {
9493 if constexpr (std::is_base_of_v<OmpBlockConstruct, T>) {
9594 return std::get<OmpBeginDirective>(x.t ).DirName ();
9695 } else if constexpr (std::is_same_v<T, OpenMPDeclarativeAllocate> ||
97- std::is_same_v<T, OpenMPDeclarativeAssumes> ||
9896 std::is_same_v<T, OpenMPDeclareReductionConstruct> ||
9997 std::is_same_v<T, OpenMPExecutableAllocate> ||
10098 std::is_same_v<T, OpenMPRequiresConstruct>) {
Original file line number Diff line number Diff line change @@ -4877,8 +4877,8 @@ struct OpenMPUtilityConstruct {
48774877// ASSUMES absent-clause | contains-clause | holds-clause | no-openmp-clause |
48784878// no-openmp-routines-clause | no-parallelism-clause
48794879struct OpenMPDeclarativeAssumes {
4880- TUPLE_CLASS_BOILERPLATE (OpenMPDeclarativeAssumes);
4881- std::tuple<Verbatim, OmpClauseList> t ;
4880+ WRAPPER_CLASS_BOILERPLATE (
4881+ OpenMPDeclarativeAssumes, OmpDirectiveSpecification) ;
48824882 CharBlock source;
48834883};
48844884
Original file line number Diff line number Diff line change @@ -1852,8 +1852,10 @@ TYPE_PARSER(
18521852 lookAhead(endOmpLine / !statement(allocateStmt)))
18531853
18541854// Assumes Construct
1855- TYPE_PARSER(sourced(construct<OpenMPDeclarativeAssumes>(
1856- verbatim("ASSUMES"_tok), Parser<OmpClauseList>{})))
1855+ TYPE_PARSER(construct<OpenMPDeclarativeAssumes>(
1856+ predicated(OmpDirectiveNameParser{},
1857+ IsDirective(llvm::omp::Directive::OMPD_assumes)) >=
1858+ Parser<OmpDirectiveSpecification>{}))
18571859
18581860// Declarative constructs
18591861TYPE_PARSER(
Original file line number Diff line number Diff line change @@ -2558,8 +2558,8 @@ class UnparseVisitor {
25582558
25592559 void Unparse (const OpenMPDeclarativeAssumes &x) {
25602560 BeginOpenMP ();
2561- Word (" !$OMP ASSUMES " );
2562- Walk (std::get<OmpClauseList>(x. t ) );
2561+ Word (" !$OMP " );
2562+ Walk (x. v );
25632563 Put (" \n " );
25642564 EndOpenMP ();
25652565 }
Original file line number Diff line number Diff line change @@ -620,10 +620,6 @@ template <typename Checker> struct DirectiveSpellingVisitor {
620620 checker_ (GetDirName (x.t ).source , Directive::OMPD_allocators);
621621 return false ;
622622 }
623- bool Pre (const parser::OpenMPDeclarativeAssumes &x) {
624- checker_ (std::get<parser::Verbatim>(x.t ).source , Directive::OMPD_assumes);
625- return false ;
626- }
627623 bool Pre (const parser::OpenMPGroupprivate &x) {
628624 checker_ (x.v .DirName ().source , Directive::OMPD_groupprivate);
629625 return false ;
Original file line number Diff line number Diff line change @@ -141,9 +141,11 @@ program p
141141end program p
142142
143143! UNPARSE: PROGRAM p
144- ! UNPARSE: !$OMP ASSUMES NO_OPENMP
144+ ! UNPARSE: !$OMP ASSUMES NO_OPENMP
145145! UNPARSE: END PROGRAM p
146146
147- ! PARSE-TREE: OpenMPDeclarativeConstruct -> OpenMPDeclarativeAssumes
148- ! PARSE-TREE: | Verbatim
147+ ! PARSE-TREE: OpenMPDeclarativeConstruct -> OpenMPDeclarativeAssumes -> OmpDirectiveSpecification
148+ ! PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = assumes
149149! PARSE-TREE: | OmpClauseList -> OmpClause -> NoOpenmp
150+ ! PARSE-TREE: | Flags = None
151+ ! PARSE-TREE: ImplicitPart ->
You can’t perform that action at this time.
0 commit comments