[PATCH] D29765: Handle link of NoDebug CU with a CU that has debug emission enabled

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 07:54:46 PST 2017


tejohnson created this revision.
Herald added a subscriber: mehdi_amini.

This is an issue both with regular and Thin LTO. When we link together
a DICompileUnit that is marked NoDebug (e.g when compiling with -g0
but applying an AutoFDO profile, which requires location tracking
in the compiler) and a DICompileUnit with debug emission enabled,
we can have failures during dwarf debug generation. Specifically,
when we have inlined from the NoDebug compile unit into the debug
compile unit, we can fail during construction of the abstract and
inlined scope DIEs. This is because the SPMap does not include NoDebug
CUs (they are skipped in the debug_compile_units_iterator).

This patch fixes the failures by skipping SPs from NoDebug CUs when
generating these DIEs. I am not sure if this is the right fix from
the debug generation standpoint, however. I don't know if we should
instead either upgrade NoDebug CU on link with a debug CU, or enable
adding these NoDebug CUs into the SPMap.


https://reviews.llvm.org/D29765

Files:
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  test/ThinLTO/X86/Inputs/nodebug_import.ll
  test/ThinLTO/X86/nodebug_import.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29765.87810.patch
Type: text/x-patch
Size: 6816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170209/e101ddba/attachment.bin>


More information about the llvm-commits mailing list