Updated documentation.

git-svn-id: http://llvm-py.googlecode.com/svn/trunk@20 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
mdevan.foobar 2008-06-24 14:35:30 +00:00
commit 4c27a1c376
12 changed files with 920 additions and 45 deletions

View file

@ -11,6 +11,12 @@ SKIP_FILES = [ 'layout.conf', '.svn', 'instrset.inc' ]
# asciidoc command line
ASCIIDOC = 'asciidoc --unsafe --conf-file=${srcdir}/layout.conf -a icons -o ${outfile} ${infile}'
# specialized ASCIIDOC for certain files
# - this is a hack trying to look generic
ASCIIDOC_PERFILE = {
'userguide.txt': ASCIIDOC.replace('-a icons', '-a icons -a toc')
}
def _is_older(inp, outp):
older = True
@ -29,7 +35,8 @@ def asciidoc(opts, srcdir, inp, outp):
if _is_older(inp, outp) or opts.force:
if opts.verbose:
print "asciidoc %s -> %s" % (inp, outp)
cmd = Template(ASCIIDOC).substitute(srcdir=srcdir, infile=inp, outfile=outp)
asciidoc = ASCIIDOC_PERFILE.get(os.path.split(inp)[-1], ASCIIDOC)
cmd = Template(asciidoc).substitute(srcdir=srcdir, infile=inp, outfile=outp)
if opts.verbose >= 3:
print "asciidoc command is [%s]" % cmd
if not opts.dryrun:

View file

@ -5,7 +5,7 @@ llvm-py is just hatching. It needs your patches and suggestions to
grow up. Please contribute! All patches are welcome. Here are some links
to start hacking away:
`40`60~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`75`25~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Google code hosting, http://code.google.com/p/llvm-py/[http://code.google.com/p/llvm-py/]
Browse SVN, http://code.google.com/p/llvm-py/source/browse/[http://code.google.com/p/llvm-py/source/browse]
Issues tracker, http://code.google.com/p/llvm-py/issues/list[http://code.google.com/p/llvm-py/issues/list]
@ -24,6 +24,7 @@ Current Next Steps
------------------
- Wrap GenericValue, function call args for execution engine.
* done.
- Add APIs to read/write `.bc` and `.ll` files.
- Wrap `lto`.
- Add examples.

67
www/src/js/toc.js Normal file
View file

@ -0,0 +1,67 @@
/* Author: Mihai Bazon, September 2002
* http://students.infoiasi.ro/~mishoo
*
* Table Of Content generator
* Version: 0.4
*
* Feel free to use this script under the terms of the GNU General Public
* License, as long as you do not remove or alter this notice.
*/
/* modified by Troy D. Hanson, September 2006. License: GPL */
/* modified by Stuart Rackham, October 2006. License: GPL */
function getText(el) {
var text = "";
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
text += i.data;
else if (i.firstChild != null)
text += getText(i);
}
return text;
}
function TocEntry(el, text, toclevel) {
this.element = el;
this.text = text;
this.toclevel = toclevel;
}
function tocEntries(el, toclevels) {
var result = new Array;
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
var iterate = function (el) {
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
var mo = re.exec(i.tagName)
if (mo)
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
iterate(i);
}
}
}
iterate(el);
return result;
}
// This function does the work. toclevels = 1..4.
function generateToc(toclevels) {
var toc = document.getElementById("toc");
var entries = tocEntries(document.getElementsByTagName("body")[0], toclevels);
for (var i = 0; i < entries.length; ++i) {
var entry = entries[i];
if (entry.element.id == "")
entry.element.id = "toc" + i;
var a = document.createElement("a");
a.href = "#" + entry.element.id;
a.appendChild(document.createTextNode(entry.text));
var div = document.createElement("div");
div.appendChild(a);
div.className = "toclevel" + entry.toclevel;
toc.appendChild(div);
}
}

View file

