aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghu Maddhipatla <7686592+raghavendhra@users.noreply.github.com>2023-12-08 16:06:03 -0600
committerGitHub <noreply@github.com>2023-12-08 16:06:03 -0600
commitdecf0277a7f2c69684a44e80f7791038cfaed82d (patch)
treee44145e7f25ece5aff815e0668c994f4a195a193
parent3c6efe5fdbca07ada9a2710d68efdb07064044c2 (diff)
downloadllvm-decf0277a7f2c69684a44e80f7791038cfaed82d.zip
llvm-decf0277a7f2c69684a44e80f7791038cfaed82d.tar.gz
llvm-decf0277a7f2c69684a44e80f7791038cfaed82d.tar.bz2
[Flang][OpenMP][Semantics] Modify errors to warnings for semantic checks in IS_DEVICE_PTR related to list-items being dummy arguments. (#74370)
Changed semantic check from giving error to giving a warning about deprecation from OpenMP 5.2 and later about checks for dummy argument list-items present on IS_DEVICE_PTR clause. This P is blocker for https://github.com/llvm/llvm-project/pull/71255
-rw-r--r--flang/lib/Semantics/check-omp-structure.cpp7
-rw-r--r--flang/test/Semantics/OpenMP/target01.f908
2 files changed, 9 insertions, 6 deletions
diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index 2f4eb9a..c430375 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -2996,11 +2996,14 @@ void OmpStructureChecker::Enter(const parser::OmpClause::IsDevicePtr &x) {
source.ToString());
} else if (!(IsDummy(*symbol))) {
context_.Say(itr->second->source,
- "Variable '%s' in IS_DEVICE_PTR clause must be a dummy argument"_err_en_US,
+ "Variable '%s' in IS_DEVICE_PTR clause must be a dummy argument. "
+ "This semantic check is deprecated from OpenMP 5.2 and later."_warn_en_US,
source.ToString());
} else if (IsAllocatableOrPointer(*symbol) || IsValue(*symbol)) {
context_.Say(itr->second->source,
- "Variable '%s' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute."_err_en_US,
+ "Variable '%s' in IS_DEVICE_PTR clause must be a dummy argument "
+ "that does not have the ALLOCATABLE, POINTER or VALUE attribute. "
+ "This semantic check is deprecated from OpenMP 5.2 and later."_warn_en_US,
source.ToString());
}
}
diff --git a/flang/test/Semantics/OpenMP/target01.f90 b/flang/test/Semantics/OpenMP/target01.f90
index 485fa1f..9836f011 100644
--- a/flang/test/Semantics/OpenMP/target01.f90
+++ b/flang/test/Semantics/OpenMP/target01.f90
@@ -39,19 +39,19 @@ subroutine bar(b1, b2, b3)
type(c_ptr), pointer :: b2
type(c_ptr), value :: b3
- !ERROR: Variable 'c' in IS_DEVICE_PTR clause must be a dummy argument
+ !WARNING: Variable 'c' in IS_DEVICE_PTR clause must be a dummy argument. This semantic check is deprecated from OpenMP 5.2 and later.
!$omp target is_device_ptr(c)
y = y + 1
!$omp end target
- !ERROR: Variable 'b1' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute.
+ !WARNING: Variable 'b1' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later.
!$omp target is_device_ptr(b1)
y = y + 1
!$omp end target
- !ERROR: Variable 'b2' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute.
+ !WARNING: Variable 'b2' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later.
!$omp target is_device_ptr(b2)
y = y + 1
!$omp end target
- !ERROR: Variable 'b3' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute.
+ !WARNING: Variable 'b3' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later.
!$omp target is_device_ptr(b3)
y = y + 1
!$omp end target