ADA, Positional Qualifiers, /OPTIMIZE
*Conan The Librarian
/OPTIMIZE[=(option,...])] /NOOPTIMIZE Controls the level of optimization that is applied in producing the compiled code. You can specify one of the following primary options: TIME Provides full optimization with time as the primary optimization criterion. Overrides any occurrences of the pragma OPTIMIZE(SPACE) in the source code. SPACE Provides full optimization with space as the primary optimization criterion. Overrides any occurrences of the pragma OPTIMIZE(TIME) in the source code. DEVELOPMENT Suggested when active development of a program is in progress. Provides some optimization, but development considerations and ease of debugging take preference over optimization. This option overrides pragmas that establish a dependence on a subprogram or generic body (the pragmas INLINE and INLINE_GENERIC), and therefore reduces the need for recompilations when such bodies are modified. This option also disables generic code sharing. NONE Provides no optimization. Suppresses inline expansions of subprograms and generics, including those specified by the pragmas INLINE and INLINE_ GENERIC. Suppresses occurrences of the pragma SHARE_GENERIC and disables generic code sharing. The /NOOPTIMIZE qualifier is equivalent to /OPTIMIZE=NONE. By default, the ADA command applies full optimization with time as the primary optimization criterion (like /OPTIMIZE=TIME, but observing uses of the pragma OPTIMIZE). The /OPTIMIZE qualifier also has a set of secondary options that you can use separately or together with the primary options to override the default behavior for inline expansion (generic and subprogram) and generic code sharing. The INLINE secondary option can have the following values (see the DEC Ada Run-Time Reference Manual for OpenVMS Systems for more information about inline expansion): NONE Disables subprogram and generic inline expansion. This option overrides any occurrences of the pragmas INLINE or INLINE_GENERIC in the source code, without your having to edit the source file. It also disables implicit inline expansion of subprograms. (Implicit inline expansion means that the compiler assumes a pragma INLINE for certain subprograms as an optimization.) A call to a subprogram or an instance of a generic in another unit is not expanded inline, regardless of the /OPTIMIZE options in effect when that unit was compiled. NORMAL Provides normal subprogram and generic inline expansion. Subprograms to which an explicit pragma INLINE applies are expanded inline under certain conditions. In addition, some subprograms are implicitly expanded inline. The compiler assumes a pragma INLINE for calls to some small local subprograms (subprograms that are declared in the same unit as the unit in which the call occurs). Instances are compiled separately from the unit in which the instantiation occurred unless a pragma INLINE_GENERIC applies to the instance. If a pragma INLINE_GENERIC applies and the generic body has been compiled, the generic is expanded inline at the point of instantiation. SUBPROGRAMS Provides maximal subprogram inline expansion and normal generic inline expansion. In addition to the normal subprogram inline expansion that occurs when INLINE:NORMAL is specified, this option results in implicit inline expansion of some small subprograms declared in other units. The compiler assumes a pragma INLINE for any subprogram if it improves execution speed and reduces code size. This option may establish a dependence on the body of another unit, as would be the case if a pragma INLINE were specified explicitly in the source code. With this option, generic inline expansion occurs in the same manner as for INLINE:NORMAL. GENERICS Provides normal subprogram inline expansion and maximal generic inline expansion. With this option, subprogram inline expansion occurs in the same manner as for INLINE:NORMAL. The compiler assumes a pragma INLINE_GENERIC for every instantiation in the unit being compiled unless an explicit pragma SHARE_GENERIC applies. This option may establish a dependence on the body of another unit, as would be the case if a pragma INLINE_GENERIC were specified explicitly in the source code. MAXIMAL Provides maximal subprogram and generic inline expansion. Maximal subprogram inline expansion occurs as for INLINE:SUBPROGRAMS, and maximal generic inline expansion occurs as for INLINE:GENERICS. The SHARE secondary option can have the following values: NONE Disables generic sharing. This option overrides the effect of any occurrences of the pragma SHARE_ GENERIC in the source code, without your having to edit the source file. In addition, instances do not share code from previous instantiations. NORMAL Provides normal generic sharing. Normally, the compiler will not attempt to generate sharable code for an instance (code that can be shared by subsequent instantiations) unless an explicit pragma SHARE_GENERIC applies to that instance. However, an instance will attempt to share code that resulted from a previous instantiation to which the pragma SHARE_GENERIC applied. MAXIMAL Provides maximal generic sharing. The compiler assumes that a pragma SHARE_GENERIC applies to every instance in the unit being compiled unless an explicit pragma INLINE_GENERIC applies. Therefore, an instance will attempt to share code that resulted from a previous instantiation or to generate code that can be shared by subsequent instantiations. SHARE:MAXIMAL cannot be used in combination with INLINE:GENERICS or INLINE:MAXIMAL. By default, if you specify one of the /OPTIMIZE qualifier primary options on the left (for example, /OPTIMIZE=TIME), it has the same effect as specifying the secondary-option values to the right (in this case, /OPTIMIZE=(TIME,INLINE:NORMAL,SHARE:NORMAL)): TIME /OPTIMIZE=(TIME,INLINE:NORMAL,SHARE:NORMAL) SPACE /OPTIMIZE=(SPACE,INLINE:NORMAL,SHARE:NORMAL) DEVELOPMENT /OPTIMIZE=(DEVELOPMENT,INLINE:NONE,SHARE:NONE) NONE /OPTIMIZE=(NONE,INLINE:NONE,SHARE:NONE) See Developing Ada Programs on OpenVMS Systems for more information on the /OPTIMIZE qualifier and its options.