-Oi: Inlining

Group

OPTIMIZATIONS

Scope

Compilation unit

Syntax
  -Oi[=(c<code Size>|OFF)]
  
  
Arguments

<code Size>: Limit for inlining in code size

OFF: switching off inlining

Default

None. If no <code Size> is specified, the compiler uses a default code size of 40 bytes.

Defines

None

Pragmas

  #pragma INLINE
  
  
Description

This option enables inline expansion. If there is a #pragma INLINE before a function definition, the Compiler replaces all calls of this function by the code of this function, if possible.

Using the option -Oi=c0 switches off inlining. Functions marked with the #pragma INLINE are still inlined. To disable inlining, use the -Oi=OFF option.

Example
  -Oi
  
  
  #pragma INLINE

  
  static void f(int i) {

  
    /* all calls of function f() are inlined */

  
    /* ... */

  
  }

  

The [ =c<n>] option extension inlines all functions with a size smaller than <n>. For example, compiling with the option -oi=c100 enables inline expansion for all functions with a size smaller than 100 bytes.

Restrictions

The following functions are not inlined: