diff --git a/docs/CompilerDriver.html b/docs/CompilerDriver.html index 7a256b3bf4b..ccb45358db6 100644 --- a/docs/CompilerDriver.html +++ b/docs/CompilerDriver.html @@ -5,20 +5,41 @@ Customizing LLVMC: Reference Manual -

Customizing LLVMC: Reference Manual

- --- - - - -
Author:Mikhail Glushenkov <foldr@codedegers.com>
+
+

Contents

+ +
+
+

Written by Mikhail Glushenkov

+
+

Introduction

LLVMC is a generic compiler driver, designed to be customizable and extensible. It plays the same role for LLVM as the gcc program does for GCC - LLVMC's job is essentially to transform a set of input @@ -31,36 +52,11 @@ abstract graph. The structure of this graph is completely determined by plugins, which can be either statically or dynamically linked. This makes it possible to easily adapt LLVMC for other purposes - for example, as a build tool for game resources.

-

Because LLVMC employs TableGen [1] as its configuration language, you +

Because LLVMC employs TableGen as its configuration language, you need to be familiar with it to customize LLVMC.

-
-

Compiling with LLVMC

+

Compiling with LLVMC

LLVMC tries hard to be as compatible with gcc as possible, although there are some small differences. Most of the time, however, you shouldn't be able to notice them:

@@ -98,7 +94,7 @@ also possible to choose the work-in-progress -clang option.

-

Predefined options

+

Predefined options

LLVMC has some built-in options that can't be overridden in the configuration libraries:

    @@ -121,7 +117,7 @@ their standard meaning.
-

Compiling LLVMC plugins

+

Compiling LLVMC plugins

It's easiest to start working on your own LLVMC plugin by copying the skeleton project which lives under $LLVMC_DIR/plugins/Simple:

@@ -174,7 +170,7 @@ $ make BUILTIN_PLUGINS=""
 
-

Customizing LLVMC: the compilation graph

+

Customizing LLVMC: the compilation graph

Each TableGen configuration file should include the common definitions:

@@ -242,7 +238,7 @@ debugging), run llvmc gsview installed for this to work properly.

-

Describing options

+

Describing options

Command-line options that the plugin supports are defined by using an OptionList:

@@ -293,7 +289,7 @@ output.
 
 
 
-

External options

+

External options

Sometimes, when linking several plugins together, one plugin needs to access options defined in some other plugin. Because of the way options are implemented, such options should be marked as @@ -308,7 +304,7 @@ for. Example:

-

Conditional evaluation

+

Conditional evaluation

The 'case' construct is the main means by which programmability is achieved in LLVMC. It can be used to calculate edge weights, program actions and modify the shell commands to be executed. The 'case' @@ -386,7 +382,7 @@ one of its arguments returns true. Example:

-

Writing a tool description

+

Writing a tool description

As was said earlier, nodes in the compilation graph represent tools, which are described separately. A tool definition looks like this (taken from the include/llvm/CompilerDriver/Tools.td file):

@@ -428,7 +424,7 @@ below).
-

Actions

+

Actions

A tool often needs to react to command-line options, and this is precisely what the actions property is for. The next example illustrates this feature:

