[PATCH] D18565: Implement an "I'm dtrace, please retain all debug types" option.

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 29 11:47:24 PDT 2016


aprantl created this revision.
aprantl added reviewers: dblaikie, dexonsmith.
aprantl added a subscriber: cfe-commits.
aprantl set the repository for this revision to rL LLVM.

As noted in the review thread for http://reviews.llvm.org/D18477 on llvm-commits, DWARF consumers such as dtrace's ctfconvert expect debug info for types to survive even if the underlying code that references those types has been optimized away.
This patch moves this logic from the backend, where it used to be unconditionally executed, into clang. For more info on this functionality check out DwarfDebug::collectDeadVariables(), added in r107027.

This code in this patch listens to the driver option -gfull, and lowers it to the new cc1 option -debug-retain-types (1).
When -debug-retain-types is present, CGDebugInfo will retain every(2) type it creates.

Implementation notes:
  1. I decided not use -fno-eliminate-unused-debug-symbols for consistency with our other cc1 debug options.
  2. I’m minimizing the set of retained types by only retaining top-level types.


Repository:
  rL LLVM

http://reviews.llvm.org/D18565

Files:
  include/clang/Driver/CC1Options.td
  include/clang/Frontend/CodeGenOptions.def
  lib/CodeGen/CGDebugInfo.cpp
  lib/CodeGen/CGDebugInfo.h
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CodeGen/debug-info-retain-types.c
  test/Driver/debug-options.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18565.51960.patch
Type: text/x-patch
Size: 12900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160329/8a900c99/attachment.bin>


More information about the cfe-commits mailing list