[flang-commits] [flang] [flang][OpenMP] Mark declare target on use-associated module variables (PR #214596)

Spencer Bryngelson via flang-commits flang-commits at lists.llvm.org
Fri Aug 7 06:13:06 PDT 2026


sbryngelson wrote:

Closing as a duplicate of #213930, which landed first and fixes this properly. Thanks @VeeEM for the pointer.

#213930 also picks the better discriminator: `ultimateSymbol.IsFromModFile()` says exactly what is meant, where this PR inferred it from the global having no initializer body. That distinction matters for a main program declare target variable, which is global and unmarked at this point but not from a module file; gating on `isDeclareTarget()` instead regresses `Lower/OpenMP/declare-target-automap.f90`, since the directive path then skips it as already marked. `IsFromModFile()` avoids that by construction.

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


More information about the flang-commits mailing list