Syntax:
The /inline or /Ob2 option allows users to have some control over inlining. Inlining procedures can greatly improve the run-time performance for certain applications.
When requesting procedure inlining (or interprocedural optimizations), compile all source files together into a single object file whenever possible. With very large applications, compile as many related source files together as possible.
If you compile sources without linking (see the /compile_only option), be sure to also specify the /object[:filename] option to create a single object file.
In the visual development environment, specify the Inlining type in the Optimizations Compiler Option Category. The /inline options are:
/inline:none or /noinline | /inline:manual |
/inline:size | /inline:speed or /Ob2 |
inline:all |
The /inline options:
Prevents the inlining of procedures, except for statement functions. This type of inlining occurs if you specify /optimize:0 or /optimize:1 and omit /inline options.
Prevents the inlining of procedures, except for statement functions. This type of inlining occurs if you specify /optimize:2 or /optimize:3 and omit /inline options.
Inlines procedures that will improve run-time performance without significantly increasing program size. It includes the types of procedures inlined when you specify /inline:manual.
Inlines procedures that will improve run-time performance with a significant increase in program size. This type of inlining is available with /optimize:1 or higher. This type of inlining occurs if you specify /optimize:4 or /optimize:5 and omit /inline options.
Inlines absolutely every call that it is possible to inline while still getting correct code. However, recursive routines will not cause an infinite loop at compile time. This type of inlining is available with /optimize:1 or higher. It includes the types of procedures inlined when you specify other /inline options.
Using /inline:all can significantly increase program size and slow compilation speed.
For more detailed information on this option, see Controlling the Inlining of Procedures.