NAME
tomc - TOM compiler
SYNOPSIS
tomc [options] file [output_c [output_info] ]
DESCRIPTION
tomc is the TOM compiler. It translates the file file containing TOM source, and outputs a file output_c which can subsequently be translated by the GNU C compiler, gcc(1), to produce an object file. The input file usually has the extension .t. tomc also produces a file output_info, called the info file, which contains information needed by the TOM resolver, tomr(1). If one or both of the output files is omitted, the default name is the basename of the input file, with the extension .c or .i, respectively.
COMMON OPTIONS
- -I dir
-
Add the directory dir to the search path. A unit foo is searched for in the directories along the search path. If it is not found, it is searched for in the subdirectory foo of every directory along the search path.
The default search path is . (the current directory) and /usr/tom.
- -u unit
-
Name the unit for which to compile. A unit is defined by its unit file, a file with the extension
.u.
- --version
-
Output the version information and exit.
TOMC OPTIONS
- -1
-
Generate code for per-unit resolution. This is needed when creating or using shared libraries, or when linking with units that were compiled using this flag. It also makes resolution faster, since it only has to be done for modified units, instead of all of them. If you do not understand what this is about, always specify -1, just like the makefile templates do.
- -precious
-
Do not unlink the output files in case of an error.
Warning options:
- -Wno-empty
-
Suppress warnings about empty expressions.
- -Wno-redeclare
-
Do not emit warnings about the unqualified redelaration or redefinition of an undeferred method.
The following options modify certain aspects of the code produced by the compiler.
- -fatomic-gc
-
Compile code which assumes atomic garbage collection (GC). Such code is faster, but will fail when run with non-atomic (incremental) garbage collection, or when run with multiple threads. Use of this flag is discouraged.
- -fincremental-gc
-
Compile code which does not assume atomic GC. This is the default.
- -flookup-direct
-
Dispatch method invocations by direct lookup. This causes a huge increase in code size and its use is discouraged.
- -flookup-lookup
-
When dispatching a method, obtain the function pointer to the method implementation by calling the lookup function,
trt_lookup. This function contains the code the compiler would otherwise output for a direct lookup.
- -flookup-send
-
Dispatch methods by invoking the
trt_sendfunction, which performs the lookup and jumps to the method implementation. Since this function must be written in assembly, it may not be available on all targets. Also, see the warnings below on its use on hpux. Sending is the default dispatch mechanism on targets where it is available. On other targets, -flookup-lookup is the default.
- -freadable-c
-
Output readable C code. Net effect is that, when debugging a program compiled with this option, the debugger will show the C code output by the TOM compiler. Without this option (the default), the compiler will insert line directives in the output, causing the debugger to show the TOM source, instead of the C output.
- -fno-pre-checks
-
When specified, method preconditions will not be compiled. This will make the resulting code run faster, but also disable the possibility of precondition checking at run time.
- -fno-post-checks
-
When specified, method postconditions will not be compiled. This will make the resulting code run faster, but also disable the possibility of postcondition checking at run time.
- -fno-checks
-
Combination of -fno-pre-checks and -fno-post-checks.
- -fcheck-extension-address
-
Check every pointer to an extension's state. This really is a debugging sanity check for the TOM runtime library, and not useful for general application. It also makes the generated code run slower.
SEE ALSO
WARNINGS
When compiling code to be dynamically loaded on a machine running HP-UX, make sure that all code being used (all code includes code in units being used and dynamically loaded) is compiled with -flookup-lookup. The reason for this is that due to the calling convention on hppa-hpux and the exit stubs used by the shared library mechanism, code compiled with -flookup-send will loop endlessly on the first method invocation from the dynamically loaded code.
AUTHOR
Pieter J. Schoenmakers <[email protected]>
Department of Electrical Engineering, room EH 9.26
Eindhoven University of Technology
P.O. Box 513
NL-5600 MB Eindhoven
the Netherlands
BUG REPORTS
Bugs can be reported to the author, at [email protected].
MORE INFORMATION
For more information, visit the TOM homepage at http://www.gerbil.org/tom/. To subscribe to the TOM mailing list, send mail to [email protected].