[flang-commits] [flang] [Flang] External subprograms should be allowed as proc_target in procedure pointers. (PR #183268)

via flang-commits flang-commits at lists.llvm.org
Wed Mar 4 09:21:17 PST 2026


https://github.com/jeanPerier commented:

Thanks for working on this. Your solution makes some sense, however modifying the signature after the function creation opens some doors for problems if the function was already used and the operation using it assumed the old signatures. Right now we do not have verifier that fir.address_of types match the func.func type, but for instance I think such verifier would fail on the problematic example with your patch since you would need to go find all the previous usages of the func.func and update the types as needed.

So, I think we may want to modify the lowering order to first emit all the declaration for the function being defined before emitting fir.global declarations for module variables.

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


More information about the flang-commits mailing list