@@ -394,6 +394,17 @@ TYPE_PARSER(construct<OmpDeviceModifier>(
394394TYPE_PARSER(construct<OmpExpectation>( //
395395 "PRESENT" >> pure(OmpExpectation::Value::Present)))
396396
397+ TYPE_PARSER(construct<OmpInteropRuntimeIdentifier>(
398+ construct<OmpInteropRuntimeIdentifier>(charLiteralConstant) ||
399+ construct<OmpInteropRuntimeIdentifier>(scalarIntConstantExpr)))
400+
401+ TYPE_PARSER(construct<OmpInteropPreference>(verbatim("PREFER_TYPE"_tok) >>
402+ parenthesized(nonemptyList(Parser<OmpInteropRuntimeIdentifier>{}))))
403+
404+ TYPE_PARSER(construct<OmpInteropType>(
405+ "TARGETSYNC" >> pure(OmpInteropType::Value::TargetSync) ||
406+ "TARGET" >> pure(OmpInteropType::Value::Target)))
407+
397408TYPE_PARSER(construct<OmpIteratorSpecifier>(
398409 // Using Parser<TypeDeclarationStmt> or Parser<EntityDecl> has the problem
399410 // that they will attempt to treat what follows the '=' as initialization.
@@ -521,6 +532,11 @@ TYPE_PARSER(sourced(
521532
522533TYPE_PARSER(sourced(construct<OmpIfClause::Modifier>(OmpDirectiveNameParser{})))
523534
535+ TYPE_PARSER(sourced(
536+ construct<OmpInitClause::Modifier>(
537+ construct<OmpInitClause::Modifier>(Parser<OmpInteropPreference>{})) ||
538+ construct<OmpInitClause::Modifier>(Parser<OmpInteropType>{})))
539+
524540TYPE_PARSER(sourced(construct<OmpInReductionClause::Modifier>(
525541 Parser<OmpReductionIdentifier>{})))
526542
@@ -757,6 +773,11 @@ TYPE_PARSER(
757773// OpenMPv5.2 12.5.2 detach-clause -> DETACH (event-handle)
758774TYPE_PARSER(construct<OmpDetachClause>(Parser<OmpObject>{}))
759775
776+ // init clause
777+ TYPE_PARSER(construct<OmpInitClause>(
778+ maybe(nonemptyList(Parser<OmpInitClause::Modifier>{}) / ":"),
779+ Parser<OmpObject>{}))
780+
760781// 2.8.1 ALIGNED (list: alignment)
761782TYPE_PARSER(construct<OmpAlignedClause>(Parser<OmpObjectList>{},
762783 maybe(":" >> nonemptyList(Parser<OmpAlignedClause::Modifier>{}))))
@@ -896,6 +917,8 @@ TYPE_PARSER( //
896917 "IF" >> construct<OmpClause>(construct<OmpClause::If>(
897918 parenthesized(Parser<OmpIfClause>{}))) ||
898919 "INBRANCH" >> construct<OmpClause>(construct<OmpClause::Inbranch>()) ||
920+ "INIT" >> construct<OmpClause>(construct<OmpClause::Init>(
921+ parenthesized(Parser<OmpInitClause>{}))) ||
899922 "INCLUSIVE" >> construct<OmpClause>(construct<OmpClause::Inclusive>(
900923 parenthesized(Parser<OmpObjectList>{}))) ||
901924 "INITIALIZER" >> construct<OmpClause>(construct<OmpClause::Initializer>(
@@ -985,6 +1008,8 @@ TYPE_PARSER( //
9851008 parenthesized(scalarIntExpr))) ||
9861009 "TO" >> construct<OmpClause>(construct<OmpClause::To>(
9871010 parenthesized(Parser<OmpToClause>{}))) ||
1011+ "USE" >> construct<OmpClause>(construct<OmpClause::Use>(
1012+ parenthesized(Parser<OmpObject>{}))) ||
9881013 "USE_DEVICE_PTR" >> construct<OmpClause>(construct<OmpClause::UseDevicePtr>(
9891014 parenthesized(Parser<OmpObjectList>{}))) ||
9901015 "USE_DEVICE_ADDR" >>
@@ -1212,6 +1237,10 @@ TYPE_PARSER(sourced(construct<OmpSimpleStandaloneDirective>(first(
12121237TYPE_PARSER(sourced(construct<OpenMPSimpleStandaloneConstruct>(
12131238 Parser<OmpSimpleStandaloneDirective>{}, Parser<OmpClauseList>{})))
12141239
1240+ // OMP 5.2 14.1 Interop construct
1241+ TYPE_PARSER(sourced(construct<OpenMPInteropConstruct>(
1242+ verbatim("INTEROP"_tok), sourced(Parser<OmpClauseList>{}))))
1243+
12151244// Standalone Constructs
12161245TYPE_PARSER(
12171246 sourced(construct<OpenMPStandaloneConstruct>(
@@ -1223,7 +1252,9 @@ TYPE_PARSER(
12231252 construct<OpenMPStandaloneConstruct>(Parser<OpenMPCancelConstruct>{}) ||
12241253 construct<OpenMPStandaloneConstruct>(
12251254 Parser<OmpMetadirectiveDirective>{}) ||
1226- construct<OpenMPStandaloneConstruct>(Parser<OpenMPDepobjConstruct>{})) /
1255+ construct<OpenMPStandaloneConstruct>(Parser<OpenMPDepobjConstruct>{}) ||
1256+ construct<OpenMPStandaloneConstruct>(
1257+ Parser<OpenMPInteropConstruct>{})) /
12271258 endOfLine)
12281259
12291260// Directives enclosing structured-block
0 commit comments