Next: , Up: Implementation   [Contents]


4.1 Invoking tc

Synopsis:

tc optionfile

where file can be ‘-’, denoting the standard input.

Global options are:

-?
--help

Display the help message, and exit successfully.

--version

Display the version, and exit successfully.

--task-list

List the registered tasks.

--task-selection

Report the order in which the tasks will be run.


The options related to the file library (TC-1) are:

-p
--library-prepend

Prepend a directory to include path.

-P
--library-append

Append a directory to include path.

--library-display

Report the include search path.


The options related to scanning and parsing (TC-1) are:

--scan-trace

Enable Flex scanners traces.

--parse-trace

Enable Bison parsers traces.

--parse

Parse the file given as argument (objects forbidden).

--prelude=prelude

Load the definitions of the file prelude before the actual argument. The result is equivalent to parsing:

let
  import "prelude"
in
  /* The argument file. */
end

To disable any prelude file, use no-prelude. The default value is builtin, denoting the builtin prelude.

-X
--no-prelude

Don’t include prelude.


The options related to the AST (TC-2) are:

-o
--object

Enable object constructs of the language (class and method declarations, object creation, method calls, etc.).

--object-parse

Same as --object --parse, i.e. parse the file given as argument, allowing objects.

-A
--ast-display

Display the AST.

-D
--ast-delete

Reclaim the memory allocated for the AST.


The options related to escapes computation (TC-3) are:

--bound

Make sure bindings (regular or taking overloading or objects constructs into account) are computed.

-b
--bindings-compute

Bind the name uses to their definitions (objects forbidden).

-B
--bindings-display

Enable the bindings display in the next --ast-display invocation. This option does not imply --bindings-compute.

--object-bindings-compute

Bind the name uses to their definitions, allowing objects. consistency.


The options related to the renaming to unique identifiers (TC-R) are:

--rename

Rename identifiers (objects forbidden).


The options related to escapes computation (TC-E) are:

-e
--escapes-compute

Compute the escapes.

-E
--escapes-display

Enable the escape display. This option does not imply --escapes-compute, so that it is possible to check that the defaults (everybody escapes) are properly implemented. Pass -A afterward to see its result.


The options related to type checking (TC-4) are:

-T
--typed

Make sure types (regular or taking overloading or objects constructs into account) are computed.

--types-compute

Compute and check (regular) types (objects forbidden).

--object-types-compute

Compute and check (regular) types, allowing objects.


The options related to desugaring (TC-D) are:

--desugar-for

Enable the translation of for loops into while loops.

--desugar-string-cmp

Enable the desugaring of string comparisons.

--desugared

Make sure syntactic sugar (regular or taking overloading into account) has been removed from the AST.

--desugar

Remove syntactic sugar from the AST. Desired translations must be enabled beforehand (e.g. with --desugar-for or --desugar-string-cmp).

--overfun-desugar

Like --desugar but with support for overloaded functions (see TC-A).


The options related to the inlining optimization (TC-I) are:

--inline

Inline bodies of (non overloaded) functions at call sites.

--overfun-inline

Inline bodies of functions (overloaded or not) at call sites.

--prune

Remove unused (non overloaded) functions.

--overfun-prune

Remove unused functions (overloaded or not).


The options related to the bounds checking instrumentation (TC-B) are:

--bounds-checks-add

Add dynamic bounds checks.

--overfun-bounds-checks-add

Add dynamic bounds checks, with support for overloading.


The options related to overloading support (TC-A) are:

--overfun-bindings-compute

Binding variables, types, and breaks as usual, by bind function calls to the set of function definitions baring the same name.

-O
--overfun-types-compute

Type-check and resolve (bind) overloaded function calls. Implies --overfun-bindings-compute.


The options related to the desugaring of object constructs (TC-O) are:

--object-desugar

Translate object constructs from the program into their non object counterparts, i.e., transform a Tiger program into a Panther one.


The options related to the high level intermediate representation (TC-5) are:

--hir-compute

Translate to HIR (objects forbidden). Implies --typed.

-H
--hir-display

Display the high level intermediate representation. Implies --hir-compute.


The options related to the LLVM IR translation (TC-L) are:

--llvm-compute

Translate to LLVM IR.

--llvm-runtime-display

Enable runtime displaying along with the LLVM IR.

--llvm-display

Display the LLVM IR.


The options related to the low level intermediate representation (TC-6) are:

--canon-trace

Trace the canonicalization of HIR to LIR.

--canon-compute

Canonicalize the LIR fragments.

-C
--canon-display

Display the canonicalized intermediate representation before basic blocks and traces computation. Implies --lir-compute. It is convenient to determine whether a failure is due to canonicalization, or traces.

--traces-trace

Trace the basic blocks and traces canonicalization of HIR to LIR.

--traces-compute

Compute the basic blocks from canonicalized HIR fragments. Implies --canon-compute.

--lir-compute

Translate to LIR. Implies --traces-compute. Actually, it is nothing but a nice looking alias for the latter.

-L
--lir-display

Display the low level intermediate representation. Implies --lir-compute.


The options related to the instruction selection (TC-7) are:

--inst-compute

Convert from LIR to pseudo assembly with temporaries. Implies --lir-compute.

-I
--inst-display

Display the pseudo assembly, (without the runtime prologue). Implies --inst-compute.

-R
--runtime-display

Display the assembly runtime prologue for the current target.


The options related to the liveness information (TC-8) are:

-F
--flowgraphs-dump

Save each function flow graph in a Graphviz file. Implies --inst-compute.

-V
--liveness-dump

Save each function flow graph enriched with liveness information in a Graphviz file. Implies --inst-compute.

-N
--interference-dump

Save each function interference graph in a Graphviz file. Implies --inst-compute.


The options related to the target are:

--callee-save=num
--caller-save=num

Set the maximum number of callee/caller save registers to num, a positive number. Note that (currently) this does not reset the current target, hence to actually change the behavior, one needs ‘--callee-save=0 --target-mips’.

--target-mips

Set the target to Mips.

--target-ia32

This optional flag sets the target to IA-32.

--target-default

If no target is selected, select Mips. This option is triggered by all the options that need a target.

--target-display

Report information about the current target.


The options related to the register allocation are:

--asm-coalesce-disable

Disable coalescence.

--asm-trace

Trace register allocation.

-s
--asm-compute

Allocate the registers.

-S
--asm-display

Display the final assembler, runtime included.


Next: , Up: Implementation   [Contents]