[PATCH] D72427: [DebugInfo] Add option to clang to limit debug info that is emitted for classes.

Amy Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 16:51:48 PST 2020


akhuang created this revision.
akhuang added reviewers: rnk, dblaikie.
Herald added subscribers: cfe-commits, aprantl.
Herald added a project: clang.

This patch adds an option to limit debug info by only emitting complete class
type information when its constructor is emitted. This applies to classes
that have nontrivial user defined constructors.

I implemented the option by adding another level to `DebugInfoKind`, and
a flag `-flimit-debug-info-constructor`.

Total object file size on Windows, compiling with RelWithDebInfo:

  before: 4,257,448 kb
  after:  2,104,963 kb

And on Linux

  before: 9,225,140 kb
  after:  4,387,464 kb

According to the Windows clang.pdb files, here is a list of types that are no
longer complete with this option enabled: https://reviews.llvm.org/P8182


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72427

Files:
  clang/include/clang/Basic/CodeGenOptions.h
  clang/include/clang/Basic/DebugInfoOptions.h
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/CGBlocks.cpp
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/lib/CodeGen/CGDecl.cpp
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CGStmtOpenMP.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGenCXX/debug-info-limited-ctor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72427.236933.patch
Type: text/x-patch
Size: 19467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200109/655b307a/attachment-0001.bin>


More information about the cfe-commits mailing list