validation fixes
[oota-llvm.git] / docs / CommandGuide / llvmc.pod
index ecbfbfe26d076fc18366a3123582ca4b2935e837..e398a4eba802e503de604506515878cc44c74fa1 100644 (file)
@@ -2,7 +2,7 @@
 
 =head1 NAME
 
-llvmc - The LLVM Compiler Driver
+llvmc - The LLVM Compiler Driver (experimental)
 
 =head1 SYNOPSIS
 
@@ -10,29 +10,35 @@ B<llvmc> [I<options>] [I<filenames>...]
 
 =head1 DESCRIPTION
 
-The B<llvmc> command is a configurable driver for invoking other 
-LLVM (and non-LLVM) tools in order to compile, optimize and link software
-for multiple languages. For those familiar with the GNU Compiler 
-Collection's B<gcc> tool, it is very similar. This tool has the
-following main goals or purposes:
+B<llvmc> is a configurable driver for invoking other LLVM (and non-LLVM) tools
+in order to compile, optimize and link software for multiple languages. For
+those familiar with FSF's B<gcc> tool, it is very similar.  Please note that
+B<llvmc> is considered an experimental tool.  B<llvmc> has the following goals:
 
 =over
 
-=item * A Single point of access to the LLVM tool set.
+=item * provide a single point of access to the LLVM tool set,
 
-=item * Hide the complexities of the LLVM tools through a single interface.
+=item * hide the complexities of the LLVM tools through a single interface,
 
-=item * Make integration of existing non-LLVM tools simple.
+=item * make integration of existing non-LLVM tools simple,
 
-=item * Extend the capabilities of minimal front ends.
+=item * extend the capabilities of minimal front ends, and
 
-=item * Make the interface for compiling consistent for all languages.
+=item * make the interface for compiling consistent for all languages.
 
 =back
 
 The tool itself does nothing with a user's program. It merely invokes other
 tools to get the compilation tasks done.
 
+The options supported by B<llvmc> generalize the compilation process and
+provide a consistent and simple interface for multiple programming languages.
+This makes it easier for developers to get their software compiled with LLVM.
+Without B<llvmc>, developers would need to understand how to invoke the 
+front-end compiler, optimizer, assembler, and linker in order to compile their 
+programs. B<llvmc>'s sole mission is to trivialize that process.
+
 =head2 Basic Operation
 
 B<llvmc> always takes the following basic actions:
@@ -41,41 +47,44 @@ B<llvmc> always takes the following basic actions:
 
 =item * Command line options and filenames are collected.
 
-This provides the basic instruction to B<llvmc> on what actions it should
-take. This is the I<request> the user is making of B<llvmc>.
+The command line options provide the marching orders to B<llvmc> on what actions
+it should perform. This is the I<request> the user is making of B<llvmc> and it
+is interpreted first.
 
 =item * Configuration files are read.
 
-Based on the options and the suffixes of the filenames presented, a set
-of configuration files are read to configure the actions B<llvmc>
-will take (more on this later).
+Based on the options and the suffixes of the filenames presented, a set of 
+configuration files are read to configure the actions B<llvmc> will take. 
+Configuration files are provided by either LLVM or the front end compiler tools
+that B<llvmc> invokes. Users generally don't need to be concerned with the
+contents of the configuration files. 
 
 =item * Determine actions to take.
 
-The tool chain needed to complete the task is determined. This is the
-primary work of B<llvmc>. It breaks the request specified by the
-command line options into a set of basic actions to be done: 
-pre-processing, compilation, assembly, optimization, and linking.
-For each applicable action, it selects the command to be run from 
-the specifications in the configuration files.
+The tool chain needed to complete the task is determined. This is the primary 
+work of B<llvmc>. It breaks the request specified by the command line options 
+into a set of basic actions to be done: 
 
-=item * Execute actions.
+=over
 
