[flang-commits] [flang] [flang][debug] Add support for common blocks. (PR #112398)
via flang-commits
flang-commits at lists.llvm.org
Fri Oct 18 01:59:09 PDT 2024
jeanPerier wrote:
> I actually had this check but later noticed during my testing that sometime that global would not have "common" linkage. IIRC it was when common block is declared inside a module.
Can you give an example, I think a common block global without common linkage is most likely a bug (which is possible).
However, I would not push on assuming that common linkage imply common block, we may want to use that in other cases. What about adding an attribute on the global instead with the common block name so that you do not have to care about the assembly name, like `fir.common_block = "a"`?
I also feel like adding an attribute to the declare with the offset and global name may be a lot more robust than pattern matching the computation (something like `fir.declare ...... {fir.in_common_block = "a", fir.common_block_offset = 12}`) would be cleaner. It duplicate information a bit, but I think retrieving information in DAGs outside of optimization purposes is quickly brittle.
If those option sounds good to you, I am happy to extend FIR here.
https://github.com/llvm/llvm-project/pull/112398
More information about the flang-commits
mailing list