New tests. Code cleanup.

git-svn-id: http://llvm-py.googlecode.com/svn/trunk@11 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
mdevan.foobar 2008-06-14 19:05:45 +00:00
commit 274f0f9ec4
16 changed files with 638 additions and 113 deletions

View file

@ -6,7 +6,7 @@ from string import Template
from optparse import OptionParser
# files in src dir that should not be copied to web dir
SKIP_FILES = [ 'layout.conf', '.svn' ]
SKIP_FILES = [ 'layout.conf', '.svn', 'instrset.inc' ]
# asciidoc command line
ASCIIDOC = 'asciidoc --unsafe --conf-file=${srcdir}/layout.conf -a icons -o ${outfile} ${infile}'

View file

@ -11,7 +11,6 @@ Browse SVN, http://code.google.com/p/llvm-py/source/browse/[http://code.google.c
Issues tracker, http://code.google.com/p/llvm-py/issues/list[http://code.google.com/p/llvm-py/issues/list]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SVN HEAD can be checked out like so:
----
@ -21,3 +20,12 @@ $ svn checkout http://llvm-py.googlecode.com/svn/trunk/ llvm-py
Mahadevan R (mdevan.foobar@gmail.com) is available to answer your
queries.
Current Next Steps
------------------
- Wrap GenericValue, function call args for execution engine.
- Add APIs to read/write `.bc` and `.ll` files.
- Wrap `lto`.
- Add examples.
- Update documentation.
- Improve tests.

View file

@ -6,9 +6,11 @@ http://llvm.org/[LLVM]. It's goal is to expose enough of LLVM APIs to
implement a compiler or VM in pure Python. Currently, llvm-py is
available for LLVM 2.3 and Python 2.5, on Linux/x86. It is expected to
be usable on various unices, as well as with Python 2.4, with minimal
changes, if any. It should be stable enough for you to play with.
changes, if any.
llvm-py is just hatching, and your contributions would be most welcome.
llvm-py is just hatching. It should be stable enough to start hacking
away, though. Be sure to send in a patch (or shout at the author) if you
miss any specific LLVM API.
News
----

View file

@ -1,6 +1,8 @@
llvm-py User Guide
===================
NOTE: This document is updated constantly. Check back often.
llvm-py provides Python bindings for LLVM. This document explains how
you can setup and use it. A working knowledge of Python and a basic idea
of LLVM is assumed.
@ -46,7 +48,7 @@ llvm-py is distributed as a source tarball. You'll need to build and
install it before it can be used. At least the following will be
required for this:
- compilers, both gcc and g++
- C and C\+\+ compilers (gcc/g\+\+)
- Python itself
- Python development files (headers and libraries)
- LLVM, either installed or built
@ -56,7 +58,11 @@ command `sudo apt-get install gcc g++ python python-dev'. Note that
ubuntu repository has an old version of llvm (1.8) which will not work
with llvm-py.
Tip: If LLVM 2.3 does not install cleanly, try installing 'ocamldoc'
It does not matter which compiler LLVM itself was built with (g\+\+,
llvm-g\+\+ or any other); llvm-py can be built with any compiler. It has
been tried only with gcc/g\+\+ though.
Tip: If LLVM 2.3 does not install cleanly, try installing ``ocamldoc''
first.
@ -108,11 +114,16 @@ libraries of LLVM, use this:
$ tar jxvf llvm-py-0.2.tar.bz2
$ cd llvm-py-0.2
$ python setup.py build -g --llvm-config=/home/mdevan/llvm/Debug/bin/llvm-config
$ sudo python setup.py install -g --llvm-config=/home/mdevan/llvm/Debug/bin/llvm-config
$ sudo python setup.py install --llvm-config=/home/mdevan/llvm/Debug/bin/llvm-config
-----------------------------------------------------------------------
Be warned that debug binaries will be huge (65MB+) !
`setup.py` is a standard Python distutils script. See the Python
documentation regarding http://docs.python.org/inst/inst.html[Installing
Python Modules] and http://docs.python.org/dist/dist.html[Distributing
Python Modules] for more information on such scripts.
[[uninstall]]
Uninstall
@ -891,6 +902,12 @@ r3 = Constant.undef() # an `undefined' value
source~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeHandle (llvm.core)
~~~~~~~~~~~~~~~~~~~~~~
TODO
Instructions (llvm.core)
~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -81,10 +81,45 @@ cellspacing="0" cellpadding="4">
queries.</p>
</div>
</div>
<h2>Current Next Steps</h2>
<div class="sectionbody">
<ul>
<li>
<p>
Wrap GenericValue, function call args for execution engine.
</p>
</li>
<li>
<p>
Add APIs to read/write <tt>.bc</tt> and <tt>.ll</tt> files.
</p>
</li>
<li>
<p>
Wrap <tt>lto</tt>.
</p>
</li>
<li>
<p>
Add examples.
</p>
</li>
<li>
<p>
Update documentation.
</p>
</li>
<li>
<p>
Improve tests.
</p>
</li>
</ul>
</div>
<div id="footer">
<div id="footer-text">
Web pages &copy; Mahadevan R. Generated with <a href="http://www.methods.co.nz/asciidoc/">asciidoc</a>.
Last updated 10-Jun-2008.
Last updated 15-Jun-2008.
</div>
</div>
</div>

