[flang-commits] [flang] [flang][OpenMP] Reword some diagnostic messages, NFC (PR #224945)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Sun Sep 20 10:12:16 PDT 2026


https://github.com/kparzysz created https://github.com/llvm/llvm-project/pull/224945

Instead of "something...something in OpenMP vX.Y on SOME clause" say "something...something on SOME clause in OpenMP vX.Y".

>From 3ae5ba82fb8e217ba8bbb39060e2686fd5075e84 Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: Sun, 20 Sep 2026 12:08:38 -0500
Subject: [PATCH] [flang][OpenMP] Reword some diagnostic messages, NFC

Instead of "something...something in OpenMP vX.Y on SOME clause" say
"something...something on SOME clause in OpenMP vX.Y".
---
 flang/lib/Semantics/check-omp-syntax.cpp                  | 8 ++++----
 flang/test/Semantics/OpenMP/allocate_do1.f90              | 4 ++--
 flang/test/Semantics/OpenMP/clause-validity01.f90         | 2 +-
 flang/test/Semantics/OpenMP/depend05.f90                  | 2 +-
 flang/test/Semantics/OpenMP/depobj-construct-v52.f90      | 2 +-
 flang/test/Semantics/OpenMP/from-clause-v45.f90           | 6 +++---
 flang/test/Semantics/OpenMP/map-modifiers-v60.f90         | 8 ++++----
 flang/test/Semantics/OpenMP/to-clause-v45.f90             | 6 +++---
 flang/test/Semantics/OpenMP/uses-allocators-version50.f90 | 6 +++---
 flang/test/Semantics/OpenMP/uses-allocators-version51.f90 | 4 ++--
 10 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/flang/lib/Semantics/check-omp-syntax.cpp b/flang/lib/Semantics/check-omp-syntax.cpp
index f631308819c4a..b1860bdc3bc5b 100644
--- a/flang/lib/Semantics/check-omp-syntax.cpp
+++ b/flang/lib/Semantics/check-omp-syntax.cpp
@@ -314,13 +314,13 @@ bool OmpStructureChecker::VerifyModifierVersion(
           clauseName);
     } else if (since != ~0u && version < since) {
       context_.Say(svr.first,
-          "'%s' modifier is not supported in %s on %s clause, %s"_warn_en_US,
-          modName, omp::ThisVersion(version), clauseName,
+          "'%s' modifier is not supported on %s clause in %s, %s"_warn_en_US,
+          modName, clauseName, omp::ThisVersion(version),
           omp::TryVersion(since));
     } else if (until != 0u && version > until) {
       context_.Say(svr.first,
-          "'%s' modifier is no longer supported in %s on %s clause"_warn_en_US,
-          modName, omp::ThisVersion(version), clauseName);
+          "'%s' modifier is no longer supported on %s clause in %s"_warn_en_US,
+          modName, clauseName, omp::ThisVersion(version));
     }
   }
 
diff --git a/flang/test/Semantics/OpenMP/allocate_do1.f90 b/flang/test/Semantics/OpenMP/allocate_do1.f90
index 6429efc3249ce..1be215fb42698 100644
--- a/flang/test/Semantics/OpenMP/allocate_do1.f90
+++ b/flang/test/Semantics/OpenMP/allocate_do1.f90
@@ -22,7 +22,7 @@ subroutine test_omp_do()
     use all_mod
     !$omp parallel shared(AAA,BBB,CCC,DDD,val)
     !ERROR: ALLOCATE clause is not allowed on DO directive in OpenMP v4.5, try -fopenmp-version=50
-    !ERROR: 'allocator-simple-modifier' modifier is not supported in OpenMP v4.5 on ALLOCATE clause, try -fopenmp-version=50
+    !ERROR: 'allocator-simple-modifier' modifier is not supported on ALLOCATE clause in OpenMP v4.5, try -fopenmp-version=50
     !$omp do private(CCC, val) allocate(0:CCC, val)
     do i=1,N
         CCC(i) = AAA(i) + BBB(i)
