@@ -550,6 +550,18 @@ TYPE_PARSER(sourced(construct<OmpToClause::Modifier>(
550550TYPE_PARSER(sourced(construct<OmpWhenClause::Modifier>( //
551551 Parser<OmpContextSelector>{})))
552552
553+ TYPE_PARSER(construct<OmpInteropType>(
554+ "TARGETSYNC" >> pure(OmpInteropType::Value::TargetSync) ||
555+ "TARGET" >> pure(OmpInteropType::Value::Target)))
556+
557+ TYPE_PARSER(construct<OmpAppendArgsClause::OmpAppendOp>(
558+ "INTEROP" >> parenthesized(nonemptyList(Parser<OmpInteropType>{}))))
559+
560+ TYPE_PARSER(construct<OmpAdjustArgsClause::OmpAdjustOp>(
561+ "NOTHING" >> pure(OmpAdjustArgsClause::OmpAdjustOp::Value::Nothing) ||
562+ "NEED_DEVICE_PTR" >>
563+ pure(OmpAdjustArgsClause::OmpAdjustOp::Value::NeedDevicePtr)))
564+
553565// --- Parsers for clauses --------------------------------------------
554566
555567/// `MOBClause` is a clause that has a
@@ -569,12 +581,19 @@ static inline MOBClause makeMobClause(
569581 }
570582}
571583
584+ TYPE_PARSER(construct<OmpAdjustArgsClause>(
585+ (Parser<OmpAdjustArgsClause::OmpAdjustOp>{} / ":"),
586+ Parser<OmpObjectList>{}))
587+
572588// [5.0] 2.10.1 affinity([aff-modifier:] locator-list)
573589// aff-modifier: interator-modifier
574590TYPE_PARSER(construct<OmpAffinityClause>(
575591 maybe(nonemptyList(Parser<OmpAffinityClause::Modifier>{}) / ":"),
576592 Parser<OmpObjectList>{}))
577593
594+ TYPE_PARSER(construct<OmpAppendArgsClause>(
595+ parenthesized(nonemptyList(Parser<OmpAppendArgsClause::OmpAppendOp>{}))))
596+
578597// 2.15.3.1 DEFAULT (PRIVATE | FIRSTPRIVATE | SHARED | NONE)
579598TYPE_PARSER(construct<OmpDefaultClause::DataSharingAttribute>(
580599 "PRIVATE" >> pure(OmpDefaultClause::DataSharingAttribute::Private) ||
@@ -808,6 +827,8 @@ TYPE_PARSER("ABSENT" >> construct<OmpClause>(construct<OmpClause::Absent>(
808827 parenthesized(Parser<OmpAbsentClause>{}))) ||
809828 "ACQUIRE" >> construct<OmpClause>(construct<OmpClause::Acquire>()) ||
810829 "ACQ_REL" >> construct<OmpClause>(construct<OmpClause::AcqRel>()) ||
830+ "ADJUST_ARGS" >> construct<OmpClause>(construct<OmpClause::AdjustArgs>(
831+ parenthesized(Parser<OmpAdjustArgsClause>{}))) ||
811832 "AFFINITY" >> construct<OmpClause>(construct<OmpClause::Affinity>(
812833 parenthesized(Parser<OmpAffinityClause>{}))) ||
813834 "ALIGN" >> construct<OmpClause>(construct<OmpClause::Align>(
@@ -816,6 +837,8 @@ TYPE_PARSER("ABSENT" >> construct<OmpClause>(construct<OmpClause::Absent>(
816837 parenthesized(Parser<OmpAlignedClause>{}))) ||
817838 "ALLOCATE" >> construct<OmpClause>(construct<OmpClause::Allocate>(
818839 parenthesized(Parser<OmpAllocateClause>{}))) ||
840+ "APPEND_ARGS" >> construct<OmpClause>(construct<OmpClause::AppendArgs>(
841+ parenthesized(Parser<OmpAppendArgsClause>{}))) ||
819842 "ALLOCATOR" >> construct<OmpClause>(construct<OmpClause::Allocator>(
820843 parenthesized(scalarIntExpr))) ||
821844 "AT" >> construct<OmpClause>(construct<OmpClause::At>(
@@ -1209,6 +1232,11 @@ TYPE_PARSER(construct<OmpInitializerClause>(
12091232 construct<OmpInitializerClause>(Parser<OmpInitializerExpr>{}) ||
12101233 construct<OmpInitializerClause>(Parser<OmpInitializerProc>{})))
12111234
1235+ // OpenMP 5.2: 7.5.4 Declare Variant directive
1236+ TYPE_PARSER(sourced(
1237+ construct<OmpDeclareVariantDirective>(verbatim("DECLARE VARIANT"_tok),
1238+ "(" >> maybe(name / ":"), name / ")", Parser<OmpClauseList>{})))
1239+
12121240// 2.16 Declare Reduction Construct
12131241TYPE_PARSER(sourced(construct<OpenMPDeclareReductionConstruct>(
12141242 verbatim("DECLARE REDUCTION"_tok),
@@ -1380,6 +1408,8 @@ TYPE_PARSER(
13801408 Parser<OpenMPDeclareSimdConstruct>{}) ||
13811409 construct<OpenMPDeclarativeConstruct>(
13821410 Parser<OpenMPDeclareTargetConstruct>{}) ||
1411+ construct<OpenMPDeclarativeConstruct>(
1412+ Parser<OmpDeclareVariantDirective>{}) ||
13831413 construct<OpenMPDeclarativeConstruct>(
13841414 Parser<OpenMPDeclarativeAllocate>{}) ||
13851415 construct<OpenMPDeclarativeConstruct>(
0 commit comments