[flang-commits] [flang] [flang][debug] Handle USE statements inside modules (PR #186184)

via flang-commits flang-commits at lists.llvm.org
Wed Mar 18 02:47:57 PDT 2026


https://github.com/jeanPerier commented:

As mentioned in the review of the PR that introduced the fir.stmt_use, I am afraid this will contaminate the IR a lot in big real world application where the module trees may involve over a thousands module using each others (arguably, these program should be using ONLY, but I think we should still move this to the side as much as possible).

I think we should place this info on the side, that is we should create some module level operation for Fortran module that can point to the other module being used.

These could be generated when debug info is requested,  and debug info could directly use them to generate the debug info for modules.

This will avoid duplicating the the fir.use_stmt in each small functions that is importing a top level module. As I understand, this would also allow generating smaller dwarf by leaving the debugger building the access hierarchy itself instead of flattening all the uses at the function level (not sure about that point).

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


More information about the flang-commits mailing list