+ <dt><tt>llvm/lib/ByteCode/</tt><dd> This directory holds code for reading
+ and write LLVM bytecode.
+
+ <dt><tt>llvm/lib/CWriter/</tt><dd> This directory implements the LLVM to C
+ converter.
+
+ <dt><tt>llvm/lib/Analysis/</tt><dd> This directory contains a variety of
+ different program analyses, such as Dominator Information, Call Graphs,
+ Induction Variables, Interval Identification, Natural Loop Identification,
+ etc...
+
+ <dt><tt>llvm/lib/Transforms/</tt><dd> This directory contains the source
+ code for the LLVM to LLVM program transformations, such as Aggressive Dead
+ Code Elimination, Sparse Conditional Constant Propagation, Inlining, Loop
+ Invariant Code Motion, Dead Global Elimination, and many others...
+
+ <dt><tt>llvm/lib/Target/</tt><dd> This directory contains files that
+ describe various target architectures for code generation. For example,
+ the llvm/lib/Target/SparcV9 directory holds the Sparc machine
+ description.<br>
+
+ <dt><tt>llvm/lib/CodeGen/</tt><dd> This directory contains the major parts
+ of the code generator: Instruction Selector, Instruction Scheduling, and
+ Register Allocation.
+
+ <dt><tt>llvm/lib/Support/</tt><dd> This directory contains the source code
+ that corresponds to the header files located in
+ <tt>llvm/include/Support/</tt>.
+</dl>
+
+</div>
+
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+ <a name="runtime"><tt>llvm/runtime</tt></a>
+</div>
+
+<div class="doc_text">
+
+<p>This directory contains libraries which are compiled into LLVM bytecode and
+used when linking programs with the GCC front end. Most of these libraries are
+skeleton versions of real libraries; for example, libc is a stripped down
+version of glibc.</p>
+
+<p>Unlike the rest of the LLVM suite, this directory needs the LLVM GCC front
+end to compile.</p>
+
+</div>
+
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+ <a name="test"><tt>llvm/test</tt></a>
+</div>
+
+<div class="doc_text">
+
+<p>This directory contains regression tests and source code that is used to test
+the LLVM infrastructure.</p>
+
+</div>
+
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+ <a name="tools"><tt>llvm/tools</tt></a>
+</div>
+
+<div class="doc_text">
+
+<p>The <b>tools</b> directory contains the executables built out of the
+libraries above, which form the main part of the user interface. You can
+always get help for a tool by typing <tt>tool_name --help</tt>. The
+following is a brief introduction to the most important tools:</p>
+
+<dl>
+ <dt><tt><b>analyze</b></tt> <dd><tt>analyze</tt> is used to run a specific
+ analysis on an input LLVM bytecode file and print out the results. It is
+ primarily useful for debugging analyses, or familiarizing yourself with
+ what an analysis does.<p>
+
+ <dt><tt><b>bugpoint</b></tt> <dd><tt>bugpoint</tt> is used to debug
+ optimization passes or code generation backends by narrowing down the
+ given test case to the minimum number of passes and/or instructions that
+ still cause a problem, whether it is a crash or miscompilation. See <a
+ href="HowToSubmitABug.html">HowToSubmitABug.html</a> for more information
+ on using <tt>bugpoint</tt>.<p>
+
+ <dt><tt><b>llvm-ar</b></tt> <dd>The archiver produces an archive containing
+ the given LLVM bytecode files, optionally with an index for faster
+ lookup.<p>
+
+ <dt><tt><b>llvm-as</b></tt> <dd>The assembler transforms the human readable
+ LLVM assembly to LLVM bytecode.<p>
+
+ <dt><tt><b>llvm-dis</b></tt><dd>The disassembler transforms the LLVM
+ bytecode to human readable LLVM assembly.<p>
+
+ <dt><tt><b>llvm-link</b></tt><dd> <tt>llvm-link</tt>, not surprisingly,
+ links multiple LLVM modules into a single program.<p>
+
+ <dt><tt><b>lli</b></tt><dd> <tt>lli</tt> is the LLVM interpreter, which
+ can directly execute LLVM bytecode (although very slowly...). In addition
+ to a simple interpreter, <tt>lli</tt> also has a tracing mode (entered by
+ specifying <tt>-trace</tt> on the command line). Finally, for
+ architectures that support it (currently only x86 and Sparc), by default,
+ <tt>lli</tt> will function as a Just-In-Time compiler (if the
+ functionality was compiled in), and will execute the code <i>much</i>
+ faster than the interpreter.<p>
+
+ <dt><tt><b>llc</b></tt><dd> <tt>llc</tt> is the LLVM backend compiler, which
+ translates LLVM bytecode to a SPARC or x86 assembly file, or to C code (with
+ the -march=c option).<p>
+
+ <dt><tt><b>llvmgcc</b></tt><dd> <tt>llvmgcc</tt> is a GCC-based C frontend
+ that has been retargeted to emit LLVM code as the machine code output. It
+ works just like any other GCC compiler, taking the typical <tt>-c, -S, -E,
+ -o</tt> options that are typically used. The source code for the
+ <tt>llvmgcc</tt> tool is currently not included in the LLVM CVS tree
+ because it is quite large and not very interesting.<p>
+
+ <blockquote>
+ <dl>
+ <dt><tt><b>gccas</b></tt> <dd>This tool is invoked by the
+ <tt>llvmgcc</tt> frontend as the "assembler" part of the compiler. This
+ tool actually assembles LLVM assembly to LLVM bytecode,
+ performs a variety of optimizations, and outputs LLVM bytecode. Thus
+ when you invoke <tt>llvmgcc -c x.c -o x.o</tt>, you are causing
+ <tt>gccas</tt> to be run, which writes the <tt>x.o</tt> file (which is
+ an LLVM bytecode file that can be disassembled or manipulated just like
+ any other bytecode file). The command line interface to <tt>gccas</tt>
+ is designed to be as close as possible to the <b>system</b>
+ `<tt>as</tt>' utility so that the gcc frontend itself did not have to be
+ modified to interface to a "weird" assembler.<p>
+
+ <dt><tt><b>gccld</b></tt> <dd><tt>gccld</tt> links together several LLVM
+ bytecode files into one bytecode file and does some optimization. It is
+ the linker invoked by the GCC frontend when multiple .o files need to be
+ linked together. Like <tt>gccas</tt>, the command line interface of
+ <tt>gccld</tt> is designed to match the system linker, to aid
+ interfacing with the GCC frontend.</dl><p>
+ </blockquote>
+
+ <dt><tt><b>opt</b></tt><dd> <tt>opt</tt> reads LLVM bytecode, applies a
+ series of LLVM to LLVM transformations (which are specified on the command
+ line), and then outputs the resultant bytecode. The '<tt>opt --help</tt>'
+ command is a good way to get a list of the program transformations
+ available in LLVM.
+
+</dl>
+
+</div>
+
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+ <a name="utils"><tt>llvm/utils</tt></a>
+</div>
+
+<div class="doc_text">
+
+<p>This directory contains utilities for working with LLVM source code, and some
+of the utilities are actually required as part of the build process because they
+are code generators for parts of LLVM infrastructure.</p>
+
+<dl>
+ <dt><tt><b>Burg/</b></tt> <dd><tt>Burg</tt> is an instruction selector
+ generator -- it builds trees on which it then performs pattern-matching to
+ select instructions according to the patterns the user has specified. Burg
+ is currently used in the Sparc V9 backend.<p>
+
+ <dt><tt><b>codegen-diff</b></tt> <dd><tt>codegen-diff</tt> is a script
+ that finds differences between code that LLC generates and code that LLI
+ generates. This is a useful tool if you are debugging one of them,
+ assuming that the other generates correct output. For the full user
+ manual, run <tt>`perldoc codegen-diff'</tt>.<p>
+
+ <dt><tt><b>cvsupdate</b></tt> <dd><tt>cvsupdate</tt> is a script that will
+ update your CVS tree, but produce a much cleaner and more organized output
+ than simply running <tt>`cvs -z3 up -dP'</tt> will. For example, it will group
+ together all the new and updated files and modified files in separate
+ sections, so you can see at a glance what has changed. If you are at the
+ top of your LLVM CVS tree, running <tt>utils/cvsupdate</tt> is the
+ preferred way of updating the tree.<p>
+
+ <dt><tt><b>emacs/</b></tt> <dd>The <tt>emacs</tt> directory contains
+ syntax-highlighting files which will work with Emacs and XEmacs editors,
+ providing syntax highlighting support for LLVM assembly files and TableGen
+ description files. For information on how to use the syntax files, consult
+ the <tt>README</tt> file in that directory.<p>
+
+ <dt><tt><b>getsrcs.sh</b></tt> <dd>The <tt>getsrcs.sh</tt> script finds
+ and outputs all non-generated source files, which is useful if one wishes
+ to do a lot of development across directories and does not want to
+ individually find each file. One way to use it is to run, for example:
+ <tt>xemacs `utils/getsources.sh`</tt> from the top of your LLVM source
+ tree.<p>
+
+ <dt><tt><b>makellvm</b></tt> <dd>The <tt>makellvm</tt> script compiles all
+ files in the current directory and then compiles and links the tool that
+ is the first argument. For example, assuming you are in the directory
+ <tt>llvm/lib/Target/Sparc</tt>, if <tt>makellvm</tt> is in your path,
+ simply running <tt>makellvm llc</tt> will make a build of the current
+ directory, switch to directory <tt>llvm/tools/llc</tt> and build it,
+ causing a re-linking of LLC.<p>
+
+ <dt><tt><b>NightlyTest.pl</b></tt> and
+ <tt><b>NightlyTestTemplate.html</b></tt> <dd>These files are used in a
+ cron script to generate nightly status reports of the functionality of
+ tools, and the results can be seen by following the appropriate link on
+ the <a href="http://llvm.cs.uiuc.edu/">LLVM homepage</a>.<p>
+
+ <dt><tt><b>TableGen/</b></tt> <dd>The <tt>TableGen</tt> directory contains
+ the tool used to generate register descriptions, instruction set
+ descriptions, and even assemblers from common TableGen description
+ files.<p>
+
+ <dt><tt><b>vim/</b></tt> <dd>The <tt>vim</tt> directory contains
+ syntax-highlighting files which will work with the VIM editor, providing
+ syntax highlighting support for LLVM assembly files and TableGen
+ description files. For information on how to use the syntax files, consult
+ the <tt>README</tt> file in that directory.<p>
+
+</dl>
+
+</div>
+
+<!-- *********************************************************************** -->
+<div class="doc_section">
+ <a name="tutorial">An Example Using the LLVM Tool Chain</a>
+</div>
+<!-- *********************************************************************** -->
+
+<div class="doc_text">
+
+<ol>
+ <li>First, create a simple C file, name it 'hello.c':