[flang-commits] [flang] 34f294c - [flang][OpenMP] Event handles are not predetermined shared (#200055)
via flang-commits
flang-commits at lists.llvm.org
Thu May 28 06:15:40 PDT 2026
Author: Krzysztof Parzyszek
Date: 2026-05-28T08:15:33-05:00
New Revision: 34f294ccbca8c820fffd0538015499108f6600aa
URL: https://github.com/llvm/llvm-project/commit/34f294ccbca8c820fffd0538015499108f6600aa
DIFF: https://github.com/llvm/llvm-project/commit/34f294ccbca8c820fffd0538015499108f6600aa.diff
LOG: [flang][OpenMP] Event handles are not predetermined shared (#200055)
An event-handle variable that appears in a DETACH has its data-sharing
attributes determined according to the usual rules in the constructs
enclosing the clause.
Added:
Modified:
flang/lib/Semantics/resolve-directives.cpp
Removed:
flang/test/Semantics/OpenMP/detach-symbols.f90
################################################################################
diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index af73c53715596..2fa59adf7f3af 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -763,17 +763,6 @@ class OmpAttributeVisitor : DirectiveAttributeVisitor<llvm::omp::Directive> {
*parser::omp::GetOmpObjectList(x), Symbol::Flag::OmpLastPrivate);
return false;
}
- bool Pre(const parser::OmpClause::Detach &x) {
- // OpenMP 5.0: Variables in detach clause have predetermined shared
- // data-sharing attribute
- if (const auto *name{parser::Unwrap<parser::Name>(x.v.v)}) {
- if (auto *symbol{name->symbol})
- SetSymbolDSA(*symbol,
- Symbol::Flags{
- Symbol::Flag::OmpShared, Symbol::Flag::OmpPreDetermined});
- }
- return false;
- }
bool Pre(const parser::OmpClause::Copyin &x) {
ResolveOmpObjectList(x.v, Symbol::Flag::OmpCopyIn);
return false;
diff --git a/flang/test/Semantics/OpenMP/detach-symbols.f90 b/flang/test/Semantics/OpenMP/detach-symbols.f90
deleted file mode 100644
index eae5cc07ce67e..0000000000000
--- a/flang/test/Semantics/OpenMP/detach-symbols.f90
+++ /dev/null
@@ -1,17 +0,0 @@
-! REQUIRES: openmp_runtime
-! RUN: %python %S/../test_symbols.py %s %flang_fc1 %openmp_flags -fopenmp-version=50
-
-! Test that variables in a DETACH clause get predetermined shared DSA.
-
-!DEF: /detach_symbol_dsa (Subroutine) Subprogram
-subroutine detach_symbol_dsa
- !DEF: /omp_lib (ModFile) Module
- !DEF: /omp_lib/omp_event_handle_kind PARAMETER, PUBLIC Use INTEGER(4)
- use :: omp_lib, only: omp_event_handle_kind
- !DEF: /detach_symbol_dsa/omp_event_handle_kind PARAMETER Use INTEGER(4)
- !DEF: /detach_symbol_dsa/ev (OmpShared, OmpPreDetermined) ObjectEntity INTEGER(8)
- integer(kind=omp_event_handle_kind) ev
-
- !$omp task detach(ev)
- !$omp end task
-end subroutine detach_symbol_dsa
More information about the flang-commits
mailing list