[flang-commits] [flang] [Flang][OpenMP] Only allow implicit mappers for Allocatables. (PR #170701)

via flang-commits flang-commits at lists.llvm.org
Thu Dec 4 08:52:16 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-fir-hlfir

Author: Akash Banerjee (TIFitis)

<details>
<summary>Changes</summary>

Generate implicit declare mappers only for Allocatables.

Fixes #<!-- -->169382 introduced by #<!-- -->140562.

---
Full diff: https://github.com/llvm/llvm-project/pull/170701.diff


1 Files Affected:

- (modified) flang/lib/Lower/OpenMP/Utils.cpp (+1-1) 


``````````diff
diff --git a/flang/lib/Lower/OpenMP/Utils.cpp b/flang/lib/Lower/OpenMP/Utils.cpp
index ccac64335c29a..a818d635668de 100644
--- a/flang/lib/Lower/OpenMP/Utils.cpp
+++ b/flang/lib/Lower/OpenMP/Utils.cpp
@@ -189,7 +189,7 @@ bool requiresImplicitDefaultDeclareMapper(
 
     semantics::DirectComponentIterator directComponents{spec};
     for (const semantics::Symbol &component : directComponents) {
-      if (semantics::IsAllocatableOrPointer(component))
+      if (component.attrs().test(semantics::Attr::ALLOCATABLE))
         return true;
 
       if (const semantics::DeclTypeSpec *declType = component.GetType())

``````````

</details>


https://github.com/llvm/llvm-project/pull/170701


More information about the flang-commits mailing list