-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, all calls of this function are replaced by the code of this function, if possible.

Using the -Oi=c0 option 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 option extension [ =c<n>] signifies that all functions with a size smaller than <n> are inlined. 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: