summaryrefslogtreecommitdiff
path: root/docs/CompilerDriver.html
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-06-30 00:16:43 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-06-30 00:16:43 +0000
commite25b845b437cdee395d22c9e2f292fc2dec9521d (patch)
treea61c38f5304f01cd51d6b3f2590c1803b02882a3 /docs/CompilerDriver.html
parente8e4d588c3511697d7e274bd44e2d080337e1ba3 (diff)
downloadllvm-e25b845b437cdee395d22c9e2f292fc2dec9521d.tar.gz
llvm-e25b845b437cdee395d22c9e2f292fc2dec9521d.tar.bz2
llvm-e25b845b437cdee395d22c9e2f292fc2dec9521d.tar.xz
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.html27
1 files changed, 24 insertions, 3 deletions
diff --git a/docs/CompilerDriver.html b/docs/CompilerDriver.html
index d0bb72396c..d84aacf14b 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, &quot;mydriver&quot;) == 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">