Name
tdfc2, tcpplus — DRA C/C++ to TDF producers
Synopsis
tdfc2/tcpplus
tdfc2/tcpplus
tdfc2/tcpplus
tdfc2/tcpplus
Most options are common to all modes. For brevity, these are not repeated above:
[ -H ] [ -I dir ] [ -N name:dir ] [ -U macro ] [ -V ] [ -W opt ] [ -X ] [ -Z num ]
[ -a ] [ -c ] [ -d opt=dump-file ] [ -e file ] [ -f file ] [ -g ] [ -i name ] [ -j opt ] [ -m opt ]
[ -n port-table ] [ -o output-file ] [ -q ] [ -t ] [ -u name ... name ] [ -w ] [ -z ]
Description
tdfc2 and tcpplus have three modes which determine the form of their input and output files.
The default mode is compilation, in which an input source file, input-file.c/.cc, is translated into a TDF capsule, output-file.j. tdfc2 translates C source, and tcpplus translates C++ source. The output file can alternatively be specified using the -o option. If the output file name is omitted or is -, standard output is used. In general there can be any number of input files. If the input file name is omitted or is -, standard input is used.
In preprocessing mode, specified using the -E option, the single input source file, input-file.c/.cc, is preprocessed to an output file, output-file.j. Note that the preprocessor is built into tdfc2 and tcpplus, rather than, as with most other compilers, being a separate program.
The final mode is spec linking, invoked using the -S option, in which any number of spec input files, input-file.k/.kk, are linked and any code generated as a result (for example, template instantiations) is written to the output TDF capsule, output-file.j.
In either compilation or spec linking mode, a spec file can be generated in addition to the TDF capsule, using the -s option. The generated spec file contains information enabling intermodule analysis to be performed.
In any mode a tdfc2dump symbol table dump output file can be generated using the -d option. This outputs usage and error information suitable for processing by other tools, output as a symbol table dump file. See tdfc2dump for the dump file format.
Invocation
While it is possible to use tdfc2 and tcpplus as stand-alone programs, it is recommended that they should be invoked via tcc or tcc -ch. The TCC Users' Guide should be consulted for more details.
The command-line options can appear in any order and can be interspersed with the input and output files, except following a -- option.. All the multi-part options can be given either as one or two command-line arguments, so that -Idir and -I dir are equivalent.
Most of the command-line option handling for tdfc2 and tcpplus is done by tcc and tcc -ch, however when invoking tcc, options may be passed directly to tdfc2 using -Wc,opt and to tcpplus using -Wx,opt. Similarly -Wg,opt and -WS,opt can be used to pass options to the C++ preprocessor and the C++ spec linker (both of which are actually tdfc2 or tcpplus invoked with different options) respectively.
tcc requires the -Yc++ command-line option in order to enable C++ capabilities. Files with a .C suffix are recognised as C++ source files and passed to tcpplus for processing It is possible to change the suffix used for C++ source files; for example -sC:cc causes .cc files to be recognised as C++ source files. An interesting variation is -sC:c which causes C source files to be processed by the C++ producer. Similarly .I files are recognised as preprocessed C++ source files and .K files are recognised as C++ spec files.
Options
- -A predicate(tokens)
-
Asserts that the given predicate is true. That is to say:
#assert predicate ( tokens )
The special case -A- undefines all the built-in predicates (of which there are none). Use of this option automatically enables support for the tdfc2pragma
#assertand#unassertdirectives. - -C file
-
Load the given file as as a character set map. See tdfc2charset for the syntax of this file.
- -D macro
- -D macro=tokens
-
Defines the given macro to be 1 in the first case, or the given sequence of preprocessing tokens in the second case. That is to say, respectively:
#define macro 1 #define macro tokens
In fact -D and -U options to tcc are not passed as -D and -U options to tdfc2 or tcpplus. Instead a start-up file containing the equivalent
#defineand#undefdirectives is used. - -E
-
Enables preprocessing mode in which the input C source file is preprocessed into the output file.
- -F file
-
Causes a list of options to be read from file. Other than empty lines and lines beginning with
#, each line in the file is treated as if it had been specified as a separate command-line option. - -H
-
Enables verbose inclusion mode in which warnings are printed at the start and the end of each included source file.
- -I dir
-
Adds the given directory to the list searched for included source files. No such directories are built in.
- -N name:dir
-
Is identical to -I dirdir except that it also associates the given identifier with the directory. The directory name can be used to specify a tdfc2pragma compilation profile to be used on files included from this directory.
- -S
-
Enables spec linker mode in which any number of input spec files are linked into a single output spec file.
- -U macro
-
Undefines the given macro.
The special case -U- undefines all the built-in macros. These are the standard macros
__FILE__,__LINE__,__TIME__,__DATE__,__STDC__and__STDC_VERSION__, and also__cplusplusfor tcpplus only. Additionally, the macro__tcpplusis undefined; by default this is0for tdfc2 and1for tcpplus.The actual value of
__cplusplusgives the date of the draft ISO C++ standard on which the current version of the producer is based. The value given above gives the expected date of the final C++ standard. - -V
-
Print the name of each function to standard output as it is compiled.
- -W opt
-
Give a warning in the circumstances described by opt. This sets the given compiler option thus:
#pragma TenDRA option "opt" warning
The special case -Wall enables a wide range of warnings.
- -X
-
Disables exception handling. The current implementation can be a large run-time overhead if not required. The effect of linking any module compiled with this option with a module which throws an exception is undefined. This is equivalent to -j-e.
- -Z num
-
Sets the maximum number of errors printed before bailing out to be num. The default is 32.
- -a
-
Apply complete program analysis to input files. That is, assume that no other translation units need to be linked in order for the program to execute.
- -c
-
Disables TDF output. The output file will still be a valid TDF capsule, only it will contain no information. This is equivalent to -j-c.
- -d opt=dump-file
-
Dump information about the input source file into dump-file. opt is a set of characters describing the information to be dumped, as follows:
Key Description a(all
)equivalent to ehlmucdump string and character literals edump error messages hdump header information kdump keyword identifiers ldump local variables mdump macro identifiers sdump scope information udump identifier usage information These correspond to the tcc -sym options.
- -e file
- -f file
-
Specifies the given file as a
start-up
orend-up
file respectivelyfile. This is equivalent to adding:#include "file"
at the start or end of the input source file.
More than one start-up and end-up file may be given; they are processed in the order given.
- -g
-
Specifies that the output TDF capsule should also contain information to allow for the generation of run-time debugging directives. This is equivalent to -jg.
- -h
-
Causes tdfc2 to print a full list of its available command-line options. This includes a number not documented here which are unlikely to prove useful to the normal user.
- -i name
-
Specifies the machine name for use in diagnostics. This is the hostname of the machine where the source files are to be found, given from the perspective of a debugger inspecting objects produced from those files.
The machine name defaults to the empty string, meaning the same machine as the debugger.
- -j opt
-
Sets the TDF output options given by opt. This consists of a sequence of characters describing the options to be enabled or disabled. The available options are:
Key Default Description +– enable subsequent options (default) -– disable subsequent options aoff output external names for local objects boff work around old installer bugs con output TDF capsule doff output termination function eon output exceptions fon mangle template function signatures goff output debugging information ioff output dynamic initialisers as a function non mangle object names ooff order class data members by access pon output partial destructors ron output run-time type information son output shared string literals toff output token declarations uon output unused static variables voff output local virtual function tables - -m opt
-
Sets the error formatting options given by opt. This consists of a sequence of characters describing the options to be enabled or disabled. The available options are:
Key Default Description +– enable subsequent options (default) -– disable subsequent options coff show source code with error eoff show error name goff record statement locations koff enable C++ spec output loff output full error location son output ISO section number toff use typedefnames in errorswoff disable warnings zoff continue after error - -n port-table
-
Specifies that the given portability table should be used to specify the basic configuration parameters.
- -o output-file
-
An alternative method of specifying the output file.
- -q
-
Quit immediately without processing input files. This is useful primarily in version and command line queries.
- -s spec-file.k/.kk
-
Write a spec file describing the input source file to spec-file.
- -t
-
Include token declarations in the output TDF capsule. While these are strictly unnecessary, they help when pretty-printing the output. This is equivalent to -jt.
- -u name ... name
-
Print the unmangled forms of the given mangled identifier names. The form:
tcpplus -u name .... name
can be used to print the unmangled forms of a list of mangled identifier names to standard output.
- -v
-
Print the producer version number to standard error, along with the versions of the source language and TDF supported.
- -w
-
Disables all warning messages. This is equivalent to -mw.
- -z
-
Forces tdfc2 and tcpplus to produce an output file even if compilation errors occur. The effect of installing a TDF capsule produced using this option is undefined. This is equivalent to -mz.
- --
-
Marks the last option. Any subsequent arguments are interpreted as input and output files even if they resemble command-line options.