<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>LLVM Programmer's Manual</title></head>
<body bgcolor=white>
<table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td> <font size=+3 color="#EEEEFF" face="Georgia,Palatino,Times,Roman"><b>LLVM Programmer's Manual</b></font></td>
</tr></table>
<ol>
<li><a href="#introduction">Introduction</a>
<li><a href="#general">General Information</a>
<ul>
<li><a href="#stl">The C++ Standard Template Library</a>
<li>The isa<>, cast<> and dyn_cast<> templates
</ul>
<li><a href="#common">Helpful Hints for Common Operations</a>
<ul>
<li><a href="#inspection">Basic Inspection and Traversal Routines</a>
<ul>
<li><a href="#iterate_function">Iterating over the <tt>BasicBlock</tt>s
in a <tt>Function</tt></a>
<li><a href="#iterate_basicblock">Iterating over the <tt>Instruction</tt>s
in a <tt>BasicBlock</tt></a>
<li><a href="#iterate_convert">Turning an iterator into a class
pointer</a>
</ul>
<li><a href="#simplechanges">Making simple changes</a>
<ul>
<li>Creating and inserting new <tt>Instruction</tt>s
<li>Deleting <tt>Instruction</tt>s
<li>Replacing an <tt>Instruction</tt> with another <tt>Value</tt>
</ul>
<!--
<li>Working with the Control Flow Graph
<ul>
<li>Accessing predecessors and successors of a <tt>BasicBlock</tt>
<li>
<li>
</ul>
-->
<li>Useful LLVM APIs
<ul>
<li>isa<>, cast<>, and dyn_cast<> templates
<!--
<li>The general graph API
<li>The <tt>InstVisitor</tt> template
<li>The DEBUG() macro
<li>The <tt>Statistic</tt> template
-->
</ul>
<!--
<li>Useful related topics
<ul>
<li>The <tt>-time-passes</tt> option
<li>How to use the LLVM Makefile system
<li>How to write a regression test
<li>
</ul>
-->
</ul>
<li><a href="#coreclasses">The Core LLVM Class Heirarchy Reference</a>
<ul>
<li><a href="#Value">The <tt>Value</tt> class</a>
<ul>
<li><a href="#User">The <tt>User</tt> class</a>
<ul>
<li><a href="#Instruction">The <tt>Instruction</tt> class</a>
<ul>
<li>
<li>
</ul>
<li><a href="#GlobalValue">The <tt>GlobalValue</tt> class</a>
<ul>
<li><a href="#BasicBlock">The <tt>BasicBlock</tt> class</a>
<li><a href="#Function">The <tt>Function</tt> class</a>
<li><a href="#GlobalVariable">The <tt>GlobalVariable</tt> class</a>
</ul>
<li><a href="#Module">The <tt>Module</tt> class</a>
<li><a href="#Constant">The <tt>Constant</tt> class</a>
<ul>
<li>
<li>
</ul>
</ul>
<li><a href="#Type">The <tt>Type</tt> class</a>
<li><a href="#Argument">The <tt>Argument</tt> class</a>
</ul>
<li>The <tt>SymbolTable</tt> class
<li>The <tt>ilist</tt> and <tt>iplist</tt> classes
<ul>
<li>Creating, inserting, moving and deleting from LLVM lists
</ul>
<li>Important iterator invalidation semantics to be aware of
</ul>
<p><b>Written by <a href="mailto:dhurjati@cs.uiuc.edu">Dinakar Dhurjati</a>
and <a href="mailto:sabre@nondot.org">Chris Lattner</a></b><p>
</ol>
<!-- *********************************************************************** -->
<table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
<a name