@ -41,6 +41,14 @@ monospacedwords=(?u)\\?\basciidoc\(1\) (?u)\\?\ba2x\(1\)
<link rel="stylesheet" href="style/{theme={backend}}.css" type="text/css" />
<link rel="stylesheet" href="style/{theme={backend}}-quirks.css" type="text/css" />
<link rel="stylesheet" href="style/layout.css" type="text/css" />
ifdef::toc[]
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function()\{generateToc({toclevels=2})\}
/*]]>*/
</script>
<script type="text/javascript" src="js/toc.js"></script>
endif::toc[]
<title>{doctitle} - llvm-py</title>
</head>
<body>
@ -58,14 +66,18 @@ monospacedwords=(?u)\\?\basciidoc\(1\) (?u)\\?\ba2x\(1\)
<div>&#187;<a href="contribute.html">Contribute</a></div>
<div>&#187;<a href="license.html">License</a></div>
<div>&#187;<a href="about.html">About</a></div>
<div id="page-source">&#187;<a href="http://www.python.org/">Python</a></div>
<div>&#187;<a href="http://llvm.org/">LLVM</a></div>
</td>
<td>
<div id="layout-content">
<div id="header">
<h1>{doctitle}</h1>
</div>
ifdef::toc[]
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
endif::toc[]
[footer]
<div id="footer">
@ -81,8 +93,6 @@ Last updated {localdate}.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4519056-2");
pageTracker._initData();
pageTracker._trackPageview();

View file

@ -1,7 +1,8 @@
llvm-py User Guide
===================
NOTE: This document is updated constantly. Check back often.
NOTE: This document is updated frequently (last updated on {localdate}).
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
@ -899,6 +900,118 @@ r1 = Constant.real(tr, "3.141592") # create from a string
r2 = Constant.real(tr, 1.61803399) # create from a Python float
source~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following constructors (static methods) can be used to create
constants:
[frame="all",grid="all"]
`25`75~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Constructor Method, What It Creates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`null(ty)`, A null value (all zeros) of type `ty`
`all_ones(ty)`, All 1's value of type `ty`
`undef(ty)`, An ``undefined'' value of type `ty`
"`int(ty, value)`", "Integer of type `ty`, with value `value` (a Python int or long)"
"`int_signextend(ty, value)`", Integer of signed type `ty` (use for signed types)
"`real(ty, value)`", "Floating point value of type `ty`, with value `value` (a Python float)"
"`stringz(value)`", "A null-terminated string. `value` is a Python string"
"`string(value)`", "As `string(ty)`, but not null terminated"
"`array(ty, consts)`", "Array of type `ty`, initialized with `consts` (an iterable yielding `Constant` objects of the appropriate type)"
"`struct(ty, consts)`", "Struct (unpacked) of type `ty`, initialized with `consts` (an iterable yielding `Constant` objects of the appropriate type)"
"`packed_struct(ty, consts)`", "As `struct(ty, consts)` but packed"
"`vector(consts)`", "Vector, initialized with `consts` (an iterable yielding `Constant` objects of the appropriate type)"
"`sizeof(ty)`", "Constant value representing the sizeof the type `ty`"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following operations are available:
[frame="all",grid="all"]
`25`75~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Method, Operation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`k.neg()`, "negation, same as `0 - k`"
`k.not_()`, "1's complement of `k`. Note trailing underscore."
`k.add(k2)`, "`k + k2`"
`k.sub(k2)`, "`k - k2`"
`k.mul(k2)`, "`k * k2`"
`k.udiv(k2)`, "Quotient of unsigned division of `k` with `k2`"
`k.sdiv(k2)`, "Quotient of signed division of `k` with `k2`"
`k.fdiv(k2)`, "Quotient of floating point division of `k` with `k2`"
`k.urem(k2)`, "Reminder of unsigned division of `k` with `k2`"
`k.srem(k2)`, "Reminder of signed division of `k` with `k2`"
`k.frem(k2)`, "Reminder of floating point division of `k` with `k2`"
`k.and_(k2)`, "Bitwise and of `k` and `k2`. Note trailing underscore."
`k.or_(k2)`, "Bitwise or of `k` and `k2`. Note trailing underscore."
`k.xor(k2)`, "Bitwise exclusive-or of `k` and `k2`."
"`k.icmp(ipred, k2)`", "Compare `k` with `k2` using the predicate `ipred`. See table link:#ipred[below] for list of predicates for integer operands."
"`k.fcmp(rpred, k2)`", "Compare `k` with `k2` using the predicate `rpred`. See table link:#rpred[below] for list of predicates for real operands."
shl, TODO
lshr, TODO
ashr, TODO
gep, TODO
trunc, TODO
sext, TODO
zext, TODO
fptrunc, TODO
fpext, TODO
uitofp, TODO
sitofp, TODO
fptoui, TODO
fptosi, TODO
ptrtoint, TODO
inttoptr, TODO
bitcast, TODO
select, TODO
extract_element, TODO
insert_element, TODO
shuffle_vector, TODO
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[[ipred]]
Predicates for use with `icmp` instruction are listed below. All
of these are integer constants defined in the `llvm.core` module.
[frame="all",grid="all"]
`25`75~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Value, Meaning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`IPRED_EQ`, Equality
`IPRED_NE`, Inequality
`IPRED_UGT`, Unsigned greater than
`IPRED_UGE`, Unsigned greater than or equal
`IPRED_ULT`, Unsigned less than
`IPRED_ULE`, Unsigned less than or equal
`IPRED_SGT`, Signed greater than
`IPRED_SGE`, Signed greater than or equal
`IPRED_SLT`, Signed less than
`IPRED_SLE`, Signed less than or equal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[[rpred]]
Predicates for use with `fcmp` instruction are listed below. All
of these are integer constants defined in the `llvm.core` module.
[frame="all",grid="all"]
`25`75~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Value, Meaning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`RPRED_FALSE`,
`RPRED_OEQ`,
`RPRED_OGT`,
`RPRED_OGE`,
`RPRED_OLT`,
`RPRED_OLE`,
`RPRED_ONE`,
`RPRED_ORD`,
`RPRED_UNO`,
`RPRED_UEQ`,
`RPRED_UGT`,
`RPRED_UGE`,
`RPRED_ULT`,
`RPRED_ULE`,
`RPRED_UNE`,
`RPRED_TRUE `,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeHandle (llvm.core)

