@@ -425,6 +425,17 @@ TYPE_PARSER(construct<OmpDeviceModifier>(
425425TYPE_PARSER(construct<OmpExpectation>( //
426426 "PRESENT" >> pure(OmpExpectation::Value::Present)))
427427
428+ TYPE_PARSER(construct<OmpInteropRuntimeIdentifier>(
429+ construct<OmpInteropRuntimeIdentifier>(charLiteralConstant) ||
430+ construct<OmpInteropRuntimeIdentifier>(scalarIntConstantExpr)))
431+
432+ TYPE_PARSER(construct<OmpInteropPreference>(verbatim("PREFER_TYPE"_tok) >>
433+ parenthesized(nonemptyList(Parser<OmpInteropRuntimeIdentifier>{}))))
434+
435+ TYPE_PARSER(construct<OmpInteropType>(
436+ "TARGETSYNC" >> pure(OmpInteropType::Value::TargetSync) ||
437+ "TARGET" >> pure(OmpInteropType::Value::Target)))
438+
428439TYPE_PARSER(construct<OmpIteratorSpecifier>(
429440 // Using Parser<TypeDeclarationStmt> or Parser<EntityDecl> has the problem
430441 // that they will attempt to treat what follows the '=' as initialization.
@@ -552,6 +563,11 @@ TYPE_PARSER(sourced(
552563
553564TYPE_PARSER(sourced(construct<OmpIfClause::Modifier>(OmpDirectiveNameParser{})))
554565
566+ TYPE_PARSER(sourced(
567+ construct<OmpInitClause::Modifier>(
568+ construct<OmpInitClause::Modifier>(Parser<OmpInteropPreference>{})) ||
569+ construct<OmpInitClause::Modifier>(Parser<OmpInteropType>{})))
570+
555571TYPE_PARSER(sourced(construct<OmpInReductionClause::Modifier>(
556572 Parser<OmpReductionIdentifier>{})))
557573
@@ -788,6 +804,11 @@ TYPE_PARSER(
788804// OpenMPv5.2 12.5.2 detach-clause -> DETACH (event-handle)
789805TYPE_PARSER(construct<OmpDetachClause>(Parser<OmpObject>{}))
790806
807+ // init clause
808+ TYPE_PARSER(construct<OmpInitClause>(
809+ maybe(nonemptyList(Parser<OmpInitClause::Modifier>{}) / ":"),
810+ Parser<OmpObject>{}))
811+
791812// 2.8.1 ALIGNED (list: alignment)
792813TYPE_PARSER(construct<OmpAlignedClause>(Parser<OmpObjectList>{},
793814 maybe(":" >> nonemptyList(Parser<OmpAlignedClause::Modifier>{}))))
@@ -927,6 +948,8 @@ TYPE_PARSER( //
927948 "IF" >> construct<OmpClause>(construct<OmpClause::If>(
928949 parenthesized(Parser<OmpIfClause>{}))) ||
929950 "INBRANCH" >> construct<OmpClause>(construct<OmpClause::Inbranch>()) ||
951+ "INIT" >> construct<OmpClause>(construct<OmpClause::Init>(
952+ parenthesized(Parser<OmpInitClause>{}))) ||
930953 "INCLUSIVE" >> construct<OmpClause>(construct<OmpClause::Inclusive>(
931954 parenthesized(Parser<OmpObjectList>{}))) ||
932955 "INITIALIZER" >> construct<OmpClause>(construct<OmpClause::Initializer>(
@@ -1016,6 +1039,8 @@ TYPE_PARSER( //
10161039 parenthesized(scalarIntExpr))) ||
10171040 "TO" >> construct<OmpClause>(construct<OmpClause::To>(
10181041 parenthesized(Parser<OmpToClause>{}))) ||
1042+ "USE" >> construct<OmpClause>(construct<OmpClause::Use>(
1043+ parenthesized(Parser<OmpObject>{}))) ||
10191044 "USE_DEVICE_PTR" >> construct<OmpClause>(construct<OmpClause::UseDevicePtr>(
10201045 parenthesized(Parser<OmpObjectList>{}))) ||
10211046 "USE_DEVICE_ADDR" >>
@@ -1251,6 +1276,13 @@ TYPE_PARSER(sourced( //
12511276 IsDirective(llvm::omp::Directive::OMPD_depobj)) >=
12521277 Parser<OmpDirectiveSpecification>{})))
12531278
1279+ // OMP 5.2 14.1 Interop construct
1280+ TYPE_PARSER(sourced( //
1281+ construct<OpenMPInteropConstruct>(
1282+ predicated(OmpDirectiveNameParser{},
1283+ IsDirective(llvm::omp::Directive::OMPD_interop)) >=
1284+ Parser<OmpDirectiveSpecification>{})))
1285+
12541286// Standalone Constructs
12551287TYPE_PARSER(
12561288 sourced( //
@@ -1263,7 +1295,9 @@ TYPE_PARSER(
12631295 construct<OpenMPStandaloneConstruct>(Parser<OpenMPCancelConstruct>{}) ||
12641296 construct<OpenMPStandaloneConstruct>(
12651297 Parser<OmpMetadirectiveDirective>{}) ||
1266- construct<OpenMPStandaloneConstruct>(Parser<OpenMPDepobjConstruct>{})) /
1298+ construct<OpenMPStandaloneConstruct>(Parser<OpenMPDepobjConstruct>{}) ||
1299+ construct<OpenMPStandaloneConstruct>(
1300+ Parser<OpenMPInteropConstruct>{})) /
12671301 endOfLine)
12681302
12691303// Directives enclosing structured-block
0 commit comments