[llvm] CodeGen: Fix CodeView crashes with empty llvm.dbg.cu (PR #163286)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 14 08:56:34 PDT 2025


https://github.com/dwblaikie commented:

Perhaps this could follow a code path more like the DwarfDebug handling - up in AsmPrinter::doInitialization, the DwarfDebug pass is only added if `hasDebugInfo` is true, which is based on `DbgInfoAvailable` which is based on `!debug_compile_units.empty` - whereas CodeViewDebug is added if the raw `llvm.dbg.cu` node exists. Seems like Rather than checking the raw node exists, we should check `hasDebugInfo` in a broader conditional that covers both CV and DWARF.

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


More information about the llvm-commits mailing list