Regress to not using the llvm namespace.
[oota-llvm.git] / docs / ProgrammersManual.html
index 6c2659876b47ec34b67f8fff8fdb2f8c2b84aa64..bacb0d6b81bf0946016ae4ac59c1f4ea2b4abb4d 100644 (file)
@@ -49,6 +49,8 @@
                                         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 &amp; use-def
                                     chains</a>
     </ul>
@@ -164,6 +166,7 @@ library.  There are many good pages that discuss the STL, and several books on
 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
@@ -192,6 +195,20 @@ You are also encouraged to take a look at the <a
 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>&nbsp;</td><td width="100%">&nbsp; 
+<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>
@@ -487,7 +504,7 @@ a report that looks like this:<p>
      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
@@ -742,6 +759,31 @@ class OurFunctionPass : public FunctionPass {
 };
 </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 &amp;
 use-def chains</h4><ul>
@@ -1452,7 +1494,7 @@ list.<p>
 <li><tt>Function::BasicBlockListType &amp;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>
 
 
@@ -1467,12 +1509,12 @@ These are forwarding methods that make it easy to access the contents of a
 <li><tt>Function::ArgumentListType &amp;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,
@@ -1583,7 +1625,7 @@ list.<p>
 <li><tt>Module::FunctionListType &amp;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 -->
@@ -1601,7 +1643,7 @@ list.<p>
 <li><tt>Module::GlobalListType &amp;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>
 
 
@@ -1787,8 +1829,10 @@ pointer to the parent Function.
 <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>