JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++


The TI CodeComposer Compiler Models



Overview

CodeSonar provides two TI CodeComposer compiler models.

Compiler
model
Modeled native compiler Source file extensions Description
cl6x cl6x .c, .C, .cc, .cpp, .cxx Texas Instruments TMS320C6000 Optimizing C/C++ Compiler.

Also suitable for use with the following Texas Instruments compilers.

armcl ARM Optimizing C/C++ Compiler
cl430 MSP430 Optimizing C/C++ Compiler
cl470 TMS470R1x C/C++ Compiler
cl55 TMS320C55x Optimizing C/C++ Compiler
cl2000 TMS320C28x Optimizing C/C++ Compiler
cl30 cl30 .c, no extension Texas Instruments TMS320C3x/C4x Optimizing Compiler.

Availability

Platform Availability The cl30 and cl6x compiler models are available for all platforms.
Default Recognition/Handling By default, compilations are recognized and handled as follows.
Platform Native Compiler Model Used
Windows only armcl.exe cl6x
Windows only cl2000.exe cl6x
Windows only cl30.exe cl30
Windows only cl430.exe cl6x
Windows only cl470.exe cl6x
Windows only cl55.exe cl6x
Windows only cl6x.exe cl6x
Specifying Additional Mappings On other platforms, use the COMPILER_MODELS configuration file parameter to instruct CodeSonar to use the required compiler models:
COMPILER_MODELS += cl30 -> cl30
COMPILER_MODELS += cl6x -> cl6x
COMPILER_MODELS += armcl -> cl6x
COMPILER_MODELS += cl430 -> cl6x
COMPILER_MODELS += cl470 -> cl6x
COMPILER_MODELS += cl55 -> cl6x
COMPILER_MODELS += cl2000 -> cl6x

For full details of all native compilers recognized by CodeSonar by default, see section Compilers Recognized by CodeSonar.

cl6x model

Command Arguments

Command arguments can be specified on the command line, in files specified with -@, and in environment variables:

compiler environment variable
cl6x C6X_C_OPTION *
armcl TI_ARM_C_OPTION *
cl430 MSP430_C_OPTION *
cl470 C_OPTION
cl55 C55X_C_OPTION *
cl2000 C2000_C_OPTION *

[*] For cl6x, armcl, cl430, cl55, and cl2000: if the compiler-specific environment variable is empty or not defined, C_OPTION is used instead.

The following command arguments are interpreted by the cl6x compiler model. All others are silently ignored by the model. All these options are passed to the front end unless specifically noted.

Argument Alternative Additional Treatment in Model
--asm_file file
--asm_file=file
-fa file
-fa=file
-fafile
Not passed to front end, no special treatment in model.
--ap_file file
--ap_file=file
-fl file
-fl=file
-flfile
Not passed to front end, no special treatment in model.
--auto_inline val
--auto_inline=val
-oifile
-oi=file
-oifile
Not passed to front end, no special treatment in model.
--c89 (n/a) Specifies front end option --c89, provided the modeled compilation is in C mode.
--c99 (n/a) Specifies front end option --c99, provided the modeled compilation is in C mode.
--c++03 (n/a) Specifies front end option --c++03, provided the modeled compilation is in C++ mode.
--c++14 (n/a) Specifies front end option --c++14, provided the modeled compilation is in C++ mode.
--c_extensionext
--c_extension=ext
-ec ext
-ec=ext
-ecext
Changes the set of file extensions associated with C source files to {.ext, .c}.
--c_file file
--c_file=file
-fc file
-fc=file
-fcfile
file will be treated as a C source file. This option is not passed through to the front end.
--cmd_file file
--cmd_file=file
-@ file
-@=file
-@file
Extracts the options specified in file and appends them to the command line.
--cpp_default -fg Treat all source files with C extensions as if they are C++ source files.
--cpp_extensionext
--cpp_extension=ext
-ep ext
-ep=ext
-epext
Changes the set of file extensions associated with C++ source files to {.ext, .C, .cpp, .cxx, .cc}.
--cpp_file file
--cpp_file=file
-fp file
-fp=file
-fpfile
file will be treated as a C++ source file. This option is not passed through to the front end.
--define m
--define=m
-D m
-D=m
-Dm
Defines macro m to 1. All instances of -D on the command line are processed before any -U options.
--define m=def -Dm=def Defines macro m to def. All instances of -D on the command line are processed before any -U options.
--embedded_cpp -pe Not passed to front end, no special treatment in model.
--exceptions (n/a) Specifies front end option --exceptions, provided the modeled compilation is in C++ mode. (In all other C++ cases, specifies --no_exceptions.)
--gcc (n/a) Specifies front end option --gcc, provided the modeled compilation is in C mode. Supersedes additional treatment due to previous occurrences of --kr-compatible, --relaxed_ansi, or --strict_ansi.
--include-path dir
--include-path=dir
-I dir
-I=dir
-Idir
Appends directory dir to the list of directories searched for include files.
--kr_compatible -pk Specifies front end option --old_c, provided the modeled compilation is in C mode. Supersedes additional treatment due to previous occurrences of --gcc, --relaxed_ansi, or --strict_ansi.
--no_inlining -pi Not passed to front end, no special treatment in model.
--obj_file file
--obj_file=file
-fo file
-fo=file
-fofile
file will be treated as an object file. This option is not passed through to the front end.
--opt_level
--opt_level=level
-O
-O=level
-Olevel
Defines macro _INLINE (unless --no_inlining/-pi is also specified).
--rtti -rtti Specifies front end option --rtti, provided the modeled compilation is in C++ mode. (In all other C++ cases, specifies --no_rtti.)
--silicon_version version
--silicon_version=version
-mv version
-mv=version
-mvversion
-v version
-v=version
-vversion
Affects compiler-specific macro settings for cl6x, cl2000, cl430.
--relaxed_ansi -pr Supersedes additional treatment due to previous occurrences of --gcc, --kr-compatible, or --strict_ansi.
--strict_ansi -ps Specifies front end option --strict, provided the modeled compilation is in C mode. Supersedes additional treatment due to previous occurrences of --gcc, --kr-compatible, or --relaxed_ansi.
--undefine m
--undefine=m
-U m
-U=m
-Um
Undefines macro m. -U options are evaluated after all -D options.

No CodeSonar Build

If any of the following are specified for a compiler invocation, CodeSonar will ignore the compilation and will not generate any corresponding internal representation. If a CodeSonar project is based only on ignored compilations, it will have no contents and so will not be finalized.

C and C++ versions

The cl6x compiler model will specify C/C++ version-related front end options in the following cases.

Condition Front end option specified
Command line option --c99 specified. --c99
[C++ only] Native compiler is cl6x with version string 8003000 or later. --c++14
[C++ only] Native compiler is armcl with version string 18001000 or later. --c++14
[C++ only] Native compiler is cl2000 with version string 18001000 or later. --c++14
[C++ only] Native compiler is cl430 with version string 18001000 or later. --c++14

Predefined Macros and Paths

The cl6x compiler model defines various macros in addition to the standard CodeSonar predefined macros. It also specifies various front end options.

Include Paths As specified with command arguments of the form -ipath, and environment variable that depends on the compiler:
compiler environment variable
cl6x C6X_C_DIR *
armcl TI_ARM_C_DIR *
cl430 MSP430_C_DIR *
cl470 C_DIR
cl55 C55X_C_DIR *
cl2000 C2000_C_DIR *
[*] For cl6x, armcl, cl430, cl55, and cl2000: if the compiler-specific environment variable is empty or not defined, C_DIR is used instead.

Macros

The cl6x compiler model attempts to invoke the native compiler to extract its predefined macros so they can be used for the modeled compilation. For some macros (indicated below) the model provides default settings when this invocation is unsuccessful.

Macros Always Defined,
all modeled compilers
The following macros are defined for all uses of the cl6x compiler model.
__STDC__ =1 (i.e. not 0)
__TI_COMPILER_VERSION__ = the version string of the installed compiler if it can be determined, 6000008 otherwise.
Conditionally Defined Macros,
all modeled compilers
_INLINE =1 when --opt_level is specified and --no_inlining is not specified.
Compiler-Specific Macros for cl6x If the native compiler invocation is unsuccessful, the following macro defaults are defined when using the cl6x model with the cl6x compiler.
_TMS320C6X =1 always
__TMS320C6X__ =1 always
_TMS320Cnn00 =1

 

(exactly one such)
nn
is determined as follows
  • When -mvtarget is specified, nn is the first two characters of target. If there are multiple occurrences of -mv, the rightmost one is used.
  • If -mv is not specified, target is 6200 and nn is 62.
Depending on target, _TMS320Cnn00_PLUS may also be defined.
_TMS320Cnn00_PLUS =1 when
  • _TMS320Cnn00 is defined, and
  • nn is 64 or 67, and
  • the final character of target is +.
Compiler-Specific Macros for armcl If the native compiler invocation is unsuccessful, the following macro defaults are defined when using the cl6x model with the armcl compiler.
__TI_ARM__ =1 always
__TMS470__ =1 always
Compiler-Specific Macros for cl2000 If the native compiler invocation is unsuccessful, the following macro defaults are defined or conditionally defined when using the cl6x model with the cl2000 compiler.
__TMS320C2000__ =1 always
__TMS320C28XX__ =1 when -mv28 is specified.
_TMS320C28X =1 when -mv28 is specified.
__TMS320C28X__ =1 when -mv28 is specified.
__TMS320C28XX_FPU32__ =1 when -mv28 is specified.
__TMS320C28XX_FPU64__ =1 when -mv28 is specified.
Compiler-Specific Macros for cl430 If the native compiler invocation is unsuccessful, the following macro defaults are defined or conditionally defined when using the cl6x model with the cl430 compiler.
__MSP430__ =1 always
__MSP430X__ =1 when -mvmspx is specified.
__MSP430X461X__ =1 when -mvmspx is specified.
Compiler-Specific Macros for cl470 If the native compiler invocation is unsuccessful, the following macro defaults are defined when using the cl6x model with the cl470 compiler.
__TI_ARM__ =1 always
__TMS470__ =1 always
Compiler-Specific Macros for cl55 If the native compiler invocation is unsuccessful, the following macro default is defined when using the cl6x model with the cl55 compiler.
__TMS320C55X__ =1 always

Front End Options

Conditionally Specified Front End Options,
all modeled compilers
--c99 [C only] if command line option --c99 is specified.
--cs_ext_declaration_after_statement [C only] if command line option --c99 is not specified.
--gcc [C only] if command line option --gcc is specified (without subsequent --kr_compatible, --relaxed_ansi, or --strict_ansi).
--exceptions [C++ only] if command line option --exceptions is specified.
--no_exceptions [C++ only] if command line option --exceptions is not specified.
--no_rtti [C++ only] if command line option --rtti is not specified.
--old_c [C only] if command line option --kr_compatible is specified (without subsequent --gcc, --relaxed_ansi, or --strict_ansi).
--rtti [C++ only] if command line option --rtti is specified.
--strict [C only] if command line option --strict_ansi is specified (without subsequent --kr_compatible, --relaxed_ansi, or --gcc).
Compiler-Specific Front End Options for cl6x The following front end options are conditionally specified when using the cl6x model with the cl6x compiler.
--c++14 [C++ only] if version string is 8003000 or later.
--cs_allow_nonstandard_anonymous_unions if version string is 8002000 or later.
--cs_ext_anonymous_variable if version string is 8002000 or later.
--cs_ext_binary_number if version string is 8002000 or later.
--cs_ext_zero_size_array if version string is 8002000 or later.
Compiler-Specific Front End Options for armcl The following front end options are conditionally specified when using the cl6x model with the armcl compiler.
--cs_c11_atomic_keyword always
--c++14 [C++ only] if version string is 18001000 or later.
--cs_allow_nonstandard_anonymous_unions if version string is 15000000 or later.
--cs_ext_anonymous_variable if version string is 15000000 or later.
--cs_ext_binary_number if version string is 15000000 or later.
--cs_ext_zero_size_array if version string is 15000000 or later.
Compiler-Specific Front End Options for cl2000 The following front end options are conditionally specified when using the cl6x model with the cl2000 compiler.
--c++14 [C++ only] if version string is 18001000 or later.
--cs_allow_nonstandard_anonymous_unions if version string is 15000000 or later.
--cs_ext_anonymous_variable if version string is 15000000 or later.
--cs_ext_binary_number if version string is 15000000 or later.
--cs_ext_zero_size_array if version string is 15000000 or later.
Compiler-Specific Front End Options for cl430 The following front end options are specified when using the cl6x model with the cl430 compiler.
--c++14 [C++ only] if version string is 18001000 or later.
--cs_allow_nonstandard_anonymous_unions if version string is 15000000 or later.
--cs_ext_anonymous_variable if version string is 15000000 or later.
--cs_ext_binary_number if version string is 15000000 or later.
--cs_ext_zero_size_array if version string is 15000000 or later.
Compiler-Specific Front End Options for cl470 n/a
Compiler-Specific Front End Options for cl55 n/a

cl30 model

Command Arguments

Command arguments can be specified on the command line, in files specified with -@, and in environment variable C_OPTION.

The following command arguments are interpreted by the cl30 compiler model. All others are silently ignored by the model. All these options are passed to the front end unless specifically noted.

Argument Additional Treatment in Model
-@file
-@ file
Extracts the options specified in file and appends them to the command line.
-dm Defines macro m to 1.
-dm=def Defines macro m to def.
-faval
-fa val
Not passed to front end, no special treatment in model.
-fcval
-fcval
file will be treated as a C source file. This option is not passed through to the front end.
-fofile
-fo file
file will be treated as an object file. This option is not passed through to the front end.
-idir Appends directory dir to the list of directories searched for include files.
-mb Defines macro _BIGMODEL.
-mr Defines macro _REGPARM.
-tf Specifies front end option --ti_relaxed_prototype.
-tp Specifies front end option --ti_relaxed_type.
-um Undefines macro m.
-vproc Defines several macros: see below.
-x2 Defines macro _INLINE.

No CodeSonar Build

If any of the following are specified for a compiler invocation, CodeSonar will ignore the compilation and will not generate any corresponding internal representation. If a CodeSonar project is based only on ignored compilations, it will have no contents and so will not be finalized.

Predefined Macros and Paths

The cl30 compiler model defines the following macros in addition to the standard CodeSonar predefined macros.

Include Paths As specified with command arguments of the form -ipath, and environment variable C_DIR.
Macros Always Defined
__PTRDIFF_T_TYPE__ =int
__SIZE_T_TYPE__ =unsigned
__STDC__ =1 (i.e. not 0)
__WCHAR_T_TYPE__ =unsigned short
Conditionally Defined Macros
_Cpx =1 proc and p are determined as follows.
  • When -vproc is specified, p is the first character of proc. If there are multiple occurrences of -v, the rightmost one is used.
  • If -v is not specified, proc is 30 and p is 3.
_Cproc =1
_TMS320Cpx =1
_TMS320Cproc =1
_BIGMODEL =1 when -mb is specified.
_INLINE =1 when -x2 is specified.
_REGPARM =1 when -mr is specified.
 

To report problems with this documentation, please visit https://support.codesecure.com/.