[all-commits] [llvm/llvm-project] 651128: [DebugInfo] Add option to clang to limit debug inf...

Amy Huang via All-commits all-commits at lists.llvm.org
Tue Jan 14 12:45:34 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 651128f557229e79598e22102edb7fad3bf288c0
      https://github.com/llvm/llvm-project/commit/651128f557229e79598e22102edb7fad3bf288c0
  Author: Amy Huang <akhuang at google.com>
  Date:   2020-01-14 (Tue, 14 Jan 2020)

  Changed paths:
    M clang/lib/CodeGen/CGDebugInfo.cpp
    A clang/test/CodeGenCXX/debug-info-limited-ctor.cpp

  Log Message:
  -----------
  [DebugInfo] Add option to clang to limit debug info that is emitted for classes.

Summary:
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

Reviewers: rnk, dblaikie

Subscribers: aprantl, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D72427




More information about the All-commits mailing list