Lines Matching refs:LTO
2 LTO Visibility
5 *LTO visibility* is a property of an entity that specifies whether it can be
6 referenced from outside the current LTO unit. A *linkage unit* is a set of
8 unit's *LTO unit* is the subset of the linkage unit that is linked together
9 using link-time optimization; in the case where LTO is not being used, the
10 linkage unit's LTO unit is empty. Each linkage unit has only a single LTO unit.
12 The LTO visibility of a class is used by the compiler to determine which
19 ODR violation to define a class with hidden LTO visibility in multiple linkage
20 units. A class with public LTO visibility may be defined in multiple linkage
22 control flow integrity features can only be applied to classes with hidden LTO
23 visibility. A class's LTO visibility is treated as an ODR-relevant property
26 In translation units built with LTO, LTO visibility is based on the
31 visibility receive public LTO visibility. When targeting Windows, classes
32 with dllimport or dllexport attributes receive public LTO visibility. All
33 other classes receive hidden LTO visibility. Classes with internal linkage
34 (e.g. classes declared in unnamed namespaces) also receive hidden LTO
37 A class defined in a translation unit built without LTO receives public
38 LTO visibility regardless of its object file visibility, linkage or other
42 two cases where it may wrongly infer hidden LTO visibility.
45 combination of LTO object files and non-LTO object files, any hidden
46 visibility class defined in both a translation unit built with LTO and
47 a translation unit built without LTO must be defined with public LTO
54 used in this way must be defined with public LTO visibility.
59 LTO visibility. On Windows platforms, clang-cl's ``/MT`` and ``/MTd``
61 these flags imply public LTO visibility for every class declared in the
67 The following example shows how LTO visibility works in practice in several
76 …| | LTO unit (clang++ -fvisibility=hidden -flto): | | | virtual void f(); …
93 We will now describe the LTO visibility of each of the classes defined in
96 Class ``A`` is not defined outside of ``main``'s LTO unit, so it can have
97 hidden LTO visibility. This is inferred from the object file visibility
100 Class ``B`` is defined in ``main``, both inside and outside its LTO unit. The
101 definition outside the LTO unit has public LTO visibility, so the definition
102 inside the LTO unit must also have public LTO visibility in order to avoid
106 have public LTO visibility. This is correctly inferred from the ``visibility``
111 ``D`` in ``main``'s LTO unit must have public LTO visibility in order to be