LLVM tutorial ported (Max Shawabkeh) (Issue #33)

git-svn-id: http://llvm-py.googlecode.com/svn/trunk@94 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
mdevan.foobar 2010-09-26 08:25:14 +00:00
commit 60422c6057
27 changed files with 18381 additions and 102 deletions

View file

@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.5.3" />
<meta name="generator" content="AsciiDoc 8.6.1" />
<meta name="description" content="Python bindings for LLVM" />
<meta name="keywords" content="llvm python compiler backend bindings" />
<link rel="stylesheet" href="style/xhtml11.css" type="text/css" />
@ -31,9 +31,11 @@
<div id="header">
<h1>Examples and LLVM Tutorials</h1>
</div>
<div class="sect1">
<h2 id="_examples">Examples</h2>
<div class="sectionbody">
<h3 id="_a_simple_function">A Simple Function</h3><div style="clear:left"></div>
<div class="sect2">
<h3 id="_a_simple_function">A Simple Function</h3>
<div class="paragraph"><p>Let&#8217;s create a (LLVM) module containing a single function, corresponding
to the <tt>C</tt> function:</p></div>
<div class="listingblock">
@ -106,7 +108,9 @@ entry:
ret i32 %tmp
}</tt></pre>
</div></div>
<h3 id="_adding_jit_compilation">Adding JIT Compilation</h3><div style="clear:left"></div>
</div>
<div class="sect2">
<h3 id="_adding_jit_compilation">Adding JIT Compilation</h3>
<div class="paragraph"><p>Let&#8217;s compile this function in-memory and run it.</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
@ -151,75 +155,74 @@ retval <span style="color: #990000">=</span> ee<span style="color: #990000">.</s
<pre><tt>returned 142</tt></pre>
</div></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_llvm_tutorials">LLVM Tutorials</h2>
<div class="sectionbody">
<div class="paragraph"><p>The <a href="http://www.llvm.org/docs/tutorial/">LLVM tutorials</a> have been
ported to llvm-py. Below are the links to the original LLVM tutorial and
the corresponding Python code using llvm-py:</p></div>
<div class="paragraph"><div class="title">Simple JIT Tutorials</div><p>(contributed by Sebastien Binet)</p></div>
<div class="paragraph"><div class="title">Simple JIT Tutorials</div><p>The following JIT tutorials were contributed by Sebastien Binet.</p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
A First Function
<a href="http://www.llvm.org/docs/tutorial/JITTutorial1.html">LLVM</a>
<a href="examples/JITTutorial1.html">llvm-py</a>
<a href="examples/JITTutorial1.html">A First Function</a>
</p>
</li>
<li>
<p>
A More Complicated Function
<a href="http://www.llvm.org/docs/tutorial/JITTutorial2.html">LLVM</a>
<a href="examples/JITTutorial2.html">llvm-py</a>
<a href="examples/JITTutorial2.html">A More Complicated Function</a>
</p>
</li>
</ol></div>
<div class="olist arabic"><div class="title">Kaleidoscope: Implementing a Language with LLVM</div><ol class="arabic">
<div class="paragraph" id="kaleidoscope"><div class="title">Kaleidoscope: Implementing a Language with LLVM</div><p>The LLVM <a href="http://www.llvm.org/docs/tutorial/">Kaleidoscope</a> tutorial
has been ported to llvm-py by Max Shawabkeh.</p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
Tutorial Introduction and the Lexer (TODO)
<a href="kaleidoscope/PythonLangImpl1.html">Tutorial Introduction and the Lexer</a>
</p>
</li>
<li>
<p>
Implementing a Parser and AST (TODO)
<a href="kaleidoscope/PythonLangImpl2.html">Implementing a Parser and AST</a>
</p>
</li>
<li>
<p>
Implementing Code Generation to LLVM IR (TODO)
<a href="kaleidoscope/PythonLangImpl3.html">Implementing Code Generation to LLVM IR</a>
</p>
</li>
<li>
<p>
Adding JIT and Optimizer Support (TODO)
<a href="kaleidoscope/PythonLangImpl4.html">Adding JIT and Optimizer Support</a>
</p>
</li>
<li>
<p>
Extending the language: control flow (TODO)
<a href="kaleidoscope/PythonLangImpl5.html">Extending the language: control flow</a>
</p>
</li>
<li>
<p>
Extending the language: user-defined operators (TODO)
<a href="kaleidoscope/PythonLangImpl6.html">Extending the language: user-defined operators</a>
</p>
</li>
<li>
<p>
Extending the language: mutable variables / SSA construction (TODO)
<a href="kaleidoscope/PythonLangImpl7.html">Extending the language: mutable variables / SSA construction</a>
</p>
</li>
<li>
<p>
Conclusion and other useful LLVM tidbits (TODO)
<a href="kaleidoscope/PythonLangImpl8.html">Conclusion and other useful LLVM tidbits</a>
</p>
</li>
</ol></div>
</div>
</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 2010-08-31.
Last updated 2010-09-26.
</div>
</div>
</div>