-The actions determined previously are executed sequentially and then
-B<llvmc> terminates.
+=item * Pre-processing: gathering/filtering compiler input (optional).
+
+=item * Translation: source language to bytecode conversion.
+
+=item * Assembly: bytecode to native code conversion.
+
+=item * Optimization: conversion of bytecode to something that runs faster.
+
+=item * Linking: combining multiple bytecodes to produce executable program.
 
 =back
 
-=head2 Configuration Files
+=item * Execute actions.
 
-B<llvmc> is highly configurable both on the command line and in configuration
-files. Configuration files specify the details of what commands to run
-for a given action. Each front end compiler must provide its own 
-configuration file to tell B<llvmc> how to invoke that compiler. The LLVM
-toolset does not need to be configured as B<llvmc> just "knows" how to 
-invoke those tools. 
+The actions determined previously are executed sequentially and then
+B<llvmc> terminates.
 
-Rest TBD.
+=back
 
 =head1 OPTIONS
 
@@ -99,16 +108,16 @@ of compilation, optimization, and linking should be attempted.  Source files
 specified on the command line will be compiled and linked with objects and
 libraries also specified. 
 
-=item B<-S> or B<--assemble>
+=item B<-S>
 
 This option specifies that compilation should end in the creation of
 an LLVM assembly file that can be later converted to an LLVM object
 file.
 
-=item B<-E> or B<--preprocess>
+=item B<-E>
 
 This option specifies that no compilation or linking should be 
-performed. Only pre-processing, if applicabe to the language being
+performed. Only pre-processing, if applicable to the language being
 compiled, is performed. For languages that support it, this will
 result in the output containing the raw input to the compiler.
 
@@ -125,7 +134,7 @@ each source language will have different needs.
 
 =item B<-O1> or B<-O0> (default, fast compilation)
 
