| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8" ?> | 
|  | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 
|  | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 
| Reid Spencer | b1254a1 | 2004-08-09 03:08:29 +0000 | [diff] [blame] | 4 | <head> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 6 | <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 7 | <title>Customizing LLVMC: Reference Manual</title> | 
| Mikhail Glushenkov | 8cc8288 | 2008-12-13 17:50:58 +0000 | [diff] [blame] | 8 | <link rel="stylesheet" href="llvm.css" type="text/css" /> | 
| Reid Spencer | b1254a1 | 2004-08-09 03:08:29 +0000 | [diff] [blame] | 9 | </head> | 
|  | 10 | <body> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 11 | <div class="document" id="customizing-llvmc-reference-manual"> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 12 | <h1 class="title">Customizing LLVMC: Reference Manual</h1> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 13 |  | 
| Mikhail Glushenkov | 23f522a | 2008-12-13 17:51:47 +0000 | [diff] [blame] | 14 | <!-- This file was automatically generated by rst2html. | 
|  | 15 | Please do not edit directly! | 
|  | 16 | The ReST source lives in the directory 'tools/llvmc/doc'. --> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 17 | <div class="contents topic" id="contents"> | 
|  | 18 | <p class="topic-title first">Contents</p> | 
| Mikhail Glushenkov | d565203 | 2008-12-13 02:28:58 +0000 | [diff] [blame] | 19 | <ul class="simple"> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 20 | <li><a class="reference internal" href="#introduction" id="id4">Introduction</a></li> | 
|  | 21 | <li><a class="reference internal" href="#compiling-with-llvmc" id="id5">Compiling with LLVMC</a></li> | 
|  | 22 | <li><a class="reference internal" href="#predefined-options" id="id6">Predefined options</a></li> | 
|  | 23 | <li><a class="reference internal" href="#compiling-llvmc-plugins" id="id7">Compiling LLVMC plugins</a></li> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 24 | <li><a class="reference internal" href="#compiling-standalone-llvmc-based-drivers" id="id8">Compiling standalone LLVMC-based drivers</a></li> | 
|  | 25 | <li><a class="reference internal" href="#customizing-llvmc-the-compilation-graph" id="id9">Customizing LLVMC: the compilation graph</a></li> | 
|  | 26 | <li><a class="reference internal" href="#describing-options" id="id10">Describing options</a><ul> | 
|  | 27 | <li><a class="reference internal" href="#external-options" id="id11">External options</a></li> | 
| Mikhail Glushenkov | d565203 | 2008-12-13 02:28:58 +0000 | [diff] [blame] | 28 | </ul> | 
|  | 29 | </li> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 30 | <li><a class="reference internal" href="#conditional-evaluation" id="id12">Conditional evaluation</a></li> | 
|  | 31 | <li><a class="reference internal" href="#writing-a-tool-description" id="id13">Writing a tool description</a><ul> | 
|  | 32 | <li><a class="reference internal" href="#actions" id="id14">Actions</a></li> | 
| Mikhail Glushenkov | d565203 | 2008-12-13 02:28:58 +0000 | [diff] [blame] | 33 | </ul> | 
|  | 34 | </li> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 35 | <li><a class="reference internal" href="#language-map" id="id15">Language map</a></li> | 
|  | 36 | <li><a class="reference internal" href="#more-advanced-topics" id="id16">More advanced topics</a><ul> | 
|  | 37 | <li><a class="reference internal" href="#hooks-and-environment-variables" id="id17">Hooks and environment variables</a></li> | 
|  | 38 | <li><a class="reference internal" href="#how-plugins-are-loaded" id="id18">How plugins are loaded</a></li> | 
|  | 39 | <li><a class="reference internal" href="#debugging" id="id19">Debugging</a></li> | 
| Mikhail Glushenkov | d565203 | 2008-12-13 02:28:58 +0000 | [diff] [blame] | 40 | </ul> | 
|  | 41 | </li> | 
|  | 42 | </ul> | 
|  | 43 | </div> | 
|  | 44 | <div class="doc_author"> | 
|  | 45 | <p>Written by <a href="mailto:foldr@codedgers.com">Mikhail Glushenkov</a></p> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 46 | </div><div class="section" id="introduction"> | 
|  | 47 | <h1><a class="toc-backref" href="#id4">Introduction</a></h1> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 48 | <p>LLVMC is a generic compiler driver, designed to be customizable and | 
|  | 49 | extensible. It plays the same role for LLVM as the <tt class="docutils literal"><span class="pre">gcc</span></tt> program | 
|  | 50 | does for GCC - LLVMC's job is essentially to transform a set of input | 
|  | 51 | files into a set of targets depending on configuration rules and user | 
|  | 52 | options. What makes LLVMC different is that these transformation rules | 
|  | 53 | are completely customizable - in fact, LLVMC knows nothing about the | 
|  | 54 | specifics of transformation (even the command-line options are mostly | 
|  | 55 | not hard-coded) and regards the transformation structure as an | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 56 | abstract graph. The structure of this graph is completely determined | 
|  | 57 | by plugins, which can be either statically or dynamically linked. This | 
|  | 58 | makes it possible to easily adapt LLVMC for other purposes - for | 
|  | 59 | example, as a build tool for game resources.</p> | 
| Mikhail Glushenkov | 63dc318 | 2009-06-17 02:56:48 +0000 | [diff] [blame^] | 60 | <p>Because LLVMC employs <a class="reference external" href="http://llvm.org/docs/TableGenFundamentals.html">TableGen</a> as its configuration language, you | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 61 | need to be familiar with it to customize LLVMC.</p> | 
| Reid Spencer | b1254a1 | 2004-08-09 03:08:29 +0000 | [diff] [blame] | 62 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 63 | <div class="section" id="compiling-with-llvmc"> | 
|  | 64 | <h1><a class="toc-backref" href="#id5">Compiling with LLVMC</a></h1> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 65 | <p>LLVMC tries hard to be as compatible with <tt class="docutils literal"><span class="pre">gcc</span></tt> as possible, | 
|  | 66 | although there are some small differences. Most of the time, however, | 
|  | 67 | you shouldn't be able to notice them:</p> | 
|  | 68 | <pre class="literal-block"> | 
|  | 69 | $ # This works as expected: | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 70 | $ llvmc -O3 -Wall hello.cpp | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 71 | $ ./a.out | 
|  | 72 | hello | 
|  | 73 | </pre> | 
| Mikhail Glushenkov | 63dc318 | 2009-06-17 02:56:48 +0000 | [diff] [blame^] | 74 | <p>One nice feature of LLVMC is that one doesn't have to distinguish between | 
|  | 75 | different compilers for different languages (think <tt class="docutils literal"><span class="pre">g++</span></tt> vs.  <tt class="docutils literal"><span class="pre">gcc</span></tt>) - the | 
|  | 76 | right toolchain is chosen automatically based on input language names (which | 
|  | 77 | are, in turn, determined from file extensions). If you want to force files | 
|  | 78 | ending with ".c" to compile as C++, use the <tt class="docutils literal"><span class="pre">-x</span></tt> option, just like you would | 
|  | 79 | do it with <tt class="docutils literal"><span class="pre">gcc</span></tt>:</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 80 | <pre class="literal-block"> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 81 | $ # hello.c is really a C++ file | 
|  | 82 | $ llvmc -x c++ hello.c | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 83 | $ ./a.out | 
|  | 84 | hello | 
|  | 85 | </pre> | 
|  | 86 | <p>On the other hand, when using LLVMC as a linker to combine several C++ | 
|  | 87 | object files you should provide the <tt class="docutils literal"><span class="pre">--linker</span></tt> option since it's | 
|  | 88 | impossible for LLVMC to choose the right linker in that case:</p> | 
|  | 89 | <pre class="literal-block"> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 90 | $ llvmc -c hello.cpp | 
|  | 91 | $ llvmc hello.o | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 92 | [A lot of link-time errors skipped] | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 93 | $ llvmc --linker=c++ hello.o | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 94 | $ ./a.out | 
|  | 95 | hello | 
|  | 96 | </pre> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 97 | <p>By default, LLVMC uses <tt class="docutils literal"><span class="pre">llvm-gcc</span></tt> to compile the source code. It is | 
|  | 98 | also possible to choose the work-in-progress <tt class="docutils literal"><span class="pre">clang</span></tt> compiler with | 
|  | 99 | the <tt class="docutils literal"><span class="pre">-clang</span></tt> option.</p> | 
| Reid Spencer | b1254a1 | 2004-08-09 03:08:29 +0000 | [diff] [blame] | 100 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 101 | <div class="section" id="predefined-options"> | 
|  | 102 | <h1><a class="toc-backref" href="#id6">Predefined options</a></h1> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 103 | <p>LLVMC has some built-in options that can't be overridden in the | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 104 | configuration libraries:</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 105 | <ul class="simple"> | 
|  | 106 | <li><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">FILE</span></tt> - Output file name.</li> | 
|  | 107 | <li><tt class="docutils literal"><span class="pre">-x</span> <span class="pre">LANGUAGE</span></tt> - Specify the language of the following input files | 
|  | 108 | until the next -x option.</li> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 109 | <li><tt class="docutils literal"><span class="pre">-load</span> <span class="pre">PLUGIN_NAME</span></tt> - Load the specified plugin DLL. Example: | 
|  | 110 | <tt class="docutils literal"><span class="pre">-load</span> <span class="pre">$LLVM_DIR/Release/lib/LLVMCSimple.so</span></tt>.</li> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 111 | <li><tt class="docutils literal"><span class="pre">-v</span></tt> - Enable verbose mode, i.e. print out all executed commands.</li> | 
| Mikhail Glushenkov | 4ad0d57 | 2009-03-27 12:58:29 +0000 | [diff] [blame] | 112 | <li><tt class="docutils literal"><span class="pre">--check-graph</span></tt> - Check the compilation for common errors like mismatched | 
|  | 113 | output/input language names, multiple default edges and cycles. Because of | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 114 | plugins, these checks can't be performed at compile-time. Exit with code zero | 
|  | 115 | if no errors were found, and return the number of found errors | 
|  | 116 | otherwise. Hidden option, useful for debugging LLVMC plugins.</li> | 
| Mikhail Glushenkov | 4ad0d57 | 2009-03-27 12:58:29 +0000 | [diff] [blame] | 117 | <li><tt class="docutils literal"><span class="pre">--view-graph</span></tt> - Show a graphical representation of the compilation graph | 
|  | 118 | and exit. Requires that you have <tt class="docutils literal"><span class="pre">dot</span></tt> and <tt class="docutils literal"><span class="pre">gv</span></tt> programs installed. Hidden | 
|  | 119 | option, useful for debugging LLVMC plugins.</li> | 
|  | 120 | <li><tt class="docutils literal"><span class="pre">--write-graph</span></tt> - Write a <tt class="docutils literal"><span class="pre">compilation-graph.dot</span></tt> file in the current | 
|  | 121 | directory with the compilation graph description in Graphviz format (identical | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 122 | to the file used by the <tt class="docutils literal"><span class="pre">--view-graph</span></tt> option). The <tt class="docutils literal"><span class="pre">-o</span></tt> option can be | 
|  | 123 | used to set the output file name. Hidden option, useful for debugging LLVMC | 
|  | 124 | plugins.</li> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 125 | <li><tt class="docutils literal"><span class="pre">--save-temps</span></tt> - Write temporary files to the current directory | 
|  | 126 | and do not delete them on exit. Hidden option, useful for debugging.</li> | 
|  | 127 | <li><tt class="docutils literal"><span class="pre">--help</span></tt>, <tt class="docutils literal"><span class="pre">--help-hidden</span></tt>, <tt class="docutils literal"><span class="pre">--version</span></tt> - These options have | 
|  | 128 | their standard meaning.</li> | 
|  | 129 | </ul> | 
| Reid Spencer | b1254a1 | 2004-08-09 03:08:29 +0000 | [diff] [blame] | 130 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 131 | <div class="section" id="compiling-llvmc-plugins"> | 
|  | 132 | <h1><a class="toc-backref" href="#id7">Compiling LLVMC plugins</a></h1> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 133 | <p>It's easiest to start working on your own LLVMC plugin by copying the | 
|  | 134 | skeleton project which lives under <tt class="docutils literal"><span class="pre">$LLVMC_DIR/plugins/Simple</span></tt>:</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 135 | <pre class="literal-block"> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 136 | $ cd $LLVMC_DIR/plugins | 
|  | 137 | $ cp -r Simple MyPlugin | 
|  | 138 | $ cd MyPlugin | 
|  | 139 | $ ls | 
|  | 140 | Makefile PluginMain.cpp Simple.td | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 141 | </pre> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 142 | <p>As you can see, our basic plugin consists of only two files (not | 
|  | 143 | counting the build script). <tt class="docutils literal"><span class="pre">Simple.td</span></tt> contains TableGen | 
|  | 144 | description of the compilation graph; its format is documented in the | 
|  | 145 | following sections. <tt class="docutils literal"><span class="pre">PluginMain.cpp</span></tt> is just a helper file used to | 
|  | 146 | compile the auto-generated C++ code produced from TableGen source. It | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 147 | can also contain hook definitions (see <a class="reference internal" href="#hooks">below</a>).</p> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 148 | <p>The first thing that you should do is to change the <tt class="docutils literal"><span class="pre">LLVMC_PLUGIN</span></tt> | 
|  | 149 | variable in the <tt class="docutils literal"><span class="pre">Makefile</span></tt> to avoid conflicts (since this variable | 
|  | 150 | is used to name the resulting library):</p> | 
|  | 151 | <pre class="literal-block"> | 
|  | 152 | LLVMC_PLUGIN=MyPlugin | 
|  | 153 | </pre> | 
|  | 154 | <p>It is also a good idea to rename <tt class="docutils literal"><span class="pre">Simple.td</span></tt> to something less | 
|  | 155 | generic:</p> | 
|  | 156 | <pre class="literal-block"> | 
|  | 157 | $ mv Simple.td MyPlugin.td | 
|  | 158 | </pre> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 159 | <p>To build your plugin as a dynamic library, just <tt class="docutils literal"><span class="pre">cd</span></tt> to its source | 
|  | 160 | directory and run <tt class="docutils literal"><span class="pre">make</span></tt>. The resulting file will be called | 
| Mikhail Glushenkov | 63dc318 | 2009-06-17 02:56:48 +0000 | [diff] [blame^] | 161 | <tt class="docutils literal"><span class="pre">plugin_llvmc_$(LLVMC_PLUGIN).$(DLL_EXTENSION)</span></tt> (in our case, | 
|  | 162 | <tt class="docutils literal"><span class="pre">plugin_llvmc_MyPlugin.so</span></tt>). This library can be then loaded in with the | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 163 | <tt class="docutils literal"><span class="pre">-load</span></tt> option. Example:</p> | 
|  | 164 | <pre class="literal-block"> | 
|  | 165 | $ cd $LLVMC_DIR/plugins/Simple | 
|  | 166 | $ make | 
| Mikhail Glushenkov | 63dc318 | 2009-06-17 02:56:48 +0000 | [diff] [blame^] | 167 | $ llvmc -load $LLVM_DIR/Release/lib/plugin_llvmc_Simple.so | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 168 | </pre> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 169 | </div> | 
|  | 170 | <div class="section" id="compiling-standalone-llvmc-based-drivers"> | 
|  | 171 | <h1><a class="toc-backref" href="#id8">Compiling standalone LLVMC-based drivers</a></h1> | 
|  | 172 | <p>By default, the <tt class="docutils literal"><span class="pre">llvmc</span></tt> executable consists of a driver core plus several | 
|  | 173 | statically linked plugins (<tt class="docutils literal"><span class="pre">Base</span></tt> and <tt class="docutils literal"><span class="pre">Clang</span></tt> at the moment). You can | 
|  | 174 | produce a standalone LLVMC-based driver executable by linking the core with your | 
|  | 175 | own plugins. The recommended way to do this is by starting with the provided | 
|  | 176 | <tt class="docutils literal"><span class="pre">Skeleton</span></tt> example (<tt class="docutils literal"><span class="pre">$LLVMC_DIR/example/Skeleton</span></tt>):</p> | 
|  | 177 | <pre class="literal-block"> | 
|  | 178 | $ cd $LLVMC_DIR/example/ | 
|  | 179 | $ cp -r Skeleton mydriver | 
|  | 180 | $ cd mydriver | 
|  | 181 | $ vim Makefile | 
|  | 182 | [...] | 
|  | 183 | $ make | 
|  | 184 | </pre> | 
|  | 185 | <p>If you're compiling LLVM with different source and object directories, then you | 
|  | 186 | must perform the following additional steps before running <tt class="docutils literal"><span class="pre">make</span></tt>:</p> | 
|  | 187 | <pre class="literal-block"> | 
|  | 188 | # LLVMC_SRC_DIR = $LLVM_SRC_DIR/tools/llvmc/ | 
|  | 189 | # LLVMC_OBJ_DIR = $LLVM_OBJ_DIR/tools/llvmc/ | 
|  | 190 | $ cp $LLVMC_SRC_DIR/example/mydriver/Makefile \ | 
|  | 191 | $LLVMC_OBJ_DIR/example/mydriver/ | 
|  | 192 | $ cd $LLVMC_OBJ_DIR/example/mydriver | 
|  | 193 | $ make | 
|  | 194 | </pre> | 
|  | 195 | <p>Another way to do the same thing is by using the following command:</p> | 
|  | 196 | <pre class="literal-block"> | 
|  | 197 | $ cd $LLVMC_DIR | 
|  | 198 | $ make LLVMC_BUILTIN_PLUGINS=MyPlugin LLVMC_BASED_DRIVER_NAME=mydriver | 
|  | 199 | </pre> | 
| Mikhail Glushenkov | 63dc318 | 2009-06-17 02:56:48 +0000 | [diff] [blame^] | 200 | <p>This works with both srcdir == objdir and srcdir != objdir, but assumes that the | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 201 | plugin source directory was placed under <tt class="docutils literal"><span class="pre">$LLVMC_DIR/plugins</span></tt>.</p> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 202 | <p>Sometimes, you will want a 'bare-bones' version of LLVMC that has no | 
|  | 203 | built-in plugins. It can be compiled with the following command:</p> | 
|  | 204 | <pre class="literal-block"> | 
|  | 205 | $ cd $LLVMC_DIR | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 206 | $ make LLVMC_BUILTIN_PLUGINS="" | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 207 | </pre> | 
|  | 208 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 209 | <div class="section" id="customizing-llvmc-the-compilation-graph"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 210 | <h1><a class="toc-backref" href="#id9">Customizing LLVMC: the compilation graph</a></h1> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 211 | <p>Each TableGen configuration file should include the common | 
|  | 212 | definitions:</p> | 
|  | 213 | <pre class="literal-block"> | 
|  | 214 | include "llvm/CompilerDriver/Common.td" | 
|  | 215 | </pre> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 216 | <p>Internally, LLVMC stores information about possible source | 
|  | 217 | transformations in form of a graph. Nodes in this graph represent | 
|  | 218 | tools, and edges between two nodes represent a transformation path. A | 
|  | 219 | special "root" node is used to mark entry points for the | 
|  | 220 | transformations. LLVMC also assigns a weight to each edge (more on | 
|  | 221 | this later) to choose between several alternative edges.</p> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 222 | <p>The definition of the compilation graph (see file | 
|  | 223 | <tt class="docutils literal"><span class="pre">plugins/Base/Base.td</span></tt> for an example) is just a list of edges:</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 224 | <pre class="literal-block"> | 
|  | 225 | def CompilationGraph : CompilationGraph<[ | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 226 | Edge<"root", "llvm_gcc_c">, | 
|  | 227 | Edge<"root", "llvm_gcc_assembler">, | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 228 | ... | 
|  | 229 |  | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 230 | Edge<"llvm_gcc_c", "llc">, | 
|  | 231 | Edge<"llvm_gcc_cpp", "llc">, | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 232 | ... | 
|  | 233 |  | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 234 | OptionalEdge<"llvm_gcc_c", "opt", (case (switch_on "opt"), | 
|  | 235 | (inc_weight))>, | 
|  | 236 | OptionalEdge<"llvm_gcc_cpp", "opt", (case (switch_on "opt"), | 
|  | 237 | (inc_weight))>, | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 238 | ... | 
|  | 239 |  | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 240 | OptionalEdge<"llvm_gcc_assembler", "llvm_gcc_cpp_linker", | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 241 | (case (input_languages_contain "c++"), (inc_weight), | 
|  | 242 | (or (parameter_equals "linker", "g++"), | 
|  | 243 | (parameter_equals "linker", "c++")), (inc_weight))>, | 
|  | 244 | ... | 
|  | 245 |  | 
|  | 246 | ]>; | 
|  | 247 | </pre> | 
|  | 248 | <p>As you can see, the edges can be either default or optional, where | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 249 | optional edges are differentiated by an additional <tt class="docutils literal"><span class="pre">case</span></tt> expression | 
|  | 250 | used to calculate the weight of this edge. Notice also that we refer | 
|  | 251 | to tools via their names (as strings). This makes it possible to add | 
|  | 252 | edges to an existing compilation graph in plugins without having to | 
|  | 253 | know about all tool definitions used in the graph.</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 254 | <p>The default edges are assigned a weight of 1, and optional edges get a | 
|  | 255 | weight of 0 + 2*N where N is the number of tests that evaluated to | 
|  | 256 | true in the <tt class="docutils literal"><span class="pre">case</span></tt> expression. It is also possible to provide an | 
|  | 257 | integer parameter to <tt class="docutils literal"><span class="pre">inc_weight</span></tt> and <tt class="docutils literal"><span class="pre">dec_weight</span></tt> - in this case, | 
|  | 258 | the weight is increased (or decreased) by the provided value instead | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 259 | of the default 2. It is also possible to change the default weight of | 
|  | 260 | an optional edge by using the <tt class="docutils literal"><span class="pre">default</span></tt> clause of the <tt class="docutils literal"><span class="pre">case</span></tt> | 
|  | 261 | construct.</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 262 | <p>When passing an input file through the graph, LLVMC picks the edge | 
|  | 263 | with the maximum weight. To avoid ambiguity, there should be only one | 
|  | 264 | default edge between two nodes (with the exception of the root node, | 
|  | 265 | which gets a special treatment - there you are allowed to specify one | 
|  | 266 | default edge <em>per language</em>).</p> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 267 | <p>When multiple plugins are loaded, their compilation graphs are merged | 
|  | 268 | together. Since multiple edges that have the same end nodes are not | 
|  | 269 | allowed (i.e. the graph is not a multigraph), an edge defined in | 
|  | 270 | several plugins will be replaced by the definition from the plugin | 
|  | 271 | that was loaded last. Plugin load order can be controlled by using the | 
|  | 272 | plugin priority feature described above.</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 273 | <p>To get a visual representation of the compilation graph (useful for | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 274 | debugging), run <tt class="docutils literal"><span class="pre">llvmc</span> <span class="pre">--view-graph</span></tt>. You will need <tt class="docutils literal"><span class="pre">dot</span></tt> and | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 275 | <tt class="docutils literal"><span class="pre">gsview</span></tt> installed for this to work properly.</p> | 
| Reid Spencer | b1254a1 | 2004-08-09 03:08:29 +0000 | [diff] [blame] | 276 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 277 | <div class="section" id="describing-options"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 278 | <h1><a class="toc-backref" href="#id10">Describing options</a></h1> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 279 | <p>Command-line options that the plugin supports are defined by using an | 
|  | 280 | <tt class="docutils literal"><span class="pre">OptionList</span></tt>:</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 281 | <pre class="literal-block"> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 282 | def Options : OptionList<[ | 
|  | 283 | (switch_option "E", (help "Help string")), | 
|  | 284 | (alias_option "quiet", "q") | 
|  | 285 | ... | 
|  | 286 | ]>; | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 287 | </pre> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 288 | <p>As you can see, the option list is just a list of DAGs, where each DAG | 
|  | 289 | is an option description consisting of the option name and some | 
|  | 290 | properties. A plugin can define more than one option list (they are | 
|  | 291 | all merged together in the end), which can be handy if one wants to | 
|  | 292 | separate option groups syntactically.</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 293 | <ul> | 
|  | 294 | <li><p class="first">Possible option types:</p> | 
|  | 295 | <blockquote> | 
|  | 296 | <ul class="simple"> | 
| Mikhail Glushenkov | 5303c75 | 2009-01-28 03:47:38 +0000 | [diff] [blame] | 297 | <li><tt class="docutils literal"><span class="pre">switch_option</span></tt> - a simple boolean switch without arguments, for example | 
|  | 298 | <tt class="docutils literal"><span class="pre">-O2</span></tt> or <tt class="docutils literal"><span class="pre">-time</span></tt>. At most one occurrence is allowed.</li> | 
|  | 299 | <li><tt class="docutils literal"><span class="pre">parameter_option</span></tt> - option that takes one argument, for example | 
|  | 300 | <tt class="docutils literal"><span class="pre">-std=c99</span></tt>. It is also allowed to use spaces instead of the equality | 
|  | 301 | sign: <tt class="docutils literal"><span class="pre">-std</span> <span class="pre">c99</span></tt>. At most one occurrence is allowed.</li> | 
|  | 302 | <li><tt class="docutils literal"><span class="pre">parameter_list_option</span></tt> - same as the above, but more than one option | 
|  | 303 | occurence is allowed.</li> | 
|  | 304 | <li><tt class="docutils literal"><span class="pre">prefix_option</span></tt> - same as the parameter_option, but the option name and | 
|  | 305 | argument do not have to be separated. Example: <tt class="docutils literal"><span class="pre">-ofile</span></tt>. This can be also | 
|  | 306 | specified as <tt class="docutils literal"><span class="pre">-o</span> <span class="pre">file</span></tt>; however, <tt class="docutils literal"><span class="pre">-o=file</span></tt> will be parsed incorrectly | 
|  | 307 | (<tt class="docutils literal"><span class="pre">=file</span></tt> will be interpreted as option value). At most one occurrence is | 
|  | 308 | allowed.</li> | 
|  | 309 | <li><tt class="docutils literal"><span class="pre">prefix_list_option</span></tt> - same as the above, but more than one occurence of | 
|  | 310 | the option is allowed; example: <tt class="docutils literal"><span class="pre">-lm</span> <span class="pre">-lpthread</span></tt>.</li> | 
|  | 311 | <li><tt class="docutils literal"><span class="pre">alias_option</span></tt> - a special option type for creating aliases. Unlike other | 
|  | 312 | option types, aliases are not allowed to have any properties besides the | 
|  | 313 | aliased option name. Usage example: <tt class="docutils literal"><span class="pre">(alias_option</span> <span class="pre">"preprocess",</span> <span class="pre">"E")</span></tt></li> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 314 | </ul> | 
|  | 315 | </blockquote> | 
|  | 316 | </li> | 
|  | 317 | <li><p class="first">Possible option properties:</p> | 
|  | 318 | <blockquote> | 
|  | 319 | <ul class="simple"> | 
| Mikhail Glushenkov | 5303c75 | 2009-01-28 03:47:38 +0000 | [diff] [blame] | 320 | <li><tt class="docutils literal"><span class="pre">help</span></tt> - help string associated with this option. Used for <tt class="docutils literal"><span class="pre">--help</span></tt> | 
|  | 321 | output.</li> | 
|  | 322 | <li><tt class="docutils literal"><span class="pre">required</span></tt> - this option must be specified exactly once (or, in case of | 
|  | 323 | the list options without the <tt class="docutils literal"><span class="pre">multi_val</span></tt> property, at least | 
|  | 324 | once). Incompatible with <tt class="docutils literal"><span class="pre">zero_or_one</span></tt> and <tt class="docutils literal"><span class="pre">one_or_more</span></tt>.</li> | 
|  | 325 | <li><tt class="docutils literal"><span class="pre">one_or_more</span></tt> - the option must be specified at least one time. Useful | 
|  | 326 | only for list options in conjunction with <tt class="docutils literal"><span class="pre">multi_val</span></tt>; for ordinary lists | 
|  | 327 | it is synonymous with <tt class="docutils literal"><span class="pre">required</span></tt>. Incompatible with <tt class="docutils literal"><span class="pre">required</span></tt> and | 
|  | 328 | <tt class="docutils literal"><span class="pre">zero_or_one</span></tt>.</li> | 
|  | 329 | <li><tt class="docutils literal"><span class="pre">zero_or_one</span></tt> - the option can be specified zero or one times. Useful | 
|  | 330 | only for list options in conjunction with <tt class="docutils literal"><span class="pre">multi_val</span></tt>. Incompatible with | 
|  | 331 | <tt class="docutils literal"><span class="pre">required</span></tt> and <tt class="docutils literal"><span class="pre">one_or_more</span></tt>.</li> | 
| Mikhail Glushenkov | f9b1d79 | 2009-01-15 02:42:40 +0000 | [diff] [blame] | 332 | <li><tt class="docutils literal"><span class="pre">hidden</span></tt> - the description of this option will not appear in | 
|  | 333 | the <tt class="docutils literal"><span class="pre">--help</span></tt> output (but will appear in the <tt class="docutils literal"><span class="pre">--help-hidden</span></tt> | 
|  | 334 | output).</li> | 
|  | 335 | <li><tt class="docutils literal"><span class="pre">really_hidden</span></tt> - the option will not be mentioned in any help | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 336 | output.</li> | 
| Mikhail Glushenkov | 5303c75 | 2009-01-28 03:47:38 +0000 | [diff] [blame] | 337 | <li><tt class="docutils literal"><span class="pre">multi_val</span> <span class="pre">n</span></tt> - this option takes <em>n</em> arguments (can be useful in some | 
|  | 338 | special cases). Usage example: <tt class="docutils literal"><span class="pre">(parameter_list_option</span> <span class="pre">"foo",</span> <span class="pre">(multi_val</span> | 
|  | 339 | <span class="pre">3))</span></tt>. Only list options can have this attribute; you can, however, use | 
|  | 340 | the <tt class="docutils literal"><span class="pre">one_or_more</span></tt> and <tt class="docutils literal"><span class="pre">zero_or_one</span></tt> properties.</li> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 341 | <li><tt class="docutils literal"><span class="pre">extern</span></tt> - this option is defined in some other plugin, see below.</li> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 342 | </ul> | 
|  | 343 | </blockquote> | 
|  | 344 | </li> | 
|  | 345 | </ul> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 346 | <div class="section" id="external-options"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 347 | <h2><a class="toc-backref" href="#id11">External options</a></h2> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 348 | <p>Sometimes, when linking several plugins together, one plugin needs to | 
|  | 349 | access options defined in some other plugin. Because of the way | 
| Mikhail Glushenkov | f9b1d79 | 2009-01-15 02:42:40 +0000 | [diff] [blame] | 350 | options are implemented, such options must be marked as | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 351 | <tt class="docutils literal"><span class="pre">extern</span></tt>. This is what the <tt class="docutils literal"><span class="pre">extern</span></tt> option property is | 
|  | 352 | for. Example:</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 353 | <pre class="literal-block"> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 354 | ... | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 355 | (switch_option "E", (extern)) | 
|  | 356 | ... | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 357 | </pre> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 358 | <p>See also the section on plugin <a class="reference internal" href="#priorities">priorities</a>.</p> | 
| Reid Spencer | b1254a1 | 2004-08-09 03:08:29 +0000 | [diff] [blame] | 359 | </div> | 
| Reid Spencer | b1254a1 | 2004-08-09 03:08:29 +0000 | [diff] [blame] | 360 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 361 | <div class="section" id="conditional-evaluation"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 362 | <span id="case"></span><h1><a class="toc-backref" href="#id12">Conditional evaluation</a></h1> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 363 | <p>The 'case' construct is the main means by which programmability is | 
|  | 364 | achieved in LLVMC. It can be used to calculate edge weights, program | 
|  | 365 | actions and modify the shell commands to be executed. The 'case' | 
|  | 366 | expression is designed after the similarly-named construct in | 
|  | 367 | functional languages and takes the form <tt class="docutils literal"><span class="pre">(case</span> <span class="pre">(test_1),</span> <span class="pre">statement_1,</span> | 
|  | 368 | <span class="pre">(test_2),</span> <span class="pre">statement_2,</span> <span class="pre">...</span> <span class="pre">(test_N),</span> <span class="pre">statement_N)</span></tt>. The statements | 
|  | 369 | are evaluated only if the corresponding tests evaluate to true.</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 370 | <p>Examples:</p> | 
|  | 371 | <pre class="literal-block"> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 372 | // Edge weight calculation | 
|  | 373 |  | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 374 | // Increases edge weight by 5 if "-A" is provided on the | 
|  | 375 | // command-line, and by 5 more if "-B" is also provided. | 
|  | 376 | (case | 
|  | 377 | (switch_on "A"), (inc_weight 5), | 
|  | 378 | (switch_on "B"), (inc_weight 5)) | 
|  | 379 |  | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 380 |  | 
|  | 381 | // Tool command line specification | 
|  | 382 |  | 
|  | 383 | // Evaluates to "cmdline1" if the option "-A" is provided on the | 
|  | 384 | // command line; to "cmdline2" if "-B" is provided; | 
|  | 385 | // otherwise to "cmdline3". | 
|  | 386 |  | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 387 | (case | 
|  | 388 | (switch_on "A"), "cmdline1", | 
|  | 389 | (switch_on "B"), "cmdline2", | 
|  | 390 | (default), "cmdline3") | 
|  | 391 | </pre> | 
|  | 392 | <p>Note the slight difference in 'case' expression handling in contexts | 
|  | 393 | of edge weights and command line specification - in the second example | 
|  | 394 | the value of the <tt class="docutils literal"><span class="pre">"B"</span></tt> switch is never checked when switch <tt class="docutils literal"><span class="pre">"A"</span></tt> is | 
|  | 395 | enabled, and the whole expression always evaluates to <tt class="docutils literal"><span class="pre">"cmdline1"</span></tt> in | 
|  | 396 | that case.</p> | 
|  | 397 | <p>Case expressions can also be nested, i.e. the following is legal:</p> | 
|  | 398 | <pre class="literal-block"> | 
|  | 399 | (case (switch_on "E"), (case (switch_on "o"), ..., (default), ...) | 
|  | 400 | (default), ...) | 
|  | 401 | </pre> | 
|  | 402 | <p>You should, however, try to avoid doing that because it hurts | 
|  | 403 | readability. It is usually better to split tool descriptions and/or | 
|  | 404 | use TableGen inheritance instead.</p> | 
|  | 405 | <ul class="simple"> | 
|  | 406 | <li>Possible tests are:<ul> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 407 | <li><tt class="docutils literal"><span class="pre">switch_on</span></tt> - Returns true if a given command-line switch is | 
|  | 408 | provided by the user. Example: <tt class="docutils literal"><span class="pre">(switch_on</span> <span class="pre">"opt")</span></tt>.</li> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 409 | <li><tt class="docutils literal"><span class="pre">parameter_equals</span></tt> - Returns true if a command-line parameter equals | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 410 | a given value. | 
|  | 411 | Example: <tt class="docutils literal"><span class="pre">(parameter_equals</span> <span class="pre">"W",</span> <span class="pre">"all")</span></tt>.</li> | 
|  | 412 | <li><tt class="docutils literal"><span class="pre">element_in_list</span></tt> - Returns true if a command-line parameter | 
|  | 413 | list contains a given value. | 
|  | 414 | Example: <tt class="docutils literal"><span class="pre">(parameter_in_list</span> <span class="pre">"l",</span> <span class="pre">"pthread")</span></tt>.</li> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 415 | <li><tt class="docutils literal"><span class="pre">input_languages_contain</span></tt> - Returns true if a given language | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 416 | belongs to the current input language set. | 
|  | 417 | Example: <tt class="docutils literal"><span class="pre">(input_languages_contain</span> <span class="pre">"c++")</span></tt>.</li> | 
|  | 418 | <li><tt class="docutils literal"><span class="pre">in_language</span></tt> - Evaluates to true if the input file language | 
|  | 419 | equals to the argument. At the moment works only with <tt class="docutils literal"><span class="pre">cmd_line</span></tt> | 
|  | 420 | and <tt class="docutils literal"><span class="pre">actions</span></tt> (on non-join nodes). | 
|  | 421 | Example: <tt class="docutils literal"><span class="pre">(in_language</span> <span class="pre">"c++")</span></tt>.</li> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 422 | <li><tt class="docutils literal"><span class="pre">not_empty</span></tt> - Returns true if a given option (which should be | 
|  | 423 | either a parameter or a parameter list) is set by the | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 424 | user. | 
|  | 425 | Example: <tt class="docutils literal"><span class="pre">(not_empty</span> <span class="pre">"o")</span></tt>.</li> | 
| Mikhail Glushenkov | 2d0484c | 2008-12-17 02:47:30 +0000 | [diff] [blame] | 426 | <li><tt class="docutils literal"><span class="pre">empty</span></tt> - The opposite of <tt class="docutils literal"><span class="pre">not_empty</span></tt>. Equivalent to <tt class="docutils literal"><span class="pre">(not</span> <span class="pre">(not_empty</span> | 
|  | 427 | <span class="pre">X))</span></tt>. Provided for convenience.</li> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 428 | <li><tt class="docutils literal"><span class="pre">default</span></tt> - Always evaluates to true. Should always be the last | 
|  | 429 | test in the <tt class="docutils literal"><span class="pre">case</span></tt> expression.</li> | 
|  | 430 | <li><tt class="docutils literal"><span class="pre">and</span></tt> - A standard logical combinator that returns true iff all | 
|  | 431 | of its arguments return true. Used like this: <tt class="docutils literal"><span class="pre">(and</span> <span class="pre">(test1),</span> | 
|  | 432 | <span class="pre">(test2),</span> <span class="pre">...</span> <span class="pre">(testN))</span></tt>. Nesting of <tt class="docutils literal"><span class="pre">and</span></tt> and <tt class="docutils literal"><span class="pre">or</span></tt> is allowed, | 
|  | 433 | but not encouraged.</li> | 
|  | 434 | <li><tt class="docutils literal"><span class="pre">or</span></tt> - Another logical combinator that returns true only if any | 
|  | 435 | one of its arguments returns true. Example: <tt class="docutils literal"><span class="pre">(or</span> <span class="pre">(test1),</span> | 
|  | 436 | <span class="pre">(test2),</span> <span class="pre">...</span> <span class="pre">(testN))</span></tt>.</li> | 
|  | 437 | </ul> | 
|  | 438 | </li> | 
|  | 439 | </ul> | 
| Reid Spencer | 46d2192 | 2004-08-22 18:06:59 +0000 | [diff] [blame] | 440 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 441 | <div class="section" id="writing-a-tool-description"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 442 | <h1><a class="toc-backref" href="#id13">Writing a tool description</a></h1> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 443 | <p>As was said earlier, nodes in the compilation graph represent tools, | 
|  | 444 | which are described separately. A tool definition looks like this | 
|  | 445 | (taken from the <tt class="docutils literal"><span class="pre">include/llvm/CompilerDriver/Tools.td</span></tt> file):</p> | 
|  | 446 | <pre class="literal-block"> | 
|  | 447 | def llvm_gcc_cpp : Tool<[ | 
|  | 448 | (in_language "c++"), | 
|  | 449 | (out_language "llvm-assembler"), | 
|  | 450 | (output_suffix "bc"), | 
|  | 451 | (cmd_line "llvm-g++ -c $INFILE -o $OUTFILE -emit-llvm"), | 
|  | 452 | (sink) | 
|  | 453 | ]>; | 
|  | 454 | </pre> | 
|  | 455 | <p>This defines a new tool called <tt class="docutils literal"><span class="pre">llvm_gcc_cpp</span></tt>, which is an alias for | 
|  | 456 | <tt class="docutils literal"><span class="pre">llvm-g++</span></tt>. As you can see, a tool definition is just a list of | 
|  | 457 | properties; most of them should be self-explanatory. The <tt class="docutils literal"><span class="pre">sink</span></tt> | 
|  | 458 | property means that this tool should be passed all command-line | 
|  | 459 | options that aren't mentioned in the option list.</p> | 
|  | 460 | <p>The complete list of all currently implemented tool properties follows.</p> | 
|  | 461 | <ul class="simple"> | 
|  | 462 | <li>Possible tool properties:<ul> | 
|  | 463 | <li><tt class="docutils literal"><span class="pre">in_language</span></tt> - input language name. Can be either a string or a | 
|  | 464 | list, in case the tool supports multiple input languages.</li> | 
|  | 465 | <li><tt class="docutils literal"><span class="pre">out_language</span></tt> - output language name. Tools are not allowed to | 
|  | 466 | have multiple output languages.</li> | 
|  | 467 | <li><tt class="docutils literal"><span class="pre">output_suffix</span></tt> - output file suffix. Can also be changed | 
|  | 468 | dynamically, see documentation on actions.</li> | 
|  | 469 | <li><tt class="docutils literal"><span class="pre">cmd_line</span></tt> - the actual command used to run the tool. You can | 
|  | 470 | use <tt class="docutils literal"><span class="pre">$INFILE</span></tt> and <tt class="docutils literal"><span class="pre">$OUTFILE</span></tt> variables, output redirection | 
|  | 471 | with <tt class="docutils literal"><span class="pre">></span></tt>, hook invocations (<tt class="docutils literal"><span class="pre">$CALL</span></tt>), environment variables | 
|  | 472 | (via <tt class="docutils literal"><span class="pre">$ENV</span></tt>) and the <tt class="docutils literal"><span class="pre">case</span></tt> construct.</li> | 
|  | 473 | <li><tt class="docutils literal"><span class="pre">join</span></tt> - this tool is a "join node" in the graph, i.e. it gets a | 
|  | 474 | list of input files and joins them together. Used for linkers.</li> | 
|  | 475 | <li><tt class="docutils literal"><span class="pre">sink</span></tt> - all command-line options that are not handled by other | 
|  | 476 | tools are passed to this tool.</li> | 
|  | 477 | <li><tt class="docutils literal"><span class="pre">actions</span></tt> - A single big <tt class="docutils literal"><span class="pre">case</span></tt> expression that specifies how | 
|  | 478 | this tool reacts on command-line options (described in more detail | 
|  | 479 | below).</li> | 
|  | 480 | </ul> | 
|  | 481 | </li> | 
|  | 482 | </ul> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 483 | <div class="section" id="actions"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 484 | <h2><a class="toc-backref" href="#id14">Actions</a></h2> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 485 | <p>A tool often needs to react to command-line options, and this is | 
|  | 486 | precisely what the <tt class="docutils literal"><span class="pre">actions</span></tt> property is for. The next example | 
|  | 487 | illustrates this feature:</p> | 
|  | 488 | <pre class="literal-block"> | 
|  | 489 | def llvm_gcc_linker : Tool<[ | 
|  | 490 | (in_language "object-code"), | 
|  | 491 | (out_language "executable"), | 
|  | 492 | (output_suffix "out"), | 
|  | 493 | (cmd_line "llvm-gcc $INFILE -o $OUTFILE"), | 
|  | 494 | (join), | 
|  | 495 | (actions (case (not_empty "L"), (forward "L"), | 
|  | 496 | (not_empty "l"), (forward "l"), | 
|  | 497 | (not_empty "dummy"), | 
|  | 498 | [(append_cmd "-dummy1"), (append_cmd "-dummy2")]) | 
|  | 499 | ]>; | 
|  | 500 | </pre> | 
|  | 501 | <p>The <tt class="docutils literal"><span class="pre">actions</span></tt> tool property is implemented on top of the omnipresent | 
|  | 502 | <tt class="docutils literal"><span class="pre">case</span></tt> expression. It associates one or more different <em>actions</em> | 
|  | 503 | with given conditions - in the example, the actions are <tt class="docutils literal"><span class="pre">forward</span></tt>, | 
|  | 504 | which forwards a given option unchanged, and <tt class="docutils literal"><span class="pre">append_cmd</span></tt>, which | 
|  | 505 | appends a given string to the tool execution command. Multiple actions | 
|  | 506 | can be associated with a single condition by using a list of actions | 
|  | 507 | (used in the example to append some dummy options). The same <tt class="docutils literal"><span class="pre">case</span></tt> | 
|  | 508 | construct can also be used in the <tt class="docutils literal"><span class="pre">cmd_line</span></tt> property to modify the | 
|  | 509 | tool command line.</p> | 
|  | 510 | <p>The "join" property used in the example means that this tool behaves | 
|  | 511 | like a linker.</p> | 
|  | 512 | <p>The list of all possible actions follows.</p> | 
|  | 513 | <ul> | 
|  | 514 | <li><p class="first">Possible actions:</p> | 
|  | 515 | <blockquote> | 
|  | 516 | <ul class="simple"> | 
|  | 517 | <li><tt class="docutils literal"><span class="pre">append_cmd</span></tt> - append a string to the tool invocation | 
|  | 518 | command. | 
| Mikhail Glushenkov | 2d0484c | 2008-12-17 02:47:30 +0000 | [diff] [blame] | 519 | Example: <tt class="docutils literal"><span class="pre">(case</span> <span class="pre">(switch_on</span> <span class="pre">"pthread"),</span> <span class="pre">(append_cmd</span> | 
|  | 520 | <span class="pre">"-lpthread"))</span></tt></li> | 
|  | 521 | <li><tt class="docutils literal"><span class="pre">error`</span> <span class="pre">-</span> <span class="pre">exit</span> <span class="pre">with</span> <span class="pre">error.</span> | 
|  | 522 | <span class="pre">Example:</span> <span class="pre">``(error</span> <span class="pre">"Mixing</span> <span class="pre">-c</span> <span class="pre">and</span> <span class="pre">-S</span> <span class="pre">is</span> <span class="pre">not</span> <span class="pre">allowed!")</span></tt>.</li> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 523 | <li><tt class="docutils literal"><span class="pre">forward</span></tt> - forward an option unchanged. | 
|  | 524 | Example: <tt class="docutils literal"><span class="pre">(forward</span> <span class="pre">"Wall")</span></tt>.</li> | 
|  | 525 | <li><tt class="docutils literal"><span class="pre">forward_as</span></tt> - Change the name of an option, but forward the | 
|  | 526 | argument unchanged. | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 527 | Example: <tt class="docutils literal"><span class="pre">(forward_as</span> <span class="pre">"O0",</span> <span class="pre">"--disable-optimization")</span></tt>.</li> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 528 | <li><tt class="docutils literal"><span class="pre">output_suffix</span></tt> - modify the output suffix of this | 
|  | 529 | tool. | 
|  | 530 | Example: <tt class="docutils literal"><span class="pre">(output_suffix</span> <span class="pre">"i")</span></tt>.</li> | 
|  | 531 | <li><tt class="docutils literal"><span class="pre">stop_compilation</span></tt> - stop compilation after this tool processes | 
|  | 532 | its input. Used without arguments.</li> | 
|  | 533 | <li><tt class="docutils literal"><span class="pre">unpack_values</span></tt> - used for for splitting and forwarding | 
|  | 534 | comma-separated lists of options, e.g. <tt class="docutils literal"><span class="pre">-Wa,-foo=bar,-baz</span></tt> is | 
|  | 535 | converted to <tt class="docutils literal"><span class="pre">-foo=bar</span> <span class="pre">-baz</span></tt> and appended to the tool invocation | 
|  | 536 | command. | 
|  | 537 | Example: <tt class="docutils literal"><span class="pre">(unpack_values</span> <span class="pre">"Wa,")</span></tt>.</li> | 
|  | 538 | </ul> | 
|  | 539 | </blockquote> | 
|  | 540 | </li> | 
|  | 541 | </ul> | 
|  | 542 | </div> | 
|  | 543 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 544 | <div class="section" id="language-map"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 545 | <h1><a class="toc-backref" href="#id15">Language map</a></h1> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 546 | <p>If you are adding support for a new language to LLVMC, you'll need to | 
|  | 547 | modify the language map, which defines mappings from file extensions | 
|  | 548 | to language names. It is used to choose the proper toolchain(s) for a | 
|  | 549 | given input file set. Language map definition looks like this:</p> | 
| Anton Korobeynikov | 7412031 | 2008-06-09 04:15:49 +0000 | [diff] [blame] | 550 | <pre class="literal-block"> | 
|  | 551 | def LanguageMap : LanguageMap< | 
|  | 552 | [LangToSuffixes<"c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]>, | 
|  | 553 | LangToSuffixes<"c", ["c"]>, | 
|  | 554 | ... | 
|  | 555 | ]>; | 
|  | 556 | </pre> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 557 | <p>For example, without those definitions the following command wouldn't work:</p> | 
|  | 558 | <pre class="literal-block"> | 
|  | 559 | $ llvmc hello.cpp | 
|  | 560 | llvmc: Unknown suffix: cpp | 
|  | 561 | </pre> | 
|  | 562 | <p>The language map entries should be added only for tools that are | 
|  | 563 | linked with the root node. Since tools are not allowed to have | 
|  | 564 | multiple output languages, for nodes "inside" the graph the input and | 
|  | 565 | output languages should match. This is enforced at compile-time.</p> | 
| Reid Spencer | 46d2192 | 2004-08-22 18:06:59 +0000 | [diff] [blame] | 566 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 567 | <div class="section" id="more-advanced-topics"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 568 | <h1><a class="toc-backref" href="#id16">More advanced topics</a></h1> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 569 | <div class="section" id="hooks-and-environment-variables"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 570 | <span id="hooks"></span><h2><a class="toc-backref" href="#id17">Hooks and environment variables</a></h2> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 571 | <p>Normally, LLVMC executes programs from the system <tt class="docutils literal"><span class="pre">PATH</span></tt>. Sometimes, | 
| Mikhail Glushenkov | 5303c75 | 2009-01-28 03:47:38 +0000 | [diff] [blame] | 572 | this is not sufficient: for example, we may want to specify tool paths | 
|  | 573 | or names in the configuration file. This can be easily achieved via | 
|  | 574 | the hooks mechanism. To write your own hooks, just add their | 
|  | 575 | definitions to the <tt class="docutils literal"><span class="pre">PluginMain.cpp</span></tt> or drop a <tt class="docutils literal"><span class="pre">.cpp</span></tt> file into the | 
|  | 576 | your plugin directory. Hooks should live in the <tt class="docutils literal"><span class="pre">hooks</span></tt> namespace | 
|  | 577 | and have the signature <tt class="docutils literal"><span class="pre">std::string</span> <span class="pre">hooks::MyHookName</span> <span class="pre">([const</span> <span class="pre">char*</span> | 
|  | 578 | <span class="pre">Arg0</span> <span class="pre">[</span> <span class="pre">const</span> <span class="pre">char*</span> <span class="pre">Arg2</span> <span class="pre">[,</span> <span class="pre">...]]])</span></tt>. They can be used from the | 
|  | 579 | <tt class="docutils literal"><span class="pre">cmd_line</span></tt> tool property:</p> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 580 | <pre class="literal-block"> | 
|  | 581 | (cmd_line "$CALL(MyHook)/path/to/file -o $CALL(AnotherHook)") | 
|  | 582 | </pre> | 
| Mikhail Glushenkov | 5303c75 | 2009-01-28 03:47:38 +0000 | [diff] [blame] | 583 | <p>To pass arguments to hooks, use the following syntax:</p> | 
|  | 584 | <pre class="literal-block"> | 
|  | 585 | (cmd_line "$CALL(MyHook, 'Arg1', 'Arg2', 'Arg # 3')/path/to/file -o1 -o2") | 
|  | 586 | </pre> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 587 | <p>It is also possible to use environment variables in the same manner:</p> | 
|  | 588 | <pre class="literal-block"> | 
|  | 589 | (cmd_line "$ENV(VAR1)/path/to/file -o $ENV(VAR2)") | 
|  | 590 | </pre> | 
|  | 591 | <p>To change the command line string based on user-provided options use | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 592 | the <tt class="docutils literal"><span class="pre">case</span></tt> expression (documented <a class="reference internal" href="#case">above</a>):</p> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 593 | <pre class="literal-block"> | 
|  | 594 | (cmd_line | 
|  | 595 | (case | 
|  | 596 | (switch_on "E"), | 
|  | 597 | "llvm-g++ -E -x c $INFILE -o $OUTFILE", | 
|  | 598 | (default), | 
|  | 599 | "llvm-g++ -c -x c $INFILE -o $OUTFILE -emit-llvm")) | 
|  | 600 | </pre> | 
|  | 601 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 602 | <div class="section" id="how-plugins-are-loaded"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 603 | <span id="priorities"></span><h2><a class="toc-backref" href="#id18">How plugins are loaded</a></h2> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 604 | <p>It is possible for LLVMC plugins to depend on each other. For example, | 
|  | 605 | one can create edges between nodes defined in some other plugin. To | 
|  | 606 | make this work, however, that plugin should be loaded first. To | 
|  | 607 | achieve this, the concept of plugin priority was introduced. By | 
|  | 608 | default, every plugin has priority zero; to specify the priority | 
|  | 609 | explicitly, put the following line in your plugin's TableGen file:</p> | 
|  | 610 | <pre class="literal-block"> | 
|  | 611 | def Priority : PluginPriority<$PRIORITY_VALUE>; | 
|  | 612 | # Where PRIORITY_VALUE is some integer > 0 | 
|  | 613 | </pre> | 
|  | 614 | <p>Plugins are loaded in order of their (increasing) priority, starting | 
|  | 615 | with 0. Therefore, the plugin with the highest priority value will be | 
|  | 616 | loaded last.</p> | 
|  | 617 | </div> | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 618 | <div class="section" id="debugging"> | 
| Mikhail Glushenkov | 502106a | 2009-06-16 00:14:20 +0000 | [diff] [blame] | 619 | <h2><a class="toc-backref" href="#id19">Debugging</a></h2> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 620 | <p>When writing LLVMC plugins, it can be useful to get a visual view of | 
|  | 621 | the resulting compilation graph. This can be achieved via the command | 
| Mikhail Glushenkov | d6d2efc | 2009-05-06 01:41:47 +0000 | [diff] [blame] | 622 | line option <tt class="docutils literal"><span class="pre">--view-graph</span></tt>. This command assumes that <a class="reference external" href="http://www.graphviz.org/">Graphviz</a> and | 
|  | 623 | <a class="reference external" href="http://pages.cs.wisc.edu/~ghost/">Ghostview</a> are installed. There is also a <tt class="docutils literal"><span class="pre">--write-graph</span></tt> option that | 
| Mikhail Glushenkov | d565203 | 2008-12-13 02:28:58 +0000 | [diff] [blame] | 624 | creates a Graphviz source file (<tt class="docutils literal"><span class="pre">compilation-graph.dot</span></tt>) in the | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 625 | current directory.</p> | 
| Mikhail Glushenkov | f9b1d79 | 2009-01-15 02:42:40 +0000 | [diff] [blame] | 626 | <p>Another useful <tt class="docutils literal"><span class="pre">llvmc</span></tt> option is <tt class="docutils literal"><span class="pre">--check-graph</span></tt>. It checks the | 
|  | 627 | compilation graph for common errors like mismatched output/input | 
|  | 628 | language names, multiple default edges and cycles. These checks can't | 
|  | 629 | be performed at compile-time because the plugins can load code | 
|  | 630 | dynamically. When invoked with <tt class="docutils literal"><span class="pre">--check-graph</span></tt>, <tt class="docutils literal"><span class="pre">llvmc</span></tt> doesn't | 
|  | 631 | perform any compilation tasks and returns the number of encountered | 
|  | 632 | errors as its status code.</p> | 
| Mikhail Glushenkov | 9053154 | 2008-12-11 23:43:14 +0000 | [diff] [blame] | 633 | <hr /> | 
| Anton Korobeynikov | 28b6670 | 2008-06-09 04:17:51 +0000 | [diff] [blame] | 634 | <address> | 
| Mikhail Glushenkov | d565203 | 2008-12-13 02:28:58 +0000 | [diff] [blame] | 635 | <a href="http://jigsaw.w3.org/css-validator/check/referer"> | 
|  | 636 | <img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" | 
|  | 637 | alt="Valid CSS" /></a> | 
|  | 638 | <a href="http://validator.w3.org/check?uri=referer"> | 
|  | 639 | <img src="http://www.w3.org/Icons/valid-xhtml10-blue" | 
|  | 640 | alt="Valid XHTML 1.0 Transitional"/></a> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 641 |  | 
| Mikhail Glushenkov | d565203 | 2008-12-13 02:28:58 +0000 | [diff] [blame] | 642 | <a href="mailto:foldr@codedgers.com">Mikhail Glushenkov</a><br /> | 
|  | 643 | <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br /> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 644 |  | 
| Mikhail Glushenkov | 4ad0d57 | 2009-03-27 12:58:29 +0000 | [diff] [blame] | 645 | Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ | 
| Mikhail Glushenkov | d565203 | 2008-12-13 02:28:58 +0000 | [diff] [blame] | 646 | </address></div> | 
| Mikhail Glushenkov | 68319f8 | 2008-12-11 23:24:40 +0000 | [diff] [blame] | 647 | </div> | 
|  | 648 | </div> | 
| Reid Spencer | b1254a1 | 2004-08-09 03:08:29 +0000 | [diff] [blame] | 649 | </body> | 
|  | 650 | </html> |