mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73597 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4aecec1f50
commit
63dc318085
@ -57,7 +57,7 @@ abstract graph. The structure of this graph is completely determined
|
|||||||
by plugins, which can be either statically or dynamically linked. This
|
by plugins, which can be either statically or dynamically linked. This
|
||||||
makes it possible to easily adapt LLVMC for other purposes - for
|
makes it possible to easily adapt LLVMC for other purposes - for
|
||||||
example, as a build tool for game resources.</p>
|
example, as a build tool for game resources.</p>
|
||||||
<p>Because LLVMC employs <a class="reference external" href="http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html">TableGen</a> as its configuration language, you
|
<p>Because LLVMC employs <a class="reference external" href="http://llvm.org/docs/TableGenFundamentals.html">TableGen</a> as its configuration language, you
|
||||||
need to be familiar with it to customize LLVMC.</p>
|
need to be familiar with it to customize LLVMC.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="compiling-with-llvmc">
|
<div class="section" id="compiling-with-llvmc">
|
||||||
@ -71,12 +71,12 @@ $ llvmc -O3 -Wall hello.cpp
|
|||||||
$ ./a.out
|
$ ./a.out
|
||||||
hello
|
hello
|
||||||
</pre>
|
</pre>
|
||||||
<p>One nice feature of LLVMC is that one doesn't have to distinguish
|
<p>One nice feature of LLVMC is that one doesn't have to distinguish between
|
||||||
between different compilers for different languages (think <tt class="docutils literal"><span class="pre">g++</span></tt> and
|
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
|
||||||
<tt class="docutils literal"><span class="pre">gcc</span></tt>) - the right toolchain is chosen automatically based on input
|
right toolchain is chosen automatically based on input language names (which
|
||||||
language names (which are, in turn, determined from file
|
are, in turn, determined from file extensions). If you want to force files
|
||||||
extensions). If you want to force files ending with ".c" to compile as
|
ending with ".c" to compile as C++, use the <tt class="docutils literal"><span class="pre">-x</span></tt> option, just like you would
|
||||||
C++, use the <tt class="docutils literal"><span class="pre">-x</span></tt> option, just like you would do it with <tt class="docutils literal"><span class="pre">gcc</span></tt>:</p>
|
do it with <tt class="docutils literal"><span class="pre">gcc</span></tt>:</p>
|
||||||
<pre class="literal-block">
|
<pre class="literal-block">
|
||||||
$ # hello.c is really a C++ file
|
$ # hello.c is really a C++ file
|
||||||
$ llvmc -x c++ hello.c
|
$ llvmc -x c++ hello.c
|
||||||
@ -158,13 +158,13 @@ $ mv Simple.td MyPlugin.td
|
|||||||
</pre>
|
</pre>
|
||||||
<p>To build your plugin as a dynamic library, just <tt class="docutils literal"><span class="pre">cd</span></tt> to its source
|
<p>To build your plugin as a dynamic library, just <tt class="docutils literal"><span class="pre">cd</span></tt> to its source
|
||||||
directory and run <tt class="docutils literal"><span class="pre">make</span></tt>. The resulting file will be called
|
directory and run <tt class="docutils literal"><span class="pre">make</span></tt>. The resulting file will be called
|
||||||
<tt class="docutils literal"><span class="pre">LLVMC$(LLVMC_PLUGIN).$(DLL_EXTENSION)</span></tt> (in our case,
|
<tt class="docutils literal"><span class="pre">plugin_llvmc_$(LLVMC_PLUGIN).$(DLL_EXTENSION)</span></tt> (in our case,
|
||||||
<tt class="docutils literal"><span class="pre">LLVMCMyPlugin.so</span></tt>). This library can be then loaded in with the
|
<tt class="docutils literal"><span class="pre">plugin_llvmc_MyPlugin.so</span></tt>). This library can be then loaded in with the
|
||||||
<tt class="docutils literal"><span class="pre">-load</span></tt> option. Example:</p>
|
<tt class="docutils literal"><span class="pre">-load</span></tt> option. Example:</p>
|
||||||
<pre class="literal-block">
|
<pre class="literal-block">
|
||||||
$ cd $LLVMC_DIR/plugins/Simple
|
$ cd $LLVMC_DIR/plugins/Simple
|
||||||
$ make
|
$ make
|
||||||
$ llvmc -load $LLVM_DIR/Release/lib/LLVMCSimple.so
|
$ llvmc -load $LLVM_DIR/Release/lib/plugin_llvmc_Simple.so
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="compiling-standalone-llvmc-based-drivers">
|
<div class="section" id="compiling-standalone-llvmc-based-drivers">
|
||||||
@ -197,7 +197,7 @@ $ make
|
|||||||
$ cd $LLVMC_DIR
|
$ cd $LLVMC_DIR
|
||||||
$ make LLVMC_BUILTIN_PLUGINS=MyPlugin LLVMC_BASED_DRIVER_NAME=mydriver
|
$ make LLVMC_BUILTIN_PLUGINS=MyPlugin LLVMC_BASED_DRIVER_NAME=mydriver
|
||||||
</pre>
|
</pre>
|
||||||
<p>This works with both srcdir==objdir and srcdir != objdir, but assumes that the
|
<p>This works with both srcdir == objdir and srcdir != objdir, but assumes that the
|
||||||
plugin source directory was placed under <tt class="docutils literal"><span class="pre">$LLVMC_DIR/plugins</span></tt>.</p>
|
plugin source directory was placed under <tt class="docutils literal"><span class="pre">$LLVMC_DIR/plugins</span></tt>.</p>
|
||||||
<p>Sometimes, you will want a 'bare-bones' version of LLVMC that has no
|
<p>Sometimes, you will want a 'bare-bones' version of LLVMC that has no
|
||||||
built-in plugins. It can be compiled with the following command:</p>
|
built-in plugins. It can be compiled with the following command:</p>
|
||||||
|
@ -48,12 +48,13 @@ command-line LLVMC usage, refer to the <tt class="docutils literal"><span class=
|
|||||||
</div>
|
</div>
|
||||||
<div class="section" id="using-llvmc-to-generate-toolchain-drivers">
|
<div class="section" id="using-llvmc-to-generate-toolchain-drivers">
|
||||||
<h1><a class="toc-backref" href="#id3">Using LLVMC to generate toolchain drivers</a></h1>
|
<h1><a class="toc-backref" href="#id3">Using LLVMC to generate toolchain drivers</a></h1>
|
||||||
<p>LLVMC plugins are written mostly using <a class="reference external" href="http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html">TableGen</a>, so you need to
|
<p>LLVMC plugins are written mostly using <a class="reference external" href="http://llvm.org/docs/TableGenFundamentals.html">TableGen</a>, so you need to
|
||||||
be familiar with it to get anything done.</p>
|
be familiar with it to get anything done.</p>
|
||||||
<p>Start by compiling <tt class="docutils literal"><span class="pre">example/Simple</span></tt>, which is a primitive wrapper for
|
<p>Start by compiling <tt class="docutils literal"><span class="pre">example/Simple</span></tt>, which is a primitive wrapper for
|
||||||
<tt class="docutils literal"><span class="pre">gcc</span></tt>:</p>
|
<tt class="docutils literal"><span class="pre">gcc</span></tt>:</p>
|
||||||
<pre class="literal-block">
|
<pre class="literal-block">
|
||||||
$ cd $LLVM_DIR/tools/llvmc
|
$ cd $LLVM_DIR/tools/llvmc
|
||||||
|
$ cp -r example/Simple plugins/Simple
|
||||||
|
|
||||||
# NB: A less verbose way to compile standalone LLVMC-based drivers is
|
# NB: A less verbose way to compile standalone LLVMC-based drivers is
|
||||||
# described in the reference manual.
|
# described in the reference manual.
|
||||||
|
Loading…
Reference in New Issue
Block a user