pointer</a>
<li><a href="#iterate_complex">Finding call sites: a more complex
example</a>
+ <li><a href="#calls_and_invokes">Treating calls and invokes the
+ same way</a>
<li><a href="#iterate_chains">Iterating over def-use & use-def
chains</a>
</ul>
the subject that you can get, so it will not be discussed in this document.<p>
Here are some useful links:<p>
+
<ol>
<li><a href="http://www.dinkumware.com/refxcpp.html">Dinkumware C++
Library reference</a> - an excellent reference for the STL and other parts of
href="CodingStandards.html">LLVM Coding Standards</a> guide which focuses on how
to write maintainable code more than where to put your curly braces.<p>
+<!-- ======================================================================= -->
+</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
+<tr><td> </td><td width="100%">
+<font color="#EEEEFF" face="Georgia,Palatino"><b>
+<a name="stl">Other useful references</a>
+</b></font></td></tr></table><ul>
+
+LLVM is currently using CVS as its source versioning system. You may find this
+reference handy:<p>
+
+<ol>
+<li><a href="http://www.psc.edu/~semke/cvs_branches.html">CVS Branch and Tag
+Primer</a></li>
+</ol><p>
<!-- *********************************************************************** -->
</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
49 cee - Number of setcc instruction eliminated
532 gcse - Number of loads removed
2919 gcse - Number of instructions removed
- 86 indvars - Number of cannonical indvars added
+ 86 indvars - Number of canonical indvars added
87 indvars - Number of aux indvars removed
25 instcombine - Number of dead inst eliminate
434 instcombine - Number of insts combined
};
</pre>
+
+<!--_______________________________________________________________________-->
+</ul><h4><a name="calls_and_invokes"><hr size=0>Treating calls and
+invokes the same way</h4><ul>
+
+<p>You may have noticed that the previous example was a bit
+oversimplified in that it did not deal with call sites generated by
+'invoke' instructions. In this, and in other situations, you may find
+that you want to treat <tt>CallInst</tt>s and <tt>InvokeInst</tt>s the
+same way, even though their most-specific common base class is
+<tt>Instruction</tt>, which includes lots of less closely-related
+things. For these cases, LLVM provides a handy wrapper class called <a
+href="http://llvm.cs.uiuc.edu/doxygen/classCallSite.html"><tt>CallSite
+</tt></a>. It is essentially a wrapper around an <tt>Instruction</tt>
+pointer, with some methods that provide functionality common to
+<tt>CallInst</tt>s and <tt>InvokeInst</tt>s.</p>
+
+<p>This class is supposed to have "value semantics". So it should be
+passed by value, not by reference; it should not be dynamically
+allocated or deallocated using <tt>operator new</tt> or <tt>operator
+delete</tt>. It is efficiently copyable, assignable and constructable,
+with costs equivalents to that of a bare pointer. (You will notice, if
+you look at its definition, that it has only a single data member.)</p>
+
+
<!--_______________________________________________________________________-->
</ul><h4><a name="iterate_chains"><hr size=0>Iterating over def-use &
use-def chains</h4><ul>
<li><tt>Function::BasicBlockListType &getBasicBlockList()</tt><p>
Returns the list of <a href="#BasicBlock"><tt>BasicBlock</tt></a>s. This is
-neccesary to use when you need to update the list or perform a complex action
+necessary to use when you need to update the list or perform a complex action
that doesn't have a forwarding method.<p>
<li><tt>Function::ArgumentListType &getArgumentList()</tt><p>
Returns the list of <a href="#Argument"><tt>Argument</tt></a>s. This is
-neccesary to use when you need to update the list or perform a complex action
+necessary to use when you need to update the list or perform a complex action
that doesn't have a forwarding method.<p>
-<li><tt><a href="#BasicBlock">BasicBlock</a> &getEntryNode()</tt><p>
+<li><tt><a href="#BasicBlock">BasicBlock</a> &getEntryBlock()</tt><p>
Returns the entry <a href="#BasicBlock"><tt>BasicBlock</tt></a> for the
function. Because the entry block for the function is always the first block,
<li><tt>Module::FunctionListType &getFunctionList()</tt><p>
Returns the list of <a href="#Function"><tt>Function</tt></a>s. This is
-neccesary to use when you need to update the list or perform a complex action
+necessary to use when you need to update the list or perform a complex action
that doesn't have a forwarding method.<p>
<!-- Global Variable -->
<li><tt>Module::GlobalListType &getGlobalList()</tt><p>
Returns the list of <a href="#GlobalVariable"><tt>GlobalVariable</tt></a>s.
-This is neccesary to use when you need to update the list or perform a complex
+This is necessary to use when you need to update the list or perform a complex
action that doesn't have a forwarding method.<p>
<hr><font size-1>
<address>By: <a href="mailto:dhurjati@cs.uiuc.edu">Dinakar Dhurjati</a> and
<a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
+<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
+<br>
<!-- Created: Tue Aug 6 15:00:33 CDT 2002 -->
<!-- hhmts start -->
-Last modified: Tue Aug 5 17:53:43 CDT 2003
+Last modified: Fri Nov 7 13:24:22 CST 2003
<!-- hhmts end -->
</font></body></html>