[flang-commits] [flang] [flang] add internal_assoc flag to mark variable captured in internal procedure (PR #117161)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Thu Nov 21 08:32:34 PST 2024
================
@@ -1670,6 +1670,25 @@ cuf::DataAttributeAttr Fortran::lower::translateSymbolCUFDataAttribute(
return cuf::getDataAttribute(mlirContext, cudaAttr);
}
+static bool
+isCapturedInInternalProcedure(Fortran::lower::AbstractConverter &converter,
+ const Fortran::semantics::Symbol &sym) {
+ const Fortran::lower::pft::FunctionLikeUnit *funit =
+ converter.getCurrentFunctionUnit();
+ if (!funit || funit->getHostAssoc().empty())
+ return false;
+ if (funit->getHostAssoc().isAssociated(sym))
+ return true;
+ // Consider that any capture of a variable that is in an equivalence with the
+ // symbol imply that the storage of the symbol may also be accessed inside
----------------
tblah wrote:
```suggestion
// symbol implies that the storage of the symbol may also be accessed inside
```
nit
https://github.com/llvm/llvm-project/pull/117161
More information about the flang-commits
mailing list