[all-commits] [llvm/llvm-project] db64e6: [flang][debug] Handle 'used' module. (#107626)

Abid Qadeer via All-commits all-commits at lists.llvm.org
Wed Sep 11 01:32:15 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: db64e69fa250ea3a8d7a761220a7922fbdad0f2c
      https://github.com/llvm/llvm-project/commit/db64e69fa250ea3a8d7a761220a7922fbdad0f2c
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2024-09-11 (Wed, 11 Sep 2024)

  Changed paths:
    M flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
    M flang/test/Integration/debug-module-2.f90
    M flang/test/Transforms/debug-90683.fir
    M flang/test/Transforms/debug-fn-info.fir
    A flang/test/Transforms/debug-imported-entity.fir
    M flang/test/Transforms/debug-line-table-inc-file.fir
    M flang/test/Transforms/debug-local-global-storage-1.fir

  Log Message:
  -----------
  [flang][debug] Handle 'used' module. (#107626)

As described in #98883, we have to qualify a module variable name in
debugger to get its value. This PR tries to remove this limitation.
    
LLVM provides `DIImportedEntity` to handle such cases but the PR is made
more complicated due to the following 2 issues.
    
1. The MLIR attributes are readonly and we have a circular dependency
here. This has to be handled using the recursive interface provided by
the MLIR. This requires us to first create a place holder
`DISubprogramAttr` which is used in creating `DIImportedEntityAttr`.
Later another `DISubprogramAttr` is created which replaces the place
holder.
    
2. The flang IR does not provide any information about the 'used' module
so this has to be extracted by doing a pass over the
`DeclareOp` in the function. This presents certain limitation as 'only'
and module variable renaming may not be handled properly.
    
Due to the change in `DISubprogramAttr`, some tests also needed to be
adjusted.
    
Fixes #98883.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list