@@ -486,7 +482,7 @@ Example: (unpack_values
-

Language map

+

Language map

If you are adding support for a new language to LLVMC, you'll need to modify the language map, which defines mappings from file extensions to language names. It is used to choose the proper toolchain(s) for a @@ -509,9 +505,9 @@ multiple output languages, for nodes "inside" the graph the input and output languages should match. This is enforced at compile-time.

-

More advanced topics

+

More advanced topics

-

Hooks and environment variables

+

Hooks and environment variables

Normally, LLVMC executes programs from the system PATH. Sometimes, this is not sufficient: for example, we may want to specify tool names in the configuration file. This can be achieved via the mechanism of @@ -539,7 +535,7 @@ the case expression (

-

How plugins are loaded

+

How plugins are loaded

It is possible for LLVMC plugins to depend on each other. For example, one can create edges between nodes defined in some other plugin. To make this work, however, that plugin should be loaded first. To @@ -555,50 +551,27 @@ with 0. Therefore, the plugin with the highest priority value will be loaded last.

-

Debugging

+

Debugging

When writing LLVMC plugins, it can be useful to get a visual view of the resulting compilation graph. This can be achieved via the command -line option --view-graph. This command assumes that Graphviz [2] and -Ghostview [3] are installed. There is also a --dump-graph option that -creates a Graphviz source file(compilation-graph.dot) in the +line option --view-graph. This command assumes that Graphviz and +Ghostview are installed. There is also a --dump-graph option that +creates a Graphviz source file (compilation-graph.dot) in the current directory.

-
-
-
-

References

- - - - - -
[1]TableGen Fundamentals -http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html
- - - - - -
[2]Graphviz -http://www.graphviz.org/
- - - - - -
[3]Ghostview -http://pages.cs.wisc.edu/~ghost/

- Valid CSS - Valid XHTML 1.0 Transitional + +Valid CSS + +Valid XHTML 1.0 Transitional - Mikhail Glushenkov
- LLVM Compiler Infrastructure
+Mikhail Glushenkov
+LLVM Compiler Infrastructure
- Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ -
+Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ +
diff --git a/docs/CompilerDriverTutorial.html b/docs/CompilerDriverTutorial.html index 47a9d090044..a264b0aa787 100644 --- a/docs/CompilerDriverTutorial.html +++ b/docs/CompilerDriverTutorial.html @@ -5,36 +5,32 @@ Tutorial - Using LLVMC -

Tutorial - Using LLVMC

- --- - - - -
Author:Mikhail Glushenkov <foldr@codedegers.com>
+ +
+

Written by Mikhail Glushenkov

+
+

Introduction

LLVMC is a generic compiler driver, which plays the same role for LLVM as the gcc program does for GCC - the difference being that LLVMC is designed to be more adaptable and easier to customize. Most of LLVMC functionality is implemented via plugins, which can be loaded dynamically or compiled in. This tutorial describes the basic usage and configuration of LLVMC.

-
-

Compiling with LLVMC

+

Compiling with LLVMC

In general, LLVMC tries to be command-line compatible with gcc as much as possible, so most of the familiar options work:

@@ -47,8 +43,8 @@ commands are executed by using the llvmc --help output.

-

Using LLVMC to generate toolchain drivers

-

LLVMC plugins are written mostly using TableGen [1], so you need to +

Using LLVMC to generate toolchain drivers

+

LLVMC plugins are written mostly using TableGen, so you need to be familiar with it to get anything done.

Start by compiling plugins/Simple/Simple.td, which is a primitive wrapper for gcc:

@@ -102,29 +98,20 @@ and is used for deciding which toolchain corresponds to a given input file.

To learn more about LLVMC customization, refer to the reference manual and plugin source code in the plugins directory.

-
-
-

References

- - - - - -
[1]TableGen Fundamentals -http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html

- Valid CSS - Valid XHTML 1.0 Transitional + +Valid CSS + +Valid XHTML 1.0 Transitional - Mikhail Glushenkov
- LLVM Compiler Infrastructure
+Mikhail Glushenkov
+LLVM Compiler Infrastructure
- Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ -
-
+Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ +
diff --git a/docs/llvm-rst.css b/docs/llvm-rst.css index 6937e4b9ce5..2ff9cca586e 100644 --- a/docs/llvm-rst.css +++ b/docs/llvm-rst.css @@ -41,7 +41,10 @@ h1 { margin: 20pt 0pt 5pt 0pt; } -.title { padding-top: 0; margin-top: 0; text-align: left; font-size: 25pt } +.title { padding-top: 0; margin-top: 0; text-align: left; + font-size: 25pt } + +#contents { font-weight: bold; } h2 { width: 75%; text-align: left; font-size: 12pt; padding: 4pt 4pt 4pt 4pt; margin: 1.5em 0.5em 0.5em 0.5em } @@ -67,7 +70,7 @@ h3 { margin: 2.0em 0.5em 0.5em 0.5em; .literal-block { border: solid 1px gray; background: #eeeeee; margin: 0 1em 0 1em; - padding: 0 1em 0 1em; + padding: 1em 2em 1em 1em; display:table; } .doc_notes { background: #fafafa; border: 1px solid #cecece; padding: 0.1em } diff --git a/tools/llvmc/doc/LLVMC-Reference.rst b/tools/llvmc/doc/LLVMC-Reference.rst index c01f0bbae54..3033cfcafb8 100644 --- a/tools/llvmc/doc/LLVMC-Reference.rst +++ b/tools/llvmc/doc/LLVMC-Reference.rst @@ -1,7 +1,17 @@ =================================== Customizing LLVMC: Reference Manual =================================== -:Author: Mikhail Glushenkov + +.. contents:: + +.. raw:: html + +
+

Written by Mikhail Glushenkov

+
+ +Introduction +============ LLVMC is a generic compiler driver, designed to be customizable and extensible. It plays the same role for LLVM as the ``gcc`` program @@ -16,11 +26,10 @@ by plugins, which can be either statically or dynamically linked. This makes it possible to easily adapt LLVMC for other purposes - for example, as a build tool for game resources. -Because LLVMC employs TableGen [1]_ as its configuration language, you +Because LLVMC employs TableGen_ as its configuration language, you need to be familiar with it to customize LLVMC. - -.. contents:: +.. _TableGen: http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html Compiling with LLVMC @@ -580,23 +589,27 @@ Debugging When writing LLVMC plugins, it can be useful to get a visual view of the resulting compilation graph. This can be achieved via the command -line option ``--view-graph``. This command assumes that Graphviz [2]_ and -Ghostview [3]_ are installed. There is also a ``--dump-graph`` option that -creates a Graphviz source file(``compilation-graph.dot``) in the +line option ``--view-graph``. This command assumes that Graphviz_ and +Ghostview_ are installed. There is also a ``--dump-graph`` option that +creates a Graphviz source file (``compilation-graph.dot``) in the current directory. - -References -========== - -.. [1] TableGen Fundamentals - http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html - -.. [2] Graphviz - http://www.graphviz.org/ - -.. [3] Ghostview - http://pages.cs.wisc.edu/~ghost/ +.. _Graphviz: http://www.graphviz.org/ +.. _Ghostview: http://pages.cs.wisc.edu/~ghost/ .. raw:: html - :file: footer.html + +
+
+ + Valid CSS + + Valid XHTML 1.0 Transitional + + Mikhail Glushenkov
+ LLVM Compiler Infrastructure
+ + Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ +
diff --git a/tools/llvmc/doc/LLVMC-Tutorial.rst b/tools/llvmc/doc/LLVMC-Tutorial.rst index 40292ee6271..a27bb209290 100644 --- a/tools/llvmc/doc/LLVMC-Tutorial.rst +++ b/tools/llvmc/doc/LLVMC-Tutorial.rst @@ -1,7 +1,17 @@ ====================== Tutorial - Using LLVMC ====================== -:Author: Mikhail Glushenkov + +.. contents:: + +.. raw:: html + +
+

Written by Mikhail Glushenkov

+
+ +Introduction +============ LLVMC is a generic compiler driver, which plays the same role for LLVM as the ``gcc`` program does for GCC - the difference being that LLVMC @@ -11,9 +21,6 @@ dynamically or compiled in. This tutorial describes the basic usage and configuration of LLVMC. -.. contents:: - - Compiling with LLVMC ==================== @@ -32,9 +39,11 @@ command-line LLVMC usage, refer to the ``llvmc --help`` output. Using LLVMC to generate toolchain drivers ========================================= -LLVMC plugins are written mostly using TableGen [1]_, so you need to +LLVMC plugins are written mostly using TableGen_, so you need to be familiar with it to get anything done. +.. _TableGen: http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html + Start by compiling ``plugins/Simple/Simple.td``, which is a primitive wrapper for ``gcc``:: @@ -93,11 +102,19 @@ file. To learn more about LLVMC customization, refer to the reference manual and plugin source code in the ``plugins`` directory. -References -========== - -.. [1] TableGen Fundamentals - http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html - .. raw:: html - :file: footer.html + +
+
+ + Valid CSS + + Valid XHTML 1.0 Transitional + + Mikhail Glushenkov
+ LLVM Compiler Infrastructure
+ + Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ +
diff --git a/tools/llvmc/doc/footer.html b/tools/llvmc/doc/footer.html deleted file mode 100644 index 2292471f93c..00000000000 --- a/tools/llvmc/doc/footer.html +++ /dev/null @@ -1,12 +0,0 @@ -
-
- Valid CSS - Valid XHTML 1.0 Transitional - - Mikhail Glushenkov
- LLVM Compiler Infrastructure
- - Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ -
diff --git a/tools/llvmc/doc/llvm-rst.css b/tools/llvmc/doc/llvm-rst.css index 6937e4b9ce5..2ff9cca586e 100644 --- a/tools/llvmc/doc/llvm-rst.css +++ b/tools/llvmc/doc/llvm-rst.css @@ -41,7 +41,10 @@ h1 { margin: 20pt 0pt 5pt 0pt; } -.title { padding-top: 0; margin-top: 0; text-align: left; font-size: 25pt } +.title { padding-top: 0; margin-top: 0; text-align: left; + font-size: 25pt } + +#contents { font-weight: bold; } h2 { width: 75%; text-align: left; font-size: 12pt; padding: 4pt 4pt 4pt 4pt; margin: 1.5em 0.5em 0.5em 0.5em } @@ -67,7 +70,7 @@ h3 { margin: 2.0em 0.5em 0.5em 0.5em; .literal-block { border: solid 1px gray; background: #eeeeee; margin: 0 1em 0 1em; - padding: 0 1em 0 1em; + padding: 1em 2em 1em 1em; display:table; } .doc_notes { background: #fafafa; border: 1px solid #cecece; padding: 0.1em }