View file

@ -25,8 +25,6 @@
<div>&#187;<a href="contribute.html">Contribute</a></div>
<div>&#187;<a href="license.html">License</a></div>
<div>&#187;<a href="about.html">About</a></div>
<div id="page-source">&#187;<a href="http://www.python.org/">Python</a></div>
<div>&#187;<a href="http://llvm.org/">LLVM</a></div>
</td>
<td>
<div id="layout-content">
@ -44,7 +42,7 @@ llvm-dev mailing list and irc.oftc.net#llvm (mdevan).</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 18-Jun-2008.
Last updated 24-Jun-2008.
</div>
</div>
</div>
@ -54,8 +52,6 @@ Last updated 18-Jun-2008.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4519056-2");
pageTracker._initData();
pageTracker._trackPageview();

View file

@ -25,8 +25,6 @@
<div>&#187;<a href="contribute.html">Contribute</a></div>
<div>&#187;<a href="license.html">License</a></div>
<div>&#187;<a href="about.html">About</a></div>
<div id="page-source">&#187;<a href="http://www.python.org/">Python</a></div>
<div>&#187;<a href="http://llvm.org/">LLVM</a></div>
</td>
<td>
<div id="layout-content">
@ -42,8 +40,8 @@ to start hacking away:</p>
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="320" />
<col width="480" />
<col width="600" />
<col width="200" />
<tbody valign="top">
<tr>
<td align="left">
@ -88,6 +86,13 @@ queries.</p>
<p>
Wrap GenericValue, function call args for execution engine.
</p>
<ul>
<li>
<p>
done.
</p>
</li>
</ul>
</li>
<li>
<p>
@ -119,7 +124,7 @@ Improve tests.
<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 18-Jun-2008.
Last updated 24-Jun-2008.
</div>
</div>
</div>
@ -129,8 +134,6 @@ Last updated 18-Jun-2008.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4519056-2");
pageTracker._initData();
pageTracker._trackPageview();

View file

@ -25,8 +25,6 @@
<div>&#187;<a href="contribute.html">Contribute</a></div>
<div>&#187;<a href="license.html">License</a></div>
<div>&#187;<a href="about.html">About</a></div>
<div id="page-source">&#187;<a href="http://www.python.org/">Python</a></div>
<div>&#187;<a href="http://llvm.org/">LLVM</a></div>
</td>
<td>
<div id="layout-content">
@ -151,7 +149,7 @@ package.</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 18-Jun-2008.
Last updated 24-Jun-2008.
</div>
</div>
</div>
@ -161,8 +159,6 @@ Last updated 18-Jun-2008.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4519056-2");
pageTracker._initData();
pageTracker._trackPageview();

View file