-Only those optimizations that will hasten the compilation (mostly by reducing 
+Only those optimizations that will hasten the compilation (mostly by reducing
 the output) are applied. In general these are extremely fast and simple 
 optimizations that reduce emitted code size. The goal here is not to make the 
 resulting program fast but to make the compilation fast.  If not specified, 
@@ -134,9 +143,9 @@ this is the default level of optimization.
 =item B<-O2> (basic optimization)
 
 This level of optimization specifies a balance between generating good code 
-that will execute reasonably quickly and not spending too much time optimizing 
+that will execute reasonably quickly and not spending too much time optimizing
 the code to get there. For example, this level of optimization may include 
-things like global common subexpression elimintation, aggressive dead code 
+things like global common subexpression elimination, aggressive dead code 
 elimination, and scalar replication.
 
 =item B<-O3> (aggressive optimization)
@@ -144,35 +153,35 @@ elimination, and scalar replication.
 This level of optimization aggressively optimizes each set of files compiled 
 together. However, no link-time inter-procedural optimization is performed.
 This level implies all the optimizations of the B<-O1> and B<-O2> optimization
-levels, and should also provide loop optimizatiosn and compile time 
+levels, and should also provide loop optimizations and compile time 
 inter-procedural optimizations. Essentially, this level tries to do as much
 as it can with the input it is given but doesn't do any link time IPO.
 
-=item B<-O4> (linktime optimization)
+=item B<-O4> (link time optimization)
 
 In addition to the previous three levels of optimization, this level of 
 optimization aggressively optimizes each program at link time. It employs
 basic analysis and basic link-time inter-procedural optimizations, 
 considering the program as a whole.
 
-=item B<-O5> (aggressive linktime optimization)
+=item B<-O5> (aggressive link time optimization)
 
 This is the same as B<-O4> except it employs aggressive analyses and
 aggressive inter-procedural optimization. 
 
-=item B<-O6> (profile guided optimization - not implemented)
+=item B<-O6> (profile guided optimization: not implemented)
 
-This is the same as B<-O5> except that it employes profile-guided
-reoptimization of the program after it has executed. Note that this implies
-a single level of reoptimization based on runtime profile analysis. Once
+This is the same as B<-O5> except that it employs profile-guided
+re-optimization of the program after it has executed. Note that this implies
+a single level of re-optimization based on runtime profile analysis. Once
 the re-optimization has completed, the profiling instrumentation is
 removed and final optimizations are employed.
 
-=item B<-O7> (lifelong optimization - not implemented)
+=item B<-O7> (lifelong optimization: not implemented)
 
-This is the same as B<-O5> and similar to B<-O6> except that reoptimization
+This is the same as B<-O5> and similar to B<-O6> except that re-optimization
 is performed through the life of the program. That is, each run will update
-the profile by which future reoptimizations are directed.
+the profile by which future re-optimizations are directed.
 
 =back
 
@@ -225,53 +234,11 @@ options.
 
 =back
 
-=head2 Configuration Options
-
-=over
-
-=item B<--show-config> I<[suffixes...]>
-
-When this option is given, the only action taken by B<llvmc> is to show its
-final configuration state in the form of a configuration file. No compilation
-tasks will be conducted when this option is given; processing will stop once
-the configuration has been printed. The optional (comma separated) list of 
-suffixes controls what is printed. Without any suffixes, the configuration
-for all languages is printed. With suffixes, only the languages pertaining
-to those file suffixes will be printed. The configuration information is
-printed after all command line options and configuration files have been
-read and processed. This allows the user to verify that the correct
-configuration data has been read by B<llvmc>.
-
-=item B<--config> :I<section>:I<name>=I<value>
-
-This option instructs B<llvmc> to accept I<value> as the value for configuration
-item I<name> in the section named I<section>. This is a quick way to override
-a configuration item on the command line without resorting to changing the
-configuration files. 
-
-=item B<--config-file> F<dirname>
-
-This option tells B<llvmc> to read configuration data from the I<directory>
-named F<dirname>. Data from such directories will be read in the order
-specified on the command line after all other standard config files have
-been read. This allows users or groups of users to conveniently create 
-their own configuration directories in addition to the standard ones to which 
-they may not have write access.
-
-=item B<--config-only-from> F<dirname>
-
-This option tells B<llvmc> to skip the normal processing of configuration
-files and only configure from the contents of the F<dirname> directory. Multiple
-B<--config-only-from> options may be given in which case the directories are
-read in the order given on the command line.
-
-=back
-
 =head2 Information Options
 
 =over
 
-=item B<-n> or B<--noop>
+=item B<-n> or B<--no-op>
 
 This option tells B<llvmc> to do everything but actually execute the
 resulting tools. In combination with the B<-v> option, this causes B<llvmc>
@@ -306,36 +273,107 @@ it to the standard error.
 
 =over
 
+=item B<-T,pre>=I<options>
 
-=item B<-Tool,opt>=I<options>
+Pass an arbitrary option to the pre-processor.
+
+=item B<-T,opt>=I<options>
 
 Pass an arbitrary option to the optimizer.
 
-=item B<-Tool,link>=I<options>
+=item B<-T,lnk>=I<options>
 
 Pass an arbitrary option to the linker.
 
-=item B<-Tool,asm>=I<options>
+=item B<-T,asm>=I<options>
 
-Pass an arbitrary optionsto the code generator.
+Pass an arbitrary option to the code generator.
 
 =back
 
-=head3 C/C++ Specific Options
+=head2 C/C++ Specific Options
 
 =over
 
-=item B<-I>F<path> (C/C++ Only)
+=item B<-I>F<path>
 
 This option is just passed through to a C or C++ front end compiler to tell it
 where include files can be found.
 
+=item B<-D>F<symbol>
+
+This option is just passed through to a C or C++ front end compiler to tell it
+to define a symbol.
+
+=back
+
+=head2 Miscellaneous Options
+
+=over
+
+=item B<--help>
+
+Print a summary of command line options.
+
+=item B<--version>
+
+This option will cause B<llvmc> to print out its version number and terminate.
+
 =back
 
 =head2 Advanced Options
 
+You better know what you're doing if you use these options. Improper use
+of these options can produce drastically wrong results.
+
 =over 
 
+=item B<--config-dir> F<dirname>
+
+This option tells B<llvmc> to read configuration data from the I<directory>
+named F<dirname>. Data from such directories will be read in the order
+specified on the command line after all other standard configuration files have
+been read. This allows users or groups of users to conveniently create 
+their own configuration directories in addition to the standard ones to which 
+they may not have write access.
+
+=back
+
+
+=head2 Unimplemented Options
+
+The options below are not currently implemented in B<llvmc> but will be
+eventually. They are documented here as "future design".
+
+=over
+
+=item B<--show-config> I<[suffixes...]>
+
+When this option is given, the only action taken by B<llvmc> is to show its
+final configuration state in the form of a configuration file. No compilation
+tasks will be conducted when this option is given; processing will stop once
+the configuration has been printed. The optional (comma separated) list of 
+suffixes controls what is printed. Without any suffixes, the configuration
+for all languages is printed. With suffixes, only the languages pertaining
+to those file suffixes will be printed. The configuration information is
+printed after all command line options and configuration files have been
+read and processed. This allows the user to verify that the correct
+configuration data has been read by B<llvmc>.
+
+=item B<--config> :I<section>:I<name>=I<value>
+
+This option instructs B<llvmc> to accept I<value> as the value for configuration
+item I<name> in the section named I<section>. This is a quick way to override
+a configuration item on the command line without resorting to changing the
+configuration files. 
+
+=item B<--config-only-from> F<dirname>
+
+This option tells B<llvmc> to skip the normal processing of configuration
+files and only configure from the contents of the F<dirname> directory. Multiple
+B<--config-only-from> options may be given in which case the directories are
+read in the order given on the command line.
+
 =item B<--emit-raw-code>
 
 No optimization is done whatsoever. The compilers invoked by B<llvmc> with 
@@ -348,36 +386,46 @@ the full raw code produced by the compiler will be generated.
 
 =back
 
-=head2 Miscellaneous Options
+
+=head1 EXIT STATUS
+
+If B<llvmc> succeeds, it will exit with 0.  Otherwise, if an error
+occurs, it will exit with a non-zero value and no compilation actions
+will be taken. If one of the compilation tools returns a non-zero 
+status, pending actions will be discarded and B<llvmc> will return the
+same result code as the failing compilation tool.
+
+=head1 DEFICIENCIES
+
+B<llvmc> is considered an experimental LLVM tool because it has these
+deficiencies: 
 
 =over
 
-=item B<--help>
+=item Insufficient support for native linking
 
-Print a summary of command line options.
+Because B<llvm-ld> doesn't handle native linking, neither can B<llvmc>
 
-=item B<-V> or B<--version>
+=item Poor configuration support
 
-This option will cause B<llvmc> to print out its version number
-and terminate.
+The support for configuring new languages, etc. is weak. There are many
+command line configurations that cannot be achieved with the current
+support. Furthermore the grammar is cumbersome for configuration files.
+Please see L<http://llvm.org/PR686> for further details.
 
-=back
+=item Does not handle target specific configurations
 
-=head1 EXIT STATUS
+This is one of the major deficiencies, also addressed in 
+L<http://llvm.org/PR686>
 
-If B<llvmc> succeeds, it will exit with 0.  Otherwise, if an error
-occurs, it will exit with a non-zero value and no compilation actions
-will be taken. If one of the compilation tools returns a non-zero 
-status, pending actions will be discarded and B<llvmc> will return the
-same result code as the failing compilation tool.
+=back
 
 =head1 SEE ALSO
 
-L<gccas|gccas>, L<gccld|gccld>, L<llvm-as|llvm-as>, L<llvm-dis|llvm-dis>, 
-L<llc|llc>, L<llvm-link|llvm-link>
+L<llvm-as|llvm-as>, L<llvm-dis|llvm-dis>, L<llc|llc>, L<llvm-link|llvm-link>
 
 =head1 AUTHORS
 
-Reid Spencer
+Maintained by the LLVM Team (L<http://llvm.org>).
 
 =cut