2.12. Optimization (Inline)

The following sections describe inline optimization options.

2.12.1. -h inlinen (CC, cc Commands)

Default option: 

-h inline1

The -h inlinen option specifies the level of inlining to be performed. Inlining eliminates the overhead of a function call and increases the opportunities for other optimizations. Inlining can also increase object code size. Inlining directives and the inline keyword are unaffected by this option.

Following are the values for the n argument:

n 

Description

0 

No inlining is performed.

1 

Conservative inlining; performed only on functions implicitly marked by the inline keyword (C++) or a #pragma _CRI inline directive (C or C++) or on functions defined inside a class definition (C++).

2 

Moderate automatic inlining; includes level 1 plus some automatic inlining.

3 

Aggressive automatic inlining; all functions are candidates for inlining except those specifically marked with a #pragma noinline directive.

2.12.2. -h inlinefrom=file (CC, cc Commands)

The -h inlinefrom=file option specifies inline code expansion of all functions defined in file by the C++ compiler. For the file argument, enter the name of a file that contains one or more functions or enter the name of a directory that contains one or more source files.

Every function defined in the file or directory is inlined unless the call is within the scope of a #pragma _CRI noinline directive.