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.
No... you want to check both options in one call, otherwise -fno-use-ctor-homing -fuse-ctor-homing will prefer the no version instead of last-one-wins.
I suggest fiddling the options should be done separately.
Also if you want to make it a clang option, the option name should have debug in it; pretty sure all the -f options related to debug info do that, and in any case it's a good idea.