View file

@ -40,8 +40,10 @@
implement a compiler or VM in pure Python. Currently, llvm-py is
available for LLVM 2.3 and Python 2.5, on Linux/x86. It is expected to
be usable on various unices, as well as with Python 2.4, with minimal
changes, if any. It should be stable enough for you to play with.</p>
<p>llvm-py is just hatching, and your contributions would be most welcome.</p>
changes, if any.</p>
<p>llvm-py is just hatching. It should be stable enough to start hacking
away, though. Be sure to send in a patch (or shout at the author) if you
miss any specific LLVM API.</p>
</div>
</div>
<h2>News</h2>
@ -60,7 +62,7 @@ changes, if any. It should be stable enough for you to play with.</p>
<div id="footer">
<div id="footer-text">
Web pages &copy; Mahadevan R. Generated with <a href="http://www.methods.co.nz/asciidoc/">asciidoc</a>.
Last updated 10-Jun-2008.
Last updated 15-Jun-2008.
</div>
</div>
</div>

View file

@ -35,6 +35,14 @@
</div>
<div id="preamble">
<div class="sectionbody">
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="./images/icons/note.png" alt="Note" />
</td>
<td class="content">This document is updated constantly. Check back often.</td>
</tr></table>
</div>
<p>llvm-py provides Python bindings for LLVM. This document explains how
you can setup and use it. A working knowledge of Python and a basic idea
of LLVM is assumed.</p>
@ -73,7 +81,7 @@ required for this:</p>
<ul>
<li>
<p>
compilers, both gcc and g++
C and C++ compilers (gcc/g++)
</p>
</li>
<li>
@ -96,7 +104,10 @@ LLVM, either installed or built
command `sudo apt-get install gcc g++ python python-dev'. Note that
ubuntu repository has an old version of llvm (1.8) which will not work
with llvm-py.</p>
<p>Tip: If LLVM 2.3 does not install cleanly, try installing <em>ocamldoc</em>
<p>It does not matter which compiler LLVM itself was built with (g++,
llvm-g++ or any other); llvm-py can be built with any compiler. It has
been tried only with gcc/g++ though.</p>
<p>Tip: If LLVM 2.3 does not install cleanly, try installing &#8220;ocamldoc&#8221;
first.</p>
<h3>llvm-config</h3>
<p>Inorder to build llvm-py, it's build script needs to know from where to
@ -136,9 +147,13 @@ libraries of LLVM, use this:</p>
<pre><tt>$ tar jxvf llvm-py-0.2.tar.bz2
$ cd llvm-py-0.2
$ python setup.py build -g --llvm-config=/home/mdevan/llvm/Debug/bin/llvm-config
$ sudo python setup.py install -g --llvm-config=/home/mdevan/llvm/Debug/bin/llvm-config</tt></pre>
$ sudo python setup.py install --llvm-config=/home/mdevan/llvm/Debug/bin/llvm-config</tt></pre>
</div></div>
<p>Be warned that debug binaries will be huge (65MB+) !</p>
<p><tt>setup.py</tt> is a standard Python distutils script. See the Python
documentation regarding <a href="http://docs.python.org/inst/inst.html">Installing
Python Modules</a> and <a href="http://docs.python.org/dist/dist.html">Distributing
Python Modules</a> for more information on such scripts.</p>
<h3><a id="uninstall"></a>Uninstall</h3>
<p>To get rid of llvm-py completely, if you wish to do so:</p>
<div class="listingblock">
@ -1659,6 +1674,8 @@ r2 <span style="color: #990000">=</span> <span style="color: #009900">Constant</
r3 <span style="color: #990000">=</span> <span style="color: #009900">Constant</span><span style="color: #990000">.</span><span style="font-weight: bold"><span style="color: #000000">undef</span></span><span style="color: #990000">()</span> <span style="font-style: italic"><span style="color: #9A1900"># an `undefined' value</span></span>
</tt></pre></div></div>
<h3>TypeHandle (llvm.core)</h3>
<p>TODO</p>
<h3>Instructions (llvm.core)</h3>
<p>TODO</p>
<h3>Basic Block (llvm.core)</h3>
@ -1702,7 +1719,7 @@ reached at <em>mdevan.foobar@gmail.com</em>.</p>
<div id="footer">
<div id="footer-text">
Web pages &copy; Mahadevan R. Generated with <a href="http://www.methods.co.nz/asciidoc/">asciidoc</a>.
Last updated 12-Jun-2008.
Last updated 15-Jun-2008.
</div>
</div>
</div>