@@ -36,7 +36,7 @@ end subroutine test_omp_do
 subroutine test_omp_parallel_do()
     use all_mod
     !ERROR: ALLOCATE clause is not allowed on PARALLEL DO directive in OpenMP v4.5, try -fopenmp-version=50
-    !ERROR: 'allocator-simple-modifier' modifier is not supported in OpenMP v4.5 on ALLOCATE clause, try -fopenmp-version=50
+    !ERROR: 'allocator-simple-modifier' modifier is not supported on ALLOCATE clause in OpenMP v4.5, try -fopenmp-version=50
     !$omp parallel do private(CCC, val) allocate(0:CCC, val) shared(AAA,BBB,DDD)
     do i=1,N
         CCC(i) = AAA(i) + BBB(i)
diff --git a/flang/test/Semantics/OpenMP/clause-validity01.f90 b/flang/test/Semantics/OpenMP/clause-validity01.f90
index c981d1a288db5..e65cb89b8be08 100644
--- a/flang/test/Semantics/OpenMP/clause-validity01.f90
+++ b/flang/test/Semantics/OpenMP/clause-validity01.f90
@@ -508,7 +508,7 @@
   !$omp taskwait depend(mutexinoutset: x)
   !ERROR: 'task-dependence-type' modifier is required
   !ERROR: The SINK and SOURCE dependence types can only be used with the ORDERED directive, used here in the TASKWAIT construct
-  !WARNING: 'dependence-type' modifier is no longer supported in OpenMP v5.2 on DEPEND clause
+  !WARNING: 'dependence-type' modifier is no longer supported on DEPEND clause in OpenMP v5.2
   !$omp taskwait depend(source)
   ! !$omp taskwait depend(sink:i-1)
   ! !$omp target enter data map(to:arrayA) map(alloc:arrayB)
diff --git a/flang/test/Semantics/OpenMP/depend05.f90 b/flang/test/Semantics/OpenMP/depend05.f90
index b8a5e94dd8093..7cbe6c24089b1 100644
--- a/flang/test/Semantics/OpenMP/depend05.f90
+++ b/flang/test/Semantics/OpenMP/depend05.f90
@@ -2,7 +2,7 @@
 
 subroutine f00(x)
   integer :: x(10)
-!WARNING: 'iterator' modifier is not supported in OpenMP v4.5 on DEPEND clause, try -fopenmp-version=50
+!WARNING: 'iterator' modifier is not supported on DEPEND clause in OpenMP v4.5, try -fopenmp-version=50
   !$omp task depend(iterator(i = 1:10), in: x(i))
   x = 0
   !$omp end task
diff --git a/flang/test/Semantics/OpenMP/depobj-construct-v52.f90 b/flang/test/Semantics/OpenMP/depobj-construct-v52.f90
index 6fea74be8f026..37bd6191f215e 100644
--- a/flang/test/Semantics/OpenMP/depobj-construct-v52.f90
+++ b/flang/test/Semantics/OpenMP/depobj-construct-v52.f90
@@ -3,7 +3,7 @@
 subroutine f00
   integer :: obj
 !ERROR: 'task-dependence-type' modifier is required
-!WARNING: 'dependence-type' modifier is no longer supported in OpenMP v5.2 on DEPEND clause
+!WARNING: 'dependence-type' modifier is no longer supported on DEPEND clause in OpenMP v5.2
 !ERROR: A DEPEND clause on a DEPOBJ construct must not have SINK or SOURCE as dependence type
   !$omp depobj(obj) depend(source)
 end
diff --git a/flang/test/Semantics/OpenMP/from-clause-v45.f90 b/flang/test/Semantics/OpenMP/from-clause-v45.f90
index 71b3bf51094b9..35787f872ea89 100644
--- a/flang/test/Semantics/OpenMP/from-clause-v45.f90
+++ b/flang/test/Semantics/OpenMP/from-clause-v45.f90
@@ -8,14 +8,14 @@ subroutine f00(x)
 
 subroutine f01(x)
   integer :: x(10)
