[flang-commits] [flang] [Flang] Remove redundant check for CrayPointer (PR #123171)

Thirumalai Shaktivel via flang-commits flang-commits at lists.llvm.org
Thu Jan 16 01:23:00 PST 2025


https://github.com/Thirumalai-Shaktivel updated https://github.com/llvm/llvm-project/pull/123171

>From 134129c893ba21e0f1cae1631f5086d0dbf211d9 Mon Sep 17 00:00:00 2001
From: Thirumalai-Shaktivel <thirumalaishaktivel at gmail.com>
Date: Thu, 16 Jan 2025 09:22:13 +0000
Subject: [PATCH] [Flang] Remove redundant check for CrayPointer

---
 flang/lib/Semantics/resolve-directives.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 9cbc61391ba1fb..0218288e373b92 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -2115,12 +2115,11 @@ void OmpAttributeVisitor::Post(const parser::OpenMPAllocatorsConstruct &x) {
 static bool IsPrivatizable(const Symbol *sym) {
   auto *misc{sym->detailsIf<MiscDetails>()};
   return IsVariableName(*sym) && !IsProcedure(*sym) && !IsNamedConstant(*sym) &&
-      (!semantics::IsAssumedSizeArray(
-           *sym) || /* OpenMP 5.2, 5.1.1: Assumed-size arrays are shared*/
-          (sym->test(Symbol::Flag::CrayPointee) &&
-              // If CrayPointer is among the DSA list then the
-              // CrayPointee is Privatizable
-              &semantics::GetCrayPointer(*sym))) &&
+      ( // OpenMP 5.2, 5.1.1: Assumed-size arrays are shared
+          !semantics::IsAssumedSizeArray(*sym) ||
+          // If CrayPointer is among the DSA list then the
+          // CrayPointee is Privatizable
+          sym->test(Symbol::Flag::CrayPointee)) &&
       !sym->owner().IsDerivedType() &&
       sym->owner().kind() != Scope::Kind::ImpliedDos &&
       !sym->detailsIf<semantics::AssocEntityDetails>() &&



More information about the flang-commits mailing list