@ -25,8 +25,6 @@
<div>&#187;<a href="contribute.html">Contribute</a></div>
<div>&#187;<a href="license.html">License</a></div>
<div>&#187;<a href="about.html">About</a></div>
<div id="page-source">&#187;<a href="http://www.python.org/">Python</a></div>
<div>&#187;<a href="http://llvm.org/">LLVM</a></div>
</td>
<td>
<div id="layout-content">
@ -102,7 +100,7 @@ entry:
<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 18-Jun-2008.
Last updated 24-Jun-2008.
</div>
</div>
</div>
@ -112,8 +110,6 @@ Last updated 18-Jun-2008.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4519056-2");
pageTracker._initData();
pageTracker._trackPageview();

View file

@ -25,8 +25,6 @@
<div>&#187;<a href="contribute.html">Contribute</a></div>
<div>&#187;<a href="license.html">License</a></div>
<div>&#187;<a href="about.html">About</a></div>
<div id="page-source">&#187;<a href="http://www.python.org/">Python</a></div>
<div>&#187;<a href="http://llvm.org/">LLVM</a></div>
</td>
<td>
<div id="layout-content">
@ -78,7 +76,7 @@ miss any specific LLVM API.</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 18-Jun-2008.
Last updated 24-Jun-2008.
</div>
</div>
</div>
@ -88,8 +86,6 @@ Last updated 18-Jun-2008.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4519056-2");
pageTracker._initData();
pageTracker._trackPageview();

View file

@ -25,8 +25,6 @@
<div>&#187;<a href="contribute.html">Contribute</a></div>
<div>&#187;<a href="license.html">License</a></div>
<div>&#187;<a href="about.html">About</a></div>
<div id="page-source">&#187;<a href="http://www.python.org/">Python</a></div>
<div>&#187;<a href="http://llvm.org/">LLVM</a></div>
</td>
<td>
<div id="layout-content">
@ -76,7 +74,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</tt></pre>
<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 18-Jun-2008.
Last updated 24-Jun-2008.
</div>
</div>
</div>
@ -86,8 +84,6 @@ Last updated 18-Jun-2008.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4519056-2");
pageTracker._initData();
pageTracker._trackPageview();

View file

