Type Switch
Syntax {$Y+}, {$Y-}, or {$YD};
{$REFERENCEINFO ON},
{$DEFINITIONINFO OFF} or {$REFERENCEINFO OFF},
or {$DEFINITIONINFO ON}
Default {$YD}
{$DEFINITIONINFO ON}
Scope Global
The $Y directive controls
generation of symbol reference information used by the Project Browser, Code
Explorer, and Code editor. This information consists of tables that provide the
source-code line numbers for all declarations of and (in the {$Y+} state)
references to identifiers in a module. For units, the information is recorded
in the .dcu file along with the unit’s object code. Symbol reference
information increases the size of .dcu files, but it does not affect the size
or speed of the executable program.
When a program or unit is compiled
in the default {$YD} (or {$DEFINITIONINFO ON}) state, the compiler records
information about where each identifier is defined. For most identifiers -- variables,
constants, classes, and so forth -- the compiler records the location of the
declaration. For procedures, functions, and methods, the compiler records the
location of the implementation. This enables Code editor browsing.
When a program or unit is compiled
in the {$Y+} (or {$REFERENCEINFO ON}) state, the compiler records information
about where every identifier is used as well as where it is defined. This
enables the References page of the Project Browser.
When a program or unit is compiled
in the {$Y-} (or {$DEFINITIONINFO OFF} or {$REFERENCEINFO OFF}) state, no
symbol reference information is recorded. This disables Code editor browsing
and the References page of the Project Browser.
The $Y switch is usually used in
conjunction with the $D and $L switches, which control generation of debug
information and local symbol information. The $Y directive has no effect unless
both $D and $L are enabled.
Note: Generating full cross-reference information ({$Y+}) can slow the compile/link cycle, so you should not use this except when you need the Project Browser References page.