The configuration optimizer is a build extension that you can use as a tool to optimize the configuration of C++ source files in a project. In an optimized configuration, the amount of preprocessing and reprocessing of identical declarations is minimized. The configuration optimizer attempts to achieve this goal by converting included source files into primary source files, whenever possible, and by applying the build option macros(global) to converted files that define global macros. It replaces the existing configuration file and the replaced file is backed up.
Before you use the configuration optimizer, make sure that you can build successfully with your configuration file and source files. If you are migrating existing source files to VisualAge C++, you should complete a successful migration build before you run the configuration optimizer. There are two ways to run the configuration optimizer:
tool "config_opt"
This directive does not appear in the configuration file produced by the configuration optimizer.
The configuration optimizer does not require an existing codestore, and uses the codestore of the current build. At the end of the build, the codestore reflects the final state of the configuration file.
The configuration optimizer works iteratively, making as many passes through an internal representation of the configuration file as are required to complete all possible conversions. On each pass it tries to convert top-level included files into primary files. When optimization is complete, original configuration file is copied to a file with the same base file name as the original configuration file and the first unused file extension in the set .bk0, .bk1, and so on. The configuration optimizer then creates a new configuration file with the same base file name as the original configuration file and the file extension .icc. The structure of the original configuration file and any include configuration file directives in it are preserved.
The configuration optimizer promotes included files to primary files by listing their file names in source directives in the configuration file. It does not delete #include directives in your source code or modify your source files in any way.
No included file is promoted if doing so can change the meaning of targets built from the including source. A header is not promoted in the following circumstances:
![]()
Projects
Configuration Files
Codestore
Incremental C++ Builds
C++ Source Files and Source Regions
Macros in C++ Source Files
One Definition Rule
Build Extensions and Extension Specification
Files
![]()
Convert Included Source Files to
Primary Source Files
Add or Change Source
Files
Migrate Source
Files
