Below are the command-line flags for tc, the core Titanium compiler - these are the legal options that can be supplied as follows: tcbuild --tc-flags "{whatever}" Some of the options duplicate tcbuild options, but many provide access to additional functionality - be aware that some of the options may not be fully supported or may lead to unexpected behavior. The command-line flags to tcbuild are documented in tcbuild --help General ------- -E preprocess only, and dump result to stdout -Dkey[=value] define a preprocessor symbol Following preprocessor symbols are defined automatically: key value __TITANIUMC__ __TITANIUMC_MINOR__ __FILE__, __LINE__, __DATE__, __TIME__ (same as for ISO C99) -Ukey undefine a preprocessor symbol -parse run the Titanium parsing phase only, then exit (don't generate code) -fonly run the Titanium frontend and static checking phases only, then exit (don't generate code) -woff msgname1[,msgname2,...] -won msgname1[,msgname2,...] disable or re-enable the output of specific warnings given by name -info output version and configuration info and exit -java -ti enforce Java (Titanium) syntax while parsing -g or -g1 -g0 generate (don't generate) debugging information -line -noline generate (don't generate) line directives corresponding to the Titanium source files -libs -nolibs generate (don't generate) code for the entire tlib (the java/titanium standard libraries) -main -nomain we are (aren't) compiling a titanium application with a main method -mainclass classname fully qualified classname containing the main method the exectuable should use (defaults to a unique matching main method in user-provided classes) -max-errors max number of errors to report before giving up (defaults to 100) -outdir generate files into the directory specified by -tlib-include-dir use pre-generated headers from -sequential-consistency impose a sequentially consistent memory model upon the Titanium application -sizeof where is one of: "jint=64", "jint=32", "jchar=32", "jchar=16", "jshort=32", "jshort=16" used by tcbuild to support various platforms with non-standard type widths -inheritance-depth maximum permissable depth of class/interface inheritance tree -template-depth maximum permissable depth for Titanium template instantiations -template-instantiations maximum permissable number of instantiations of a Titanium template -sharing-early / -sharing-late use early or late enforcement when type checking sharing qualifiers -parallelize pay attention to "parallel" marking on foreach loops -noparallelize compile "parallel" foreach loops just like regular foreach loops -tcbuild disable warning about using tcbuild rather than tc directly -classlib=path:path:path pass a classlib path to search for java files, overriding CLASSLIB environment variable -- end of tc arguments Analyses and inferences ----------------------- -AA -noAA enable (disable) alias analysis -infer-sglobal/-noinfer-sglobal enable sglobal ("single" method) inference required for correct tlib compilation Optimization ------------ -O or -O1 -O0 enable (disable) all optimizations -pi -po -poverbose +++ ... --- There can be any number of occurences of "-pi "; there can only be one +++ ... --- section. All the above are processed left to right. The rightmost -po argument, if any, specifies the output filename for parameters. The -pi arguments specify files to read for parameters. The +++ ... --- section specifies parameters on the command line. The -poverbose flag specifies barebones (0) up to hefty (2) verbosity in the output file. Default verbosity is 1. Use -po /dev/null to suppress all parameter output. Or don't use tc features, such as Stoptifu, that rely on a parameter file. -OSR/-OnoSR strength reduction (on foreach loops & Titanium arrays) -OOSR/-OnoOSR offset strength reduction (on foreach loops & Titanium arrays) -OUSI/-OnoUSI unit-stride inference (on foreach loops & Titanium arrays) -OUAE/-OnoUAE useless assignment elimination -Odeadvar/-Onodeadvar dead local variable elimination -Ounreachable/-Onounreachable unreachable code elimination -Ocopy/-Onocopy copy propagation & constant folding -Ofoldextra/-Onofoldextra more aggressive constant folding (eg non-static final fields) -Osubexpr/-Onosubexpr common subexpression elimination -Olift/-Onolift loop invariant expression lifting (on foreach loops) -Oinline1/-Oinline2/-Onoinline method inlining (1=manual, 2=automatic) -Oinline-maxdepth max depth of inlining operations pulling into a single method body, or zero for unlimited (warning: may lead to non-termination of inliner) -ODME dead method elimination - currently only works when inline2 enabled, may be unsafe in some programs -Onofor do not convert for/do/while to foreach -Ofor1 convert some for/do/while loops that contain a grid access to foreach -Ofor2 convert some for/do/while loops to foreach -Ofinalize/-Onofinalize assume that all potential subclasses are currently visible when compiling main -Olocal/-Onolocal use local qualification inference (LQI) -Onew-dom/-Ononew-dom use alternative (faster, more conservative) dominator calculation -Osharing/-Onosharing use sharing qualification inference -OStoptifu/-OnoStoptifu use the Stoptifu library to tile and fuse loops -OStoptifu-rr when using the Stoptifu library, allow at most N live temporary variables from the "read from register" optimization at any program point -OmaybeStoptifu-rr when using the Stoptifu library, look in parameter file for info on "read from register" opts -OStoptifu-min-size when using the Stoptifu library, add a runtime check that requires all loops involved in a tiling to have domain size >= N (else revert to non-tiled code) -OmaybeStoptifu-min-size when using the Stoptifu library, look in parameter file for min size -O[no|maybe]Stoptifu-aa when using the Stoptifu library, enable (or disable, or look in parameter file to decide whether to enable) tiles of any shape -O[no|maybe]Stoptifu-ci when using the Stoptifu library, force (or don't, or look in parameter file to decide about) coarse interleaving of nodes from different loops -OStoptifu-fu/-OnoStoptifu-fu enable/disable loop fusion -OStoptifu-ts/-OnoStoptifu-ts when using the Stoptifu library, enable shrinking of temporary arrays -OStoptifu-usib/-OnoStoptifu-usib when using the Stoptifu library, enable use of scalars in bundles to hold values that otherwise would have been written and read from memory multiple times -OStoptifu-mv/-OnoStoptifu-mv when using the Stoptifu library, enable megatile verification (safe) or skip it (potentially unsafe, but speeds compilation) -O[no]Stoptifu-greenlight when using the Stoptifu library, enable (disable) code that assumes most Stoptifu should proceed automatically without consulting the parameter file enable (disable) various specific optimizations. Note that some optimizations require other optimizations. -free-methods -no-free-methods free method body subtrees in the AST after they've been code-generated, to reduce memory usage of the titanium compiler (enabled by default) -no-gc disable garbage collection within the compiler itself; only available if the compiler was initially configured with "--enable-tc-gc" -gc-find-leaks report leaked memory but do not actually collect it as garbage; only available if the compiler was initially configured with "--enable-tc-gc" -bc -nobc enable (disable) bounds checking - users should use the corresponding tcbuild bounds-checking control flags -goto -nogoto use (don't use) C goto statements when generating code for Titanium foreach loops (the alternative is a do/while loop) -trivialSizeCheck -notrivialSizeCheck insert (don't insert) a runtime test to speed up foreach loops that iterate over a trivially small domain (disabled by default) Debugging tc and monitoring compilation --------------------------------------- -verbose0 -verbose or -verbose1 -verbose2 -verbose3 -verbose4 enable "reasonable" verbose output to report the high-level progress of the tc compilation process verbose1 reports the beginning of each major compilation phase verbose2 reports file-level progress within each phase verbose3 reports sub-file-level progress within each phase verbose4 reports even more detailed progress within some phases for more detailed information about a particular phase, see the other debugging options below -debug enable debugging for the tc process to report various front-end activities -debugopt enable debugging output for the optimization phase (currently does nothing) -debugdefs enable debugging output for the def-use analysis -debug-instantiation enable debugging output for Titanium template instantiation -debug-postpone enable debugging output for postponement of TreeNode name resolution -debug-qual enable debugging output for qualification inference (LQI/SQI) -stats output statistics about the effects of foreach loop optimizations -callstats include bookkeeping code to output dynamic call frequency information (note this may cause a notable performance degradation to the application) -Stoptifustats (or -Stoptifustats1) output statistics about the effects of Stoptifu -Stoptifustats2 output detailed statistics about the effects of Stoptifu -srtest generate code to verify the foreach strength reduction optimizations at runtime (this will degrade performance but should have no other noticeable effects) -dumpast "file list..." -dumpphase "phase list" dump the abstract syntax tree and various info for the selected files at given phases If -dumpphase is not given, the action will be performed provided the current filename matches. If -dumpast is the string "all", all files will have the action performed provided the current phase name matches. If -dumpphase is given but -dumpast is not given then -dumpast defaults to "all". So on the tc command line, you can say things like: tc -dumpast all (all dumps) tc -dumpast all -dumpphase cfg (CFG info for all files) tc -dumpphase cfg (CFG info for all files) tc -dumpast foo.ti (all dumps for foo.ti) tc -dumpast foo.ti -dumpphase "cfg lowered" (dump out CFG and lowered AST) Some recognized phases: "ord" OrderlySet operations??? "MIVE" Map Induction Variables to Expressions analysis "usedef" use-def analysis "aa"/"aaSuper" alias analysis "sef" side-effect free analysis "dom"/"domv" dominator analysis "load" immediately after loading and template instantiation "typecheck" immediately after typechecking "rewrite" result of rewriting phase "widened" result of widening phase "lowered" result of lowering phase "opt" general optimization info "cfg" dump cfg whenever we build one "bc","sr","osr","uae","deadvar","unreachable","copy","subexpr","invar","loopanal","lift","inlinetrans","inline2","inlinestats","stoptifu","upbs" various optimization phases "shared" AST subtree sharing detection "free" tc's AST subtree freeing operations