-!WARNING: 'iterator' modifier is not supported in OpenMP v4.5 on FROM clause, try -fopenmp-version=51
+!WARNING: 'iterator' modifier is not supported on FROM clause in OpenMP v4.5, try -fopenmp-version=51
   !$omp target update from(iterator(i = 1:5): x(i))
 end
 
 subroutine f02(x)
   integer :: x(10)
-!WARNING: 'motion-modifier' modifier is not supported in OpenMP v4.5 on FROM clause, try -fopenmp-version=51
-!WARNING: 'iterator' modifier is not supported in OpenMP v4.5 on FROM clause, try -fopenmp-version=51
+!WARNING: 'motion-modifier' modifier is not supported on FROM clause in OpenMP v4.5, try -fopenmp-version=51
+!WARNING: 'iterator' modifier is not supported on FROM clause in OpenMP v4.5, try -fopenmp-version=51
   !$omp target update from(present, iterator(i = 1:5): x(i))
 end
 
diff --git a/flang/test/Semantics/OpenMP/map-modifiers-v60.f90 b/flang/test/Semantics/OpenMP/map-modifiers-v60.f90
index d18a418554e41..00fd524ab12a9 100644
--- a/flang/test/Semantics/OpenMP/map-modifiers-v60.f90
+++ b/flang/test/Semantics/OpenMP/map-modifiers-v60.f90
@@ -2,7 +2,7 @@
 
 subroutine f00(x)
   integer :: x
-!WARNING: 'self-modifier' modifier is not supported in OpenMP v5.2 on MAP clause, try -fopenmp-version=60
+!WARNING: 'self-modifier' modifier is not supported on MAP clause in OpenMP v5.2, try -fopenmp-version=60
   !$omp target map(self: x)
   x = x + 1
   !$omp end target
@@ -10,7 +10,7 @@ subroutine f00(x)
 
 subroutine f01(x)
   integer, pointer :: x
-!WARNING: 'ref-modifier' modifier is not supported in OpenMP v5.2 on MAP clause, try -fopenmp-version=60
+!WARNING: 'ref-modifier' modifier is not supported on MAP clause in OpenMP v5.2, try -fopenmp-version=60
   !$omp target map(ref_ptr: x)
   x = x + 1
   !$omp end target
@@ -18,7 +18,7 @@ subroutine f01(x)
 
 subroutine f02(x)
   integer, pointer :: x
-!WARNING: 'ref-modifier' modifier is not supported in OpenMP v5.2 on MAP clause, try -fopenmp-version=60
+!WARNING: 'ref-modifier' modifier is not supported on MAP clause in OpenMP v5.2, try -fopenmp-version=60
   !$omp target map(ref_ptee: x)
   x = x + 1
   !$omp end target
@@ -26,7 +26,7 @@ subroutine f02(x)
 
 subroutine f03(x)
   integer, pointer :: x
-!WARNING: 'ref-modifier' modifier is not supported in OpenMP v5.2 on MAP clause, try -fopenmp-version=60
+!WARNING: 'ref-modifier' modifier is not supported on MAP clause in OpenMP v5.2, try -fopenmp-version=60
   !$omp target map(ref_ptr_ptee: x)
   x = x + 1
   !$omp end target
diff --git a/flang/test/Semantics/OpenMP/to-clause-v45.f90 b/flang/test/Semantics/OpenMP/to-clause-v45.f90
index 6bf701ac9ca27..b336005699377 100644
--- a/flang/test/Semantics/OpenMP/to-clause-v45.f90
+++ b/flang/test/Semantics/OpenMP/to-clause-v45.f90
@@ -8,14 +8,14 @@ subroutine f00(x)
 
 subroutine f01(x)
   integer :: x(10)
-!WARNING: 'iterator' modifier is not supported in OpenMP v4.5 on TO clause, try -fopenmp-version=51
+!WARNING: 'iterator' modifier is not supported on TO clause in OpenMP v4.5, try -fopenmp-version=51
   !$omp target update to(iterator(i = 1:5): x(i))
 end
 
 subroutine f02(x)
   integer :: x(10)
