[all-commits] [llvm/llvm-project] 227db8: Switch to using -debug-info-kind=constructor as de...

Amy Huang via All-commits all-commits at lists.llvm.org
Thu Jul 9 15:36:37 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 227db86a1b7dd6f96f7df14890fcd071bc4fe1f5
      https://github.com/llvm/llvm-project/commit/227db86a1b7dd6f96f7df14890fcd071bc4fe1f5
  Author: Amy Huang <akhuang at google.com>
  Date:   2020-07-09 (Thu, 09 Jul 2020)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/Driver/cl-options.c
    M clang/test/Driver/clang-g-opts.c
    M clang/test/Driver/cuda-dwarf-2.cu
    M clang/test/Driver/debug-options-as.c
    M clang/test/Driver/debug-options.c
    M clang/test/Driver/integrated-as.s
    M clang/test/Driver/myriad-toolchain.c
    M clang/test/Driver/openmp-offload-gpu.c
    M clang/test/Driver/split-debug.c
    M lldb/test/Shell/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp

  Log Message:
  -----------
  Switch to using -debug-info-kind=constructor as default (from =limited)

Summary:
-debug-info-kind=constructor reduces the amount of class debug info that
is emitted; this patch switches to using this as the default.

Constructor homing emits the complete type info for a class only when the
constructor is emitted, so it is expected that there will be some classes that
are not defined in the debug info anymore because they are never constructed,
and we shouldn't need debug info for these classes.

I compared the PDB files for clang, and there are 273 class types that are defined with `=limited`
but not with `=constructor` (out of ~60,000 total class types).
We've looked at a number of the types that are no longer defined with =constructor. The vast
majority of cases are something like class A is used as a parameter in a member function of
some other class B, which is emitted. But the function that uses class A is never called, and class A
is never constructed, and therefore isn't emitted in the debug info.

Bug: https://bugs.llvm.org/show_bug.cgi?id=46537

Subscribers: aprantl, cfe-commits, lldb-commits

Tags: #clang, #lldb

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




More information about the All-commits mailing list