Skip to content

Commit dfd08b7

Browse files
committed
Preserved the alphabetical ordering of modifier declarations and definitions.
1 parent 687c626 commit dfd08b7

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

flang/examples/FeatureList/FeatureList.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,10 @@ struct NodeVisitor {
524524
READ_FEATURE(OmpScheduleClause)
525525
READ_FEATURE(OmpScheduleClause::Kind)
526526
READ_FEATURE(OmpScheduleClause::Modifier)
527-
READ_FEATURE(OmpInteropType)
528-
READ_FEATURE(OmpInteropType::Value)
529527
READ_FEATURE(OmpInteropRuntimeIdentifier)
530528
READ_FEATURE(OmpInteropPreference)
529+
READ_FEATURE(OmpInteropType)
530+
READ_FEATURE(OmpInteropType::Value)
531531
READ_FEATURE(OmpInitClause)
532532
READ_FEATURE(OmpInitClause::Modifier)
533533
READ_FEATURE(OmpUseClause)

flang/include/flang/Parser/dump-parse-tree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,10 @@ class ParseTreeDumper {
657657
NODE_ENUM(OmpDeviceModifier, Value)
658658
NODE(parser, OmpDeviceTypeClause)
659659
NODE_ENUM(OmpDeviceTypeClause, DeviceTypeDescription)
660-
NODE(parser, OmpInteropType)
661-
NODE_ENUM(OmpInteropType, Value)
662660
NODE(parser, OmpInteropRuntimeIdentifier)
663661
NODE(parser, OmpInteropPreference)
662+
NODE(parser, OmpInteropType)
663+
NODE_ENUM(OmpInteropType, Value)
664664
NODE(parser, OmpInitClause)
665665
NODE(OmpInitClause, Modifier)
666666
NODE(parser, OmpUseClause)

flang/include/flang/Parser/parse-tree.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3824,15 +3824,6 @@ struct OmpExpectation {
38243824
WRAPPER_CLASS_BOILERPLATE(OmpExpectation, Value);
38253825
};
38263826

3827-
// REF: [5.1:217-220], [5.2:293-294]
3828-
//
3829-
// InteropType -> target || targetsync // since 5.2
3830-
// There can be at most only two interop-type.
3831-
struct OmpInteropType {
3832-
ENUM_CLASS(Value, Target, TargetSync)
3833-
WRAPPER_CLASS_BOILERPLATE(OmpInteropType, Value);
3834-
};
3835-
38363827
// REF: [5.1:217-220], [5.2:293-294]
38373828
//
38383829
// OmpRuntimeIdentifier -> // since 5.2
@@ -3851,6 +3842,15 @@ struct OmpInteropPreference {
38513842
OmpInteropPreference, std::list<OmpInteropRuntimeIdentifier>);
38523843
};
38533844

3845+
// REF: [5.1:217-220], [5.2:293-294]
3846+
//
3847+
// InteropType -> target || targetsync // since 5.2
3848+
// There can be at most only two interop-type.
3849+
struct OmpInteropType {
3850+
ENUM_CLASS(Value, Target, TargetSync)
3851+
WRAPPER_CLASS_BOILERPLATE(OmpInteropType, Value);
3852+
};
3853+
38543854
// Ref: [5.0:47-49], [5.1:49-51], [5.2:67-69]
38553855
//
38563856
// iterator-modifier ->

flang/lib/Parser/openmp-parsers.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,13 @@ TYPE_PARSER(construct<OmpDeviceModifier>(
380380
TYPE_PARSER(construct<OmpExpectation>( //
381381
"PRESENT" >> pure(OmpExpectation::Value::Present)))
382382

383+
TYPE_PARSER(construct<OmpInteropRuntimeIdentifier>(
384+
construct<OmpInteropRuntimeIdentifier>(charLiteralConstant) ||
385+
construct<OmpInteropRuntimeIdentifier>(scalarIntConstantExpr)))
386+
387+
TYPE_PARSER(construct<OmpInteropPreference>(verbatim("PREFER_TYPE"_tok) >>
388+
parenthesized(nonemptyList(Parser<OmpInteropRuntimeIdentifier>{}))))
389+
383390
TYPE_PARSER(construct<OmpInteropType>(
384391
"TARGETSYNC" >> pure(OmpInteropType::Value::TargetSync) ||
385392
"TARGET" >> pure(OmpInteropType::Value::Target)))
@@ -456,10 +463,6 @@ TYPE_PARSER(construct<OmpReductionModifier>(
456463
"TASK" >> pure(OmpReductionModifier::Value::Task) ||
457464
"DEFAULT" >> pure(OmpReductionModifier::Value::Default)))
458465

459-
TYPE_PARSER(construct<OmpInteropRuntimeIdentifier>(
460-
construct<OmpInteropRuntimeIdentifier>(charLiteralConstant) ||
461-
construct<OmpInteropRuntimeIdentifier>(scalarIntConstantExpr)))
462-
463466
TYPE_PARSER(construct<OmpStepComplexModifier>( //
464467
"STEP" >> parenthesized(scalarIntExpr)))
465468

@@ -515,9 +518,6 @@ TYPE_PARSER(sourced(
515518

516519
TYPE_PARSER(sourced(construct<OmpIfClause::Modifier>(OmpDirectiveNameParser{})))
517520

518-
TYPE_PARSER(construct<OmpInteropPreference>(verbatim("PREFER_TYPE"_tok) >>
519-
parenthesized(nonemptyList(Parser<OmpInteropRuntimeIdentifier>{}))))
520-
521521
TYPE_PARSER(sourced(
522522
construct<OmpInitClause::Modifier>(
523523
construct<OmpInitClause::Modifier>(Parser<OmpInteropPreference>{})) ||

0 commit comments

Comments
 (0)