-!WARNING: 'motion-modifier' modifier is not supported in OpenMP v4.5 on TO clause, try -fopenmp-version=51
-!WARNING: 'iterator' modifier is not supported in OpenMP v4.5 on TO clause, try -fopenmp-version=51
+!WARNING: 'motion-modifier' modifier is not supported on TO clause in OpenMP v4.5, try -fopenmp-version=51
+!WARNING: 'iterator' modifier is not supported on TO clause in OpenMP v4.5, try -fopenmp-version=51
   !$omp target update to(present, iterator(i = 1:5): x(i))
 end
 
diff --git a/flang/test/Semantics/OpenMP/uses-allocators-version50.f90 b/flang/test/Semantics/OpenMP/uses-allocators-version50.f90
index 585b57167103d..2bc3a07859682 100644
--- a/flang/test/Semantics/OpenMP/uses-allocators-version50.f90
+++ b/flang/test/Semantics/OpenMP/uses-allocators-version50.f90
@@ -33,20 +33,20 @@ subroutine uses_allocators_50
   x = 3
   !$omp end target
 
-  !WARNING: 'traits-array' modifier is not supported in OpenMP v5.0 on USES_ALLOCATORS clause, try -fopenmp-version=52
+  !WARNING: 'traits-array' modifier is not supported on USES_ALLOCATORS clause in OpenMP v5.0, try -fopenmp-version=52
   !$omp target uses_allocators(traits(tr): my_alloc)
   x = 4
   !$omp end target
 
   ! Accepting the newer syntax with a warning does not skip the remaining
   ! checks on the specification.
-  !WARNING: 'traits-array' modifier is not supported in OpenMP v5.0 on USES_ALLOCATORS clause, try -fopenmp-version=52
+  !WARNING: 'traits-array' modifier is not supported on USES_ALLOCATORS clause in OpenMP v5.0, try -fopenmp-version=52
   !ERROR: The traits array must be a named constant array
   !$omp target uses_allocators(traits(1): my_alloc)
   x = 5
   !$omp end target
 
-  !WARNING: 'mem-space' modifier is not supported in OpenMP v5.0 on USES_ALLOCATORS clause, try -fopenmp-version=52
+  !WARNING: 'mem-space' modifier is not supported on USES_ALLOCATORS clause in OpenMP v5.0, try -fopenmp-version=52
   !ERROR: A non-predefined allocator 'my_alloc' in a USES_ALLOCATORS clause must have traits specified in OpenMP v5.0
   !$omp target uses_allocators(memspace(omp_default_mem_space): my_alloc)
   x = 6
diff --git a/flang/test/Semantics/OpenMP/uses-allocators-version51.f90 b/flang/test/Semantics/OpenMP/uses-allocators-version51.f90
index 27938290a2ecd..01e1b01ed36bc 100644
--- a/flang/test/Semantics/OpenMP/uses-allocators-version51.f90
+++ b/flang/test/Semantics/OpenMP/uses-allocators-version51.f90
@@ -27,14 +27,14 @@ subroutine uses_allocators_51
   x = 2
   !$omp end target
 
-  !WARNING: 'traits-array' modifier is not supported in OpenMP v5.1 on USES_ALLOCATORS clause, try -fopenmp-version=52
+  !WARNING: 'traits-array' modifier is not supported on USES_ALLOCATORS clause in OpenMP v5.1, try -fopenmp-version=52
   !$omp target uses_allocators(traits(tr): my_alloc)
   x = 3
   !$omp end target
 
   ! Accepting the newer syntax with a warning does not skip the remaining
   ! checks on the specification.
-  !WARNING: 'traits-array' modifier is not supported in OpenMP v5.1 on USES_ALLOCATORS clause, try -fopenmp-version=52
+  !WARNING: 'traits-array' modifier is not supported on USES_ALLOCATORS clause in OpenMP v5.1, try -fopenmp-version=52
   !ERROR: The traits array must be a named constant array
   !$omp target uses_allocators(traits(1): my_alloc)
   x = 4



More information about the flang-commits mailing list