diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-06-30 00:16:43 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-06-30 00:16:43 +0000 |
commit | e25b845b437cdee395d22c9e2f292fc2dec9521d (patch) | |
tree | a61c38f5304f01cd51d6b3f2590c1803b02882a3 /docs/CompilerDriver.html | |
parent | e8e4d588c3511697d7e274bd44e2d080337e1ba3 (diff) | |
download | external_llvm-e25b845b437cdee395d22c9e2f292fc2dec9521d.zip external_llvm-e25b845b437cdee395d22c9e2f292fc2dec9521d.tar.gz external_llvm-e25b845b437cdee395d22c9e2f292fc2dec9521d.tar.bz2 |
Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/CompilerDriver.html')
-rw-r--r-- | docs/CompilerDriver.html | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/docs/CompilerDriver.html b/docs/CompilerDriver.html index d0bb723..d84aacf 100644 --- a/docs/CompilerDriver.html +++ b/docs/CompilerDriver.html @@ -37,6 +37,7 @@ The ReST source lives in the directory 'tools/llvmc/doc'. --> <li><a class="reference internal" href="#hooks-and-environment-variables" id="id17">Hooks and environment variables</a></li> <li><a class="reference internal" href="#how-plugins-are-loaded" id="id18">How plugins are loaded</a></li> <li><a class="reference internal" href="#debugging" id="id19">Debugging</a></li> +<li><a class="reference internal" href="#conditioning-on-the-executable-name" id="id20">Conditioning on the executable name</a></li> </ul> </li> </ul> @@ -94,9 +95,8 @@ $ llvmc --linker=c++ hello.o $ ./a.out hello </pre> -<p>By default, LLVMC uses <tt class="docutils literal"><span class="pre">llvm-gcc</span></tt> to compile the source code. It is -also possible to choose the work-in-progress <tt class="docutils literal"><span class="pre">clang</span></tt> compiler with -the <tt class="docutils literal"><span class="pre">-clang</span></tt> option.</p> +<p>By default, LLVMC uses <tt class="docutils literal"><span class="pre">llvm-gcc</span></tt> to compile the source code. It is also +possible to choose the <tt class="docutils literal"><span class="pre">clang</span></tt> compiler with the <tt class="docutils literal"><span class="pre">-clang</span></tt> option.</p> </div> <div class="section" id="predefined-options"> <h1><a class="toc-backref" href="#id6">Predefined options</a></h1> @@ -633,6 +633,27 @@ be performed at compile-time because the plugins can load code 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 perform any compilation tasks and returns the number of encountered errors as its status code.</p> +</div> +<div class="section" id="conditioning-on-the-executable-name"> +<h2><a class="toc-backref" href="#id20">Conditioning on the executable name</a></h2> +<p>For now, the executable name (the value passed to the driver in <tt class="docutils literal"><span class="pre">argv[0]</span></tt>) is +accessible only in the C++ code (i.e. hooks). Use the following code:</p> +<pre class="literal-block"> +namespace llvmc { +extern const char* ProgramName; +} + +std::string MyHook() { +//... +if (strcmp(ProgramName, "mydriver") == 0) { + //... + +} +</pre> +<p>In general, you're encouraged not to make the behaviour dependent on the +executable file name, and use command-line switches instead. See for example how +the <tt class="docutils literal"><span class="pre">Base</span></tt> plugin behaves when it needs to choose the correct linker options +(think <tt class="docutils literal"><span class="pre">g++</span></tt> vs. <tt class="docutils literal"><span class="pre">gcc</span></tt>).</p> <hr /> <address> <a href="http://jigsaw.w3.org/css-validator/check/referer"> |