Skip to content

Commit

Permalink
Update docs for -fuse-ctor-homing
Browse files Browse the repository at this point in the history
Update docs to reflect the fact that this flag is on by default now.

Differential Revision: https://reviews.llvm.org/D136188
  • Loading branch information
amykhuang committed Oct 27, 2022
1 parent 8ce0c7b commit e8433a2
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions clang/docs/UsersManual.rst
Expand Up @@ -2841,11 +2841,16 @@ below. If multiple flags are present, the last one is used.
Clang supports a number of optimizations to reduce the size of debug
information in the binary. They work based on the assumption that
the debug type information can be spread out over multiple
compilation units. For instance, Clang will not emit type
definitions for types that are not needed by a module and could be
replaced with a forward declaration. Further, Clang will only emit
type info for a dynamic C++ class in the module that contains the
vtable for the class.
compilation units. Specifically, the optimizations are:
- will not emit type definitions for types that are not needed by a
module and could be replaced with a forward declaration.
- will only emit type info for a dynamic C++ class in the module that
contains the vtable for the class.
- will only emit type info for a C++ class (non-trivial, non-aggregate)
in the modules that contain a definition for one of its constructors.
- will only emit type definitions for types that are the subject of explicit
template instantiation declarations in the presence of an explicit
instantiation definition for the type.

The **-fstandalone-debug** option turns off these optimizations.
This is useful when working with 3rd-party libraries that don't come
Expand All @@ -2858,19 +2863,6 @@ below. If multiple flags are present, the last one is used.
**-fno-standalone-debug** option can be used to get to turn on the
vtable-based optimization described above.

.. option:: -fuse-ctor-homing

This optimization is similar to the optimizations that are enabled as part
of -fno-standalone-debug. Here, Clang only emits type info for a
non-trivial, non-aggregate C++ class in the modules that contain a
definition of one of its constructors. This relies on the additional
assumption that all classes that are not trivially constructible have a
non-trivial constructor that is used somewhere. The negation,
-fno-use-ctor-homing, ensures that constructor homing is not used.

This flag is not enabled by default, and needs to be used with -cc1 or
-Xclang.

.. option:: -g

Generate complete debug info.
Expand Down

0 comments on commit e8433a2

Please sign in to comment.