[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
Thu Mar 12 08:25:18 PDT 2026
ShashwathiNavada wrote:
> 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.
@jeanPerier As per your suggestion, I have removed the immediate lowering of modules and instead perform the lowering in a separate pass for all modules. Could you please review the changes and let me know if this is the approach you had in mind? If it looks good, I will proceed with updating the tests that are currently failing due to the change in the lowering order. Thank you!
https://github.com/llvm/llvm-project/pull/183268
More information about the flang-commits
mailing list