[flang-commits] [clang] [compiler-rt] [flang] [llvm] [mlir] [DebugMetadata][DwarfDebug][CodeView] Support function-local static variables in lexical block scopes (6/7) (PR #187927)
Vladislav Dzhidzhoev via flang-commits
flang-commits at lists.llvm.org
Wed Jul 8 08:49:18 PDT 2026
dzhidzhoev wrote:
I had to make a small change to fix debug-info-correlate-bitmap.ll and, more generally, the InstrProfiling pass.
On the current main branch, when finalizeSubprogram() is called, it overwrites the list of retained nodes for the subprogram. This is fine when the subprogram is newly created. However, if the subprogram already exists in the module and DIBuilder is used to modify it (for example, to add a local entity that should be included in the retained nodes), finalizeSubprogram() discards the previously retained nodes.
The InstrProfiling pass adds two global variables to the same pre-existing subprogram using two different DIBuilder instances. After the second global variable is added, the first one is removed from the retained nodes list.
To fix this, I modified finalizeSubprogram() so that it updates the existing retained nodes list instead of overwriting it.
@dwblaikie, @OCHyams , @jmorse could you please take a look at this change?
https://github.com/llvm/llvm-project/pull/187927
More information about the flang-commits
mailing list