You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[flang][OpenMP] Update semantic checks for LINEAR clause (llvm#177055)
Fixesllvm#173980.
In particular, make step-simple-modifier be compatible (i.e. not
exclusive) for OpenMP spec versions < 52, and update the modifier
validity checks for the construct on which the clause is located.
if ((llvm::omp::allDoSet | llvm::omp::allSimdSet).test(dir)) {
780
-
context_.Say(clauseSource,
781
-
"A modifier may not be specified in a LINEAR clause on the %s directive"_err_en_US,
782
-
ContextDirectiveAsFortran());
783
-
// Don't return early - continue to check other restrictions
784
-
}
785
-
786
778
auto &desc{OmpGetDescriptor<parser::OmpLinearModifier>()};
787
-
for (auto &[symbol, source] : symbols) {
788
-
if (linearMod->v != parser::OmpLinearModifier::Value::Ref) {
789
-
CheckIntegerNoRef(symbol, source);
790
-
} else {
791
-
if (!IsAllocatable(*symbol) && !IsAssumedShape(*symbol) &&
792
-
!IsPolymorphic(*symbol)) {
793
-
context_.Say(source,
794
-
"The list item `%s` specified with the REF '%s' must be polymorphic variable, assumed-shape array, or a variable with the `ALLOCATABLE` attribute"_err_en_US,
if (linearMod->v != parser::OmpLinearModifier::Value::Ref) {
811
+
CheckIntegerNoRef(symbol, source);
812
+
} else {
813
+
if (!IsAllocatable(*symbol) && !IsAssumedShape(*symbol) &&
814
+
!IsPolymorphic(*symbol)) {
815
+
context_.Say(source,
816
+
"The list item `%s` specified with the REF '%s' must be polymorphic variable, assumed-shape array, or a variable with the `ALLOCATABLE` attribute"_err_en_US,
817
+
symbol->name(), desc.name.str());
818
+
}
819
+
}
820
+
if (linearMod->v == parser::OmpLinearModifier::Value::Ref ||
0 commit comments