Skip to content

Commit 04e8fd5

Browse files
Fix review comments
1 parent 59752d2 commit 04e8fd5

File tree

5 files changed

+70
-72
lines changed

5 files changed

+70
-72
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3915,6 +3915,14 @@ struct OmpDeviceTypeClause {
39153915
WRAPPER_CLASS_BOILERPLATE(OmpDeviceTypeClause, DeviceTypeDescription);
39163916
};
39173917

3918+
// OMP 5.2 15.8.3 extened-atomic, fail-clause ->
3919+
// FAIL(memory-order)
3920+
struct OmpFailClause {
3921+
WRAPPER_CLASS_BOILERPLATE(
3922+
OmpFailClause, common::Indirection<OmpMemoryOrderClause>);
3923+
CharBlock source;
3924+
};
3925+
39183926
// Ref: [4.5:107-109], [5.0:176-180], [5.1:205-210], [5.2:167-168]
39193927
//
39203928
// from-clause ->
@@ -4099,14 +4107,6 @@ struct OmpUpdateClause {
40994107
std::variant<OmpDependenceType, OmpTaskDependenceType> u;
41004108
};
41014109

4102-
// OMP 5.2 15.8.3 extened-atomic, fail-clause ->
4103-
// FAIL(memory-order)
4104-
struct OmpFailClause {
4105-
WRAPPER_CLASS_BOILERPLATE(
4106-
OmpFailClause, common::Indirection<OmpMemoryOrderClause>);
4107-
CharBlock source;
4108-
};
4109-
41104110
// OpenMP Clauses
41114111
struct OmpClause {
41124112
UNION_CLASS_BOILERPLATE(OmpClause);

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,17 +2494,15 @@ void OmpStructureChecker::CheckAtomicMemoryOrderClause(
24942494
numFailClause++;
24952495
if (numFailClause > 1) {
24962496
context_.Say(clause.source,
2497-
"More than one fail clause not allowed on "
2498-
"OpenMP Atomic construct"_err_en_US);
2497+
"More than one FAIL clause not allowed on OpenMP ATOMIC construct"_err_en_US);
24992498
return;
25002499
}
25012500
} else {
25022501
if (std::get_if<Fortran::parser::OmpMemoryOrderClause>(&clause.u)) {
25032502
numMemoryOrderClause++;
25042503
if (numMemoryOrderClause > 1) {
25052504
context_.Say(clause.source,
2506-
"More than one memory order clause not allowed on "
2507-
"OpenMP Atomic construct"_err_en_US);
2505+
"More than one memory order clause not allowed on OpenMP ATOMIC construct"_err_en_US);
25082506
return;
25092507
}
25102508
}

flang/test/Semantics/OpenMP/atomic-compare.f90

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,46 +44,46 @@
4444
!$omp end atomic
4545

4646
! Check for error conditions:
47-
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
47+
!ERROR: More than one memory order clause not allowed on OpenMP ATOMIC construct
4848
!ERROR: At most one SEQ_CST clause can appear on the COMPARE directive
4949
!$omp atomic seq_cst seq_cst compare
5050
if (b .eq. c) b = a
51-
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
51+
!ERROR: More than one memory order clause not allowed on OpenMP ATOMIC construct
5252
!ERROR: At most one SEQ_CST clause can appear on the COMPARE directive
5353
!$omp atomic compare seq_cst seq_cst
5454
if (b .eq. c) b = a
55-
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
55+
!ERROR: More than one memory order clause not allowed on OpenMP ATOMIC construct
5656
!ERROR: At most one SEQ_CST clause can appear on the COMPARE directive
5757
!$omp atomic seq_cst compare seq_cst
5858
if (b .eq. c) b = a
5959

60-
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
60+
!ERROR: More than one memory order clause not allowed on OpenMP ATOMIC construct
6161
!ERROR: At most one ACQUIRE clause can appear on the COMPARE directive
6262
!$omp atomic acquire acquire compare
6363
if (b .eq. c) b = a
64-
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
64+
!ERROR: More than one memory order clause not allowed on OpenMP ATOMIC construct
6565
!ERROR: At most one ACQUIRE clause can appear on the COMPARE directive
6666
!$omp atomic compare acquire acquire
6767
if (b .eq. c) b = a
68-
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
68+
!ERROR: More than one memory order clause not allowed on OpenMP ATOMIC construct
6969
!ERROR: At most one ACQUIRE clause can appear on the COMPARE directive
7070
!$omp atomic acquire compare acquire
7171
if (b .eq. c) b = a
7272

73-
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
73+
!ERROR: More than one memory order clause not allowed on OpenMP ATOMIC construct
7474
!ERROR: At most one RELAXED clause can appear on the COMPARE directive
7575
!$omp atomic relaxed relaxed compare
7676
if (b .eq. c) b = a
77-
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
77+
!ERROR: More than one memory order clause not allowed on OpenMP ATOMIC construct
7878
!ERROR: At most one RELAXED clause can appear on the COMPARE directive
7979
!$omp atomic compare relaxed relaxed
8080
if (b .eq. c) b = a
81-
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
81+
!ERROR: More than one memory order clause not allowed on OpenMP ATOMIC construct
8282
!ERROR: At most one RELAXED clause can appear on the COMPARE directive
8383
!$omp atomic relaxed compare relaxed
8484
if (b .eq. c) b = a
8585

86-
!ERROR: More than one fail clause not allowed on OpenMP Atomic construct
86+
!ERROR: More than one FAIL clause not allowed on OpenMP ATOMIC construct
8787
!$omp atomic fail(release) compare fail(release)
8888
if (c .eq. a) a = b
8989
!$omp end atomic

0 commit comments

Comments
 (0)