| |||
| Home > Compiler Command-line Options > --ltcg | |||
This option instructs the compiler to create objects in an intermediate format so that Link-Time Code Generation (LTCG) optimizations can be performed. The optimizations applied include cross-module inlining to improve performance, and sharing of base addresses to reduce code size.
This option might significantly increase link time and memory requirements. For large applications it is recommended that you do the code generation in partial link steps with a subset of the objects.
The LTCG feature is deprecated. As an alternative ARM recommends you use the --multifile option.
The following example shows how to use the --ltcg option.
armcc -c --ltcg file1.c armcc -c --ltcg file2.c armlink --ltcg file1.o file2.o -o prog.axf
Automatic function inlining and multifile compilation in Using the Compiler
Inline functions in C99 mode in Using the Compiler
--ltcg in the Linker Reference
About link-time code generation in the Linker Reference.