X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FCompilerDriver.html;h=c73723efd08b83e6e68053b56406e93c6cb942b1;hb=e644ef7b098460ce831220c780cbe25eaef3fb28;hp=16e777cc3de19107dc0895af2208c5cfc524e48b;hpb=46d21926baafae4c0a8b9f51bae45e61758c56f1;p=oota-llvm.git diff --git a/docs/CompilerDriver.html b/docs/CompilerDriver.html index 16e777cc3de..c73723efd08 100644 --- a/docs/CompilerDriver.html +++ b/docs/CompilerDriver.html @@ -54,9 +54,9 @@
Introduction
-

The llvmc tool is a configurable compiler - driver. As such, it isn't the compiler, optimizer, - or linker itself but it drives (invokes) other software that perform those +

The llvmc tool is a configurable compiler + driver. As such, it isn't a compiler, optimizer, + or a linker itself but it drives (invokes) other software that perform those tasks. If you are familiar with the GNU Compiler Collection's gcc tool, llvmc is very similar.

The following introductory sections will help you understand why this tool @@ -138,9 +138,9 @@ llvmc -O2 x.c y.c z.c -o xyz

must produce exactly the same results as:


-    llvmc -O2 x.c
-    llvmc -O2 y.c
-    llvmc -O2 z.c
+    llvmc -O2 x.c -o x.o
+    llvmc -O2 y.c -o y.o
+    llvmc -O2 z.c -o z.o
     llvmc -O2 x.o y.o z.o -o xyz

To accomplish this, llvmc uses a very simple goal oriented procedure to do its work. The overall goal is to produce a functioning @@ -176,7 +176,7 @@ program.

The following table shows the inputs, outputs, and command line options - applicabe to each phase.

+ applicable to each phase.

@@ -336,6 +336,8 @@ optimization.

and linker. Note that a given source language needn't provide all these tools as many of them exist in llvm currently.

+ +
Directory Search

llvmc always looks for files of a specific name. It uses the @@ -446,6 +448,16 @@ optimization.

+ + + + + + + @@ -520,7 +532,7 @@ optimization.

- + @@ -533,24 +545,6 @@ optimization.

whenever the final phase is not pre-processing. - - - - - - - - - - - - @@ -562,9 +556,9 @@ optimization.

- + + optimizer generates. Valid values are "assembly" and "bytecode" @@ -583,16 +577,6 @@ optimization.

whenever the final phase is optimization or later. - - - - - - @@ -602,36 +586,6 @@ optimization.

input file and %out% for the output file. - - - - - - - - - - - - - - - - - - -
Phase Description Default

LLVMC ITEMS

versionstringProvides the version string for the contents of this + configuration file. What is accepted as a legal configuration file + will change over time and this item tells llvmc which version + should be expected.b

LANG ITEMS

lang.name
translator.outputnative, bytecode or assemblybytecode or assembly This item specifies the kind of output the language's translator generates. bytecode false
translator.optimizesbooleanIndicates that the translator also optimizes. If - this is true, then llvmc will skip the optimization phase - whenever the final phase is optimization or later.false
translator.groks_dash_obooleanIndicates that the translator understands the - intent of the various -On options to - llvmc. This will cause the -On option to be - given to the translator instead of the equivalent options provided by - lang.optn.false

OPTIMIZER ITEMS

optimizer.command
optimizer.outputnative, bytecode or assemblybytecode or assembly This item specifies the kind of output the language's - optimizer generates. bytecode
false
optimizer.groks_dash_obooleanIndicates that the translator understands the - intent of the various -On options to - llvmc. This will cause the -On option to be - given to the translator instead of the equivalent options provided by - lang.optn.false

ASSEMBLER ITEMS

assembler.command <blank>

LINKER ITEMS

linker.libslibrary namesThis provides the list of runtime libraries that the - source language could link with. In general, the libraries - needed will be encoded into the LLVM Assembly or bytecode file. - However, this list tells llvmc the names of the ones that - apply to this source language. The names provided here should be - unadorned with no suffix and no "lib" prefix. - <blank>
linker.lib_pathsFully qualifed local path namesThis item provides a list of potential directories - in which the source language's runtime libraries might be located. If - a given object file compiled with this language's translator is linked - then those libraries will be given as -L options to the - linker.<blank>
linker.outputnative, bytecode or assemblyThis item specifies the kind of output the language's - translator generates.bytecode
@@ -639,12 +593,12 @@ optimization.

Substitutions
-

On any configruation item that ends in command, you must +

On any configuration item that ends in command, you must specify substitution tokens. Substitution tokens begin and end with a percent sign (%) and are replaced by the corresponding text. Any substitution token may be given on any command line but some are more useful than others. In particular each command should have both an %in% - and an %out% substittution. The table below provides definitions of + and an %out% substitution. The table below provides definitions of each of the allowed substitution tokens.

@@ -661,6 +615,13 @@ optimization.

then you are explicitly disallowing the -T option for your tool. + + + +
%force%Replaced with the -f option if it was + specified on the llvmc command line. This is intended to tell + the compiler tool to force the overwrite of output files. +
%in% Replaced with the full path of the input file. You @@ -753,7 +714,7 @@ optimization.

# To compile stacker source, we just run the stacker # compiler with a default stack size of 2048 entries. translator.command=stkrc -s 2048 %in% -o %out% %time% \ - %stats% %args% + %stats% %force% %args% # stkrc doesn't preprocess but we set this to true so # that we don't run the cp command by default. @@ -762,11 +723,8 @@ optimization.

# The translator is required to run. translator.required=true - # stkrc doesn't do any optimization, it just translates - translator.optimizes=no - # stkrc doesn't handle the -On options - translator.groks_dash_O=no + translator.output=bytecode ########################################################## # Optimizer definitions @@ -774,10 +732,9 @@ optimization.

# For optimization, we use the LLVM "opt" program optimizer.command=opt %in% -o %out% %opt% %time% %stats% \ - %args% + %force% %args% - # opt doesn't (yet) grok -On - optimizer.groks_dash_O=no + optimizer.required = true # opt doesn't translate optimizer.translates = no @@ -785,19 +742,15 @@ optimization.

# opt doesn't preprocess optimizer.preprocesses=no -########################################################## -# Assembler definitions -########################################################## - assembler.command=llc %in% -o %out% %target% \ - "-regalloc=linearscan" %time% %stats% + # opt produces bytecode + optimizer.output = bc ########################################################## -# Linker definitions +# Assembler definitions ########################################################## - linker.libs=stkr_runtime - linker.paths= + assembler.command=llc %in% -o %out% %target% %time% %stats% - + @@ -861,7 +814,7 @@ optimization.

href="http://validator.w3.org/check/referer">Valid HTML 4.01!Reid Spencer
-The LLVM Compiler Infrastructure
+The LLVM Compiler Infrastructure
Last modified: $Date$