@ -8,6 +8,12 @@
<link rel="stylesheet" href="style/xhtml11.css" type="text/css" />
<link rel="stylesheet" href="style/xhtml11-quirks.css" type="text/css" />
<link rel="stylesheet" href="style/layout.css" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){generateToc(2)}
/*]]>*/
</script>
<script type="text/javascript" src="js/toc.js"></script>
<title>llvm-py User Guide - llvm-py</title>
</head>
<body>
@ -25,14 +31,16 @@
<div>&#187;<a href="contribute.html">Contribute</a></div>
<div>&#187;<a href="license.html">License</a></div>
<div>&#187;<a href="about.html">About</a></div>
<div id="page-source">&#187;<a href="http://www.python.org/">Python</a></div>
<div>&#187;<a href="http://llvm.org/">LLVM</a></div>
</td>
<td>
<div id="layout-content">
<div id="header">
<h1>llvm-py User Guide</h1>
</div>
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
<div id="preamble">
<div class="sectionbody">
<div class="admonitionblock">
@ -40,7 +48,8 @@
<td class="icon">
<img src="./images/icons/note.png" alt="Note" />
</td>
<td class="content">This document is updated constantly. Check back often.</td>
<td class="content">This document is updated frequently (last updated on 24-Jun-2008).
Check back often.</td>
</tr></table>
</div>
<p>llvm-py provides Python bindings for LLVM. This document explains how
@ -1672,6 +1681,693 @@ tr <span style="color: #990000">=</span> <span style="color: #009900">Type</span
r1 <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">real</span></span><span style="color: #990000">(</span>tr<span style="color: #990000">,</span> <span style="color: #FF0000">"3.141592"</span><span style="color: #990000">)</span> <span style="font-style: italic"><span style="color: #9A1900"># create from a string</span></span>
r2 <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">real</span></span><span style="color: #990000">(</span>tr<span style="color: #990000">,</span> <span style="color: #993399">1.61803399</span><span style="color: #990000">)</span> <span style="font-style: italic"><span style="color: #9A1900"># create from a Python float</span></span>
</tt></pre></div></div>
<p>The following constructors (static methods) can be used to create
constants:</p>
<div class="tableblock">
<table rules="all"
frame="border"
cellspacing="0" cellpadding="4">
<col width="200" />
<col width="600" />
<thead>
<tr>
<th align="left">
Constructor Method
</th>
<th align="left">
What It Creates
</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">
<tt>null(ty)</tt>
</td>
<td align="left">
A null value (all zeros) of type <tt>ty</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>all_ones(ty)</tt>
</td>
<td align="left">
All 1's value of type <tt>ty</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>undef(ty)</tt>
</td>
<td align="left">
An &#8220;undefined&#8221; value of type <tt>ty</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>int(ty, value)</tt>
</td>
<td align="left">
Integer of type <tt>ty</tt>, with value <tt>value</tt> (a Python int or long)
</td>
</tr>
<tr>
<td align="left">
<tt>int_signextend(ty, value)</tt>
</td>
<td align="left">
Integer of signed type <tt>ty</tt> (use for signed types)
</td>
</tr>
<tr>
<td align="left">
<tt>real(ty, value)</tt>
</td>
<td align="left">
Floating point value of type <tt>ty</tt>, with value <tt>value</tt> (a Python float)
</td>
</tr>
<tr>
<td align="left">
<tt>stringz(value)</tt>
</td>
<td align="left">
A null-terminated string. <tt>value</tt> is a Python string
</td>
</tr>
<tr>
<td align="left">
<tt>string(value)</tt>
</td>
<td align="left">
As <tt>string(ty)</tt>, but not null terminated
</td>
</tr>
<tr>
<td align="left">
<tt>array(ty, consts)</tt>
</td>
<td align="left">
Array of type <tt>ty</tt>, initialized with <tt>consts</tt> (an iterable yielding <tt>Constant</tt> objects of the appropriate type)
</td>
</tr>
<tr>
<td align="left">
<tt>struct(ty, consts)</tt>
</td>
<td align="left">
Struct (unpacked) of type <tt>ty</tt>, initialized with <tt>consts</tt> (an iterable yielding <tt>Constant</tt> objects of the appropriate type)
</td>
</tr>
<tr>
<td align="left">
<tt>packed_struct(ty, consts)</tt>
</td>
<td align="left">
As <tt>struct(ty, consts)</tt> but packed
</td>
</tr>
<tr>
<td align="left">
<tt>vector(consts)</tt>
</td>
<td align="left">
Vector, initialized with <tt>consts</tt> (an iterable yielding <tt>Constant</tt> objects of the appropriate type)
</td>
</tr>
<tr>
<td align="left">
<tt>sizeof(ty)</tt>
</td>
<td align="left">
Constant value representing the sizeof the type <tt>ty</tt>
</td>
</tr>
</tbody>
</table>
</div>
<p>The following operations are available:</p>
<div class="tableblock">
<table rules="all"
frame="border"
cellspacing="0" cellpadding="4">
<col width="200" />
<col width="600" />
<thead>
<tr>
<th align="left">
Method
</th>
<th align="left">
Operation
</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">
<tt>k.neg()</tt>
</td>
<td align="left">
negation, same as <tt>0 - k</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.not_()</tt>
</td>
<td align="left">
1's complement of <tt>k</tt>. Note trailing underscore.
</td>
</tr>
<tr>
<td align="left">
<tt>k.add(k2)</tt>
</td>
<td align="left">
<tt>k + k2</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.sub(k2)</tt>
</td>
<td align="left">
<tt>k - k2</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.mul(k2)</tt>
</td>
<td align="left">
<tt>k * k2</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.udiv(k2)</tt>
</td>
<td align="left">
Quotient of unsigned division of <tt>k</tt> with <tt>k2</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.sdiv(k2)</tt>
</td>
<td align="left">
Quotient of signed division of <tt>k</tt> with <tt>k2</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.fdiv(k2)</tt>
</td>
<td align="left">
Quotient of floating point division of <tt>k</tt> with <tt>k2</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.urem(k2)</tt>
</td>
<td align="left">
Reminder of unsigned division of <tt>k</tt> with <tt>k2</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.srem(k2)</tt>
</td>
<td align="left">
Reminder of signed division of <tt>k</tt> with <tt>k2</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.frem(k2)</tt>
</td>
<td align="left">
Reminder of floating point division of <tt>k</tt> with <tt>k2</tt>
</td>
</tr>
<tr>
<td align="left">
<tt>k.and_(k2)</tt>
</td>
<td align="left">
Bitwise and of <tt>k</tt> and <tt>k2</tt>. Note trailing underscore.
</td>
</tr>
<tr>
<td align="left">
<tt>k.or_(k2)</tt>
</td>
<td align="left">
Bitwise or of <tt>k</tt> and <tt>k2</tt>. Note trailing underscore.
</td>
</tr>
<tr>
<td align="left">
<tt>k.xor(k2)</tt>
</td>
<td align="left">
Bitwise exclusive-or of <tt>k</tt> and <tt>k2</tt>.
</td>
</tr>
<tr>
<td align="left">
<tt>k.icmp(ipred, k2)</tt>
</td>
<td align="left">
Compare <tt>k</tt> with <tt>k2</tt> using the predicate <tt>ipred</tt>. See table <a href="#ipred">below</a> for list of predicates for integer operands.
</td>
</tr>
<tr>
<td align="left">
<tt>k.fcmp(rpred, k2)</tt>
</td>
<td align="left">
Compare <tt>k</tt> with <tt>k2</tt> using the predicate <tt>rpred</tt>. See table <a href="#rpred">below</a> for list of predicates for real operands.
</td>
</tr>
<tr>
<td align="left">
shl
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
lshr
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
ashr
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
gep
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
trunc
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
sext
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
zext
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
fptrunc
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
fpext
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
uitofp
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
sitofp
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
fptoui
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
fptosi
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
ptrtoint
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
inttoptr
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
bitcast
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
select
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
extract_element
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
insert_element
</td>
<td align="left">
TODO
</td>
</tr>
<tr>
<td align="left">
shuffle_vector
</td>
<td align="left">
TODO
</td>
</tr>
</tbody>
</table>
</div>
<p><a id="ipred"></a>Predicates for use with <tt>icmp</tt> instruction are listed below. All
of these are integer constants defined in the <tt>llvm.core</tt> module.</p>
<div class="tableblock">
<table rules="all"
frame="border"
cellspacing="0" cellpadding="4">
<col width="200" />
<col width="600" />
<thead>
<tr>
<th align="left">
Value
</th>
<th align="left">
Meaning
</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">
<tt>IPRED_EQ</tt>
</td>
<td align="left">
Equality
</td>
</tr>
<tr>
<td align="left">
<tt>IPRED_NE</tt>
</td>
<td align="left">
Inequality
</td>
</tr>
<tr>
<td align="left">
<tt>IPRED_UGT</tt>
</td>
<td align="left">
Unsigned greater than
</td>
</tr>
<tr>
<td align="left">
<tt>IPRED_UGE</tt>
</td>
<td align="left">
Unsigned greater than or equal
</td>
</tr>
<tr>
<td align="left">
<tt>IPRED_ULT</tt>
</td>
<td align="left">
Unsigned less than
</td>
</tr>
<tr>
<td align="left">
<tt>IPRED_ULE</tt>
</td>
<td align="left">
Unsigned less than or equal
</td>
</tr>
<tr>
<td align="left">
<tt>IPRED_SGT</tt>
</td>
<td align="left">
Signed greater than
</td>
</tr>
<tr>
<td align="left">
<tt>IPRED_SGE</tt>
</td>
<td align="left">
Signed greater than or equal
</td>
</tr>
<tr>
<td align="left">
<tt>IPRED_SLT</tt>
</td>
<td align="left">
Signed less than
</td>
</tr>
<tr>
<td align="left">
<tt>IPRED_SLE</tt>
</td>
<td align="left">
Signed less than or equal
</td>
</tr>
</tbody>
</table>
</div>
<p><a id="rpred"></a>Predicates for use with <tt>fcmp</tt> instruction are listed below. All
of these are integer constants defined in the <tt>llvm.core</tt> module.</p>
<div class="tableblock">
<table rules="all"
frame="border"
cellspacing="0" cellpadding="4">
<col width="200" />
<col width="600" />
<thead>
<tr>
<th align="left">
Value
</th>
<th align="left">
Meaning
</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">
<tt>RPRED_FALSE</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_OEQ</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_OGT</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_OGE</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_OLT</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_OLE</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_ONE</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_ORD</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_UNO</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_UEQ</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_UGT</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_UGE</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_ULT</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_ULE</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_UNE</tt>
</td>
<td align="left">
</td>
</tr>
<tr>
<td align="left">
<tt>RPRED_TRUE </tt>
</td>
<td align="left">
</td>
</tr>
</tbody>
</table>
</div>
<h3>TypeHandle (llvm.core)</h3>
<p>TODO</p>
<h3>Instructions (llvm.core)</h3>
@ -1717,7 +2413,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 18-Jun-2008.
Last updated 24-Jun-2008.
</div>
</div>
</div>
@ -1727,8 +2423,6 @@ Last updated 18-Jun-2008.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4519056-2");
pageTracker._initData();
pageTracker._trackPageview();