2.6. Extern Inline Functions. Altium TriCore
Реклама
Реклама
TASKING VX-toolset for TriCore User Guide
2. Concatenate all of the
.et
files into a single
.et
file (e.g., mylib.et
) in the export
directory. The individual
.et
files could be copied to the export directory, but having all of the
.et
information in one file will make use of the library more efficient.
3. Create an export_info
file in the export
directory. The export_info
file specifies the include search paths to be used when recompiling files in the export directory. If no export_info
file is provided, the include search path used when compiling the client program that uses the library will also be used to recompile the library exported template files.
The export_info
file consists of a series of lines of the form include=x or sys_include=x where x
is a path name to be placed on the include search path. The directories are searched in the order in which they are encountered in the export_info
file. The file can also contain comments, which begin with a "
#
", and blank lines. Spaces are ignored but tabs are not currently permitted. For example:
# The include directories to be used for the xyz library include = /disk1/xyz/include sys_include = /disk2/abc/include include=/disk3/jkl/include
The include search path specified for a client program is ignored by the C++ compiler when it processes the source in the export library, except when no export_info
file is provided. Command line macro definitions specified for a client program are also ignored by the C++ compiler when processing a source file from the export library; the command line macros specified when the corresponding
.et
file was produced do apply. All other compilation options (other than the include search path and command line macro definitions) used when recompiling the exported templates will be used to compile the client program.
When a library is installed on a new system, it is likely that the export_info
file will need to be adapted to reflect the location of the required headers on that system.
2.6. Extern Inline Functions
Depending on the way in which the C++ compiler is configured, out-of-line copies of extern inline functions are either implemented using static functions, or are instantiated using a mechanism like the template instantiation mechanism. Note that out-of-line copies of inline functions are only required in cases where the function cannot be inlined, or when the address of the function is taken (whether explicitly by the user, by implicitly generated functions, or by compiler-generated data structures such as virtual function tables or exception handling tables).
When static functions are used, local static variables of the functions are promoted to global variables with specially encoded names, so that even though there may be multiple copies of the code, there is only one copy of such global variables. This mechanism does not strictly conform to the standard because the address of an extern inline function is not constant across translation units.
76
Скачать
Реклама