""> Tools Previous Contents Next

F   Tools

F.1   The compiler

General options

The Cyclone compiler has the following command-line options:
Print a short description of the command-line options.
Print compilation stages verbosely.
Print version number and exit.
-o file
Set the output file name to file.
Define a macro named name for preprocessing.
Give macro name the definition defn in preprocessing.
Add dir to the list of directories to search for special compiler files.
Add dir to the list of directories to search for include files.
Add dir to the list of directories to search for libraries.
Link library lib into the final executable.
Produce an object (.o) file instead of an executable; do not link.
-x language
Specify language for the following input files
Remove all symbol table and relocation information from the executable.
A higher level of optimization.
Even more optimization.
Compile for profiling with the prof tool.
Compile for profiling with the gprof tool.
Compile for profiling with the aprof tool.
Stop after producing assembly code.
Produce dependencies for inclusion in a makefile.
When producing dependencies assume missing files are generated. Must be used with -M.
-MT file
Make file be the target of any dependencies generated using the -M flag.
Stop after preprocessing.
Don't link in the garbage collector.

Developer options

In addition, the compiler has some options that are primarily of use to its developers:
Compile for debugging. This is bulletproof for compiler developers, as the debugging information reflects the C code that the Cyclone code is compiled to, and not the Cyclone code itself. To have a look at Cyclone code during debugging (but not very cleanly as of yet), also pass in --lineno (see below).
Stop after parsing.
Stop after type checking.
Stop after translation to C.
Activate the link-checker.
Pretty print.
Ugly print.
Avoid gcc extensions in the C output.
Don't delete temporary files.
Don't delete temporary C files.
Insert #line directives in generated C code. This slows down compilation, but helps debugging. Works best when also using -pp.
Disable all null and array bounds checks (still uses ``fat'' representation of ? pointers).
Disable null checks.
Disable array bounds checks (still uses ``fat'' representation of ? pointers).
Indicate which preprocessor to use.
Disable smart preprocessing (mac only).
Don't add the implicit namespace Cyc to variable names in the C output.
Don't remove externed variables that aren't used.
Don't expand typedefs in pretty printing.
Print all type variables (even implicit default effects).
Always print kinds of type variables.
Print full information for evars (type debugging).

F.2   The lexer generator

F.3   The parser generator

F.4   The allocation profiler, aprof

To get a profile of the allocation behavior of a Cyclone program, follow these steps:
  1. Compile the program with the flag -pa. The resulting executable will be compiled to record allocation behavior. It will also be linked with a version of the standard library that records its allocation behavior. (If you get the message, ``can't find internal compiler file libcyc_a.a,'' then ask your system administrator to install the special version of the library.)
  2. Execute the program as normal. As it executes, it will write to a file amon.out in the current working directory; if the file exists before execution, it will be overwritten.
  3. Run the program aprof. This will examine amon.out and print a report on the allocation behavior of the program.

Previous Contents Next