[all-commits] [llvm/llvm-project] 1a3bf2: [DebugInfo] Switch to using constructor homing (-d...

Amy Huang via All-commits all-commits at lists.llvm.org
Mon Jul 26 17:25:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a3bf2953a9209fdc4dbb6e99678e02a7fec019d
      https://github.com/llvm/llvm-project/commit/1a3bf2953a9209fdc4dbb6e99678e02a7fec019d
  Author: Amy Huang <akhuang at google.com>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M clang/include/clang/Basic/DebugInfoOptions.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/CodeGenCXX/debug-info-template-deduction-guide.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:
  -----------
  [DebugInfo] Switch to using constructor homing (-debug-info-kind=constructor) by default when debug info is enabled

Constructor homing reduces the amount of class type info that is emitted
by emitting conmplete type info for a class only when a constructor for
that class is emitted.

This will mainly reduce the amount of duplicate debug info in object
files. In Chrome enabling ctor homing decreased total build directory sizes
by about 30%.

It's also expected that some class types (such as unused classes)
will no longer be emitted in the debug info. This is fine, since we wouldn't
expect to need these types when debugging.

In some cases (e.g. libc++, https://reviews.llvm.org/D98750), classes
are used without calling the constructor. Since this is technically
undefined behavior, enabling constructor homing should be fine.
However Clang now has an attribute
`__attribute__((standalone_debug))` that can be used on classes to
ignore ctor homing.

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

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




More information about the All-commits mailing list