Files
llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
Matt Davis 0012deaa1b [AsmPrinter][debug] Materialize abstract lexical blocks referenced by global vars (#193986)
After 63074da2 moved global variable emission from beginModule() to
endModule(), getOrCreateContextDIE() is called after abstract scope DIEs
have been built. However, skipLexicalScope() may have elided an abstract
lexical block that has no local variables. When a global variable (e.g.,
a function-scope static) is scoped to such a block,
getOrCreateContextDIE() returns nullptr causing an assertion. This PR
keeps abstract lexical blocks when they are the scope target of a global
variable in the compile unit.

Derived via LLM usage.
2026-04-28 07:21:12 -04:00

78 KiB