statisfy the spelling police
[oota-llvm.git] / docs / ProgrammersManual.html
index 5cfd0ea56c7d85599b9343bb615acb6e37da7add..741d66b386847f2cef30f16c5d58af557648b647 100644 (file)
@@ -187,9 +187,9 @@ reference</a> - an excellent reference for the STL and other parts of the
 standard C++ library.</li>
 
 <li><a href="http://www.tempest-sw.com/cpp/">C++ In a Nutshell</a> - This is an
-O'Reilly book in the making.  It has a decent <a
-href="http://www.tempest-sw.com/cpp/ch13-libref.html">Standard Library
-Reference</a> that rivals Dinkumware's, and is actually free until the book is
+O'Reilly book in the making.  It has a decent 
+Standard Library
+Reference that rivals Dinkumware's, and is unfortunately no longer free since the book has been 
 published.</li>
 
 <li><a href="http://www.parashift.com/c++-faq-lite/">C++ Frequently Asked
@@ -222,12 +222,11 @@ to write maintainable code more than where to put your curly braces.</p>
 
 <div class="doc_text">
 
-<p>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/%7Esemke/cvs_branches.html">CVS
 Branch and Tag Primer</a></li>
+<li><a href="http://www.fortran-2000.com/ArnaudRecipes/sharedlib.html">Using
+static and shared libraries across platforms</a></li>
 </ol>
 
 </div>
@@ -690,7 +689,7 @@ this, and in other situations, you may find that you want to treat
 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>.
+href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1CallSite.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>
@@ -711,17 +710,18 @@ If you look at its definition, it has only a single pointer member.</p>
 <div class="doc_text">
 
 <p>Frequently, we might have an instance of the <a
-href="/doxygen/classValue.html">Value Class</a> and we want to determine which
-<tt>User</tt>s use the <tt>Value</tt>.  The list of all <tt>User</tt>s of a
-particular <tt>Value</tt> is called a <i>def-use</i> chain. For example, let's
-say we have a <tt>Function*</tt> named <tt>F</tt> to a particular function
-<tt>foo</tt>. Finding all of the instructions that <i>use</i> <tt>foo</tt> is as
-simple as iterating over the <i>def-use</i> chain of <tt>F</tt>:</p>
+href="/doxygen/structllvm_1_1Value.html">Value Class</a> and we want to
+determine which <tt>User</tt>s use the <tt>Value</tt>.  The list of all
+<tt>User</tt>s of a particular <tt>Value</tt> is called a <i>def-use</i> chain.
+For example, let's say we have a <tt>Function*</tt> named <tt>F</tt> to a
+particular function <tt>foo</tt>. Finding all of the instructions that
+<i>use</i> <tt>foo</tt> is as simple as iterating over the <i>def-use</i> chain
+of <tt>F</tt>:</p>
 
   <pre>Function* F = ...;<br><br>for (Value::use_iterator i = F-&gt;use_begin(), e = F-&gt;use_end(); i != e; ++i) {<br>    if (Instruction *Inst = dyn_cast&lt;Instruction&gt;(*i)) {<br>        cerr &lt;&lt; "F is used in instruction:\n";<br>        cerr &lt;&lt; *Inst &lt;&lt; "\n";<br>    }<br>}<br></pre>
 
 <p>Alternately, it's common to have an instance of the <a
-href="/doxygen/classUser.html">User Class</a> and need to know what
+href="/doxygen/classllvm_1_1User.html">User Class</a> and need to know what
 <tt>Value</tt>s are used by it.  The list of all <tt>Value</tt>s used by a
 <tt>User</tt> is known as a <i>use-def</i> chain.  Instances of class
 <tt>Instruction</tt> are common <tt>User</tt>s, so we might want to iterate over
@@ -773,7 +773,7 @@ parameters. For example, an <tt>AllocaInst</tt> only <i>requires</i> a
 one integer in the current stack frame, at runtime. Each <tt>Instruction</tt>
 subclass is likely to have varying default parameters which change the semantics
 of the instruction, so refer to the <a
-href="/doxygen/classInstruction.html">doxygen documentation for the subclass of
+href="/doxygen/classllvm_1_1Instruction.html">doxygen documentation for the subclass of
 Instruction</a> that you're interested in instantiating.</p>
 
 <p><i>Naming values</i></p>
@@ -808,7 +808,22 @@ into an existing sequence of instructions that form a <tt>BasicBlock</tt>:</p>
     <tt>BasicBlock</tt>, and a newly-created instruction we wish to insert
     before <tt>*pi</tt>, we do the following: </p>
 
-      <pre>  BasicBlock *pb = ...;<br>  Instruction *pi = ...;<br>  Instruction *newInst = new Instruction(...);<br>  pb-&gt;getInstList().insert(pi, newInst); // inserts newInst before pi in pb<br></pre></li>
+      <pre>  BasicBlock *pb = ...;<br>  Instruction *pi = ...;<br>  Instruction *newInst = new Instruction(...);<br>  pb-&gt;getInstList().insert(pi, newInst); // inserts newInst before pi in pb<br></pre>
+
+    <p>Appending to the end of a <tt>BasicBlock</tt> is so common that
+    the <tt>Instruction</tt> class and <tt>Instruction</tt>-derived
+    classes provide constructors which take a pointer to a
+    <tt>BasicBlock</tt> to be appended to. For example code that
+    looked like: </p>
+
+      <pre>  BasicBlock *pb = ...;<br>  Instruction *newInst = new Instruction(...);<br>  pb-&gt;getInstList().push_back(newInst); // appends newInst to pb<br></pre>
+
+    <p>becomes: </p>
+
+      <pre>  BasicBlock *pb = ...;<br>  Instruction *newInst = new Instruction(..., pb);<br></pre>
+
+    <p>which is much cleaner, especially if you are creating
+    long instruction streams.</p></li>
 
   <li>Insertion into an implicit instruction list
 
@@ -897,8 +912,8 @@ and <tt>ReplaceInstWithInst</tt>.</p>
 
 <p>You can use <tt>Value::replaceAllUsesWith</tt> and
 <tt>User::replaceUsesOfWith</tt> to change more than one use at a time.  See the
-doxygen documentation for the <a href="/doxygen/classValue.html">Value Class</a>
-and <a href="/doxygen/classUser.html">User Class</a>, respectively, for more
+doxygen documentation for the <a href="/doxygen/structllvm_1_1Value.html">Value Class</a>
+and <a href="/doxygen/classllvm_1_1User.html">User Class</a>, respectively, for more
 information.</p>
 
 <!-- Value::replaceAllUsesWith User::replaceUsesOfWith Point out:
@@ -931,7 +946,7 @@ the <tt>lib/VMCore</tt> directory.</p>
 
 <p><tt>#include "<a href="/doxygen/Value_8h-source.html">llvm/Value.h</a>"</tt>
 <br> 
-doxygen info: <a href="/doxygen/classValue.html">Value Class</a></p>
+doxygen info: <a href="/doxygen/structllvm_1_1Value.html">Value Class</a></p>
 
 <p>The <tt>Value</tt> class is the most important class in the LLVM Source
 base.  It represents a typed value that may be used (among other things) as an
@@ -1032,7 +1047,7 @@ be aware of the <a href="#nameWarning">precaution above</a>.</p>
   
 <p>
 <tt>#include "<a href="/doxygen/User_8h-source.html">llvm/User.h</a>"</tt><br>
-doxygen info: <a href="/doxygen/classUser.html">User Class</a><br>
+doxygen info: <a href="/doxygen/classllvm_1_1User.html">User Class</a><br>
 Superclass: <a href="#Value"><tt>Value</tt></a></p>
 
 <p>The <tt>User</tt> class is the common base class of all LLVM nodes that may
@@ -1086,7 +1101,7 @@ the operands of a <tt>User</tt>.</p></li>
 
 <p><tt>#include "</tt><tt><a
 href="/doxygen/Instruction_8h-source.html">llvm/Instruction.h</a>"</tt><br>
-doxygen info: <a href="/doxygen/classInstruction.html">Instruction Class</a><br>
+doxygen info: <a href="/doxygen/classllvm_1_1Instruction.html">Instruction Class</a><br>
 Superclasses: <a href="#User"><tt>User</tt></a>, <a
 href="#Value"><tt>Value</tt></a></p>
 
@@ -1111,7 +1126,7 @@ concrete sub-classes of <tt>Instruction</tt> that implement the instruction (for
 example <tt><a href="#BinaryOperator">BinaryOperator</a></tt> and <tt><a
 href="#SetCondInst">SetCondInst</a></tt>).  Unfortunately, the use of macros in
 this file confuses doxygen, so these enum values don't show up correctly in the
-<a href="/doxygen/classInstruction.html">doxygen output</a>.</p>
+<a href="/doxygen/classllvm_1_1Instruction.html">doxygen output</a>.</p>
 
 </div>
 
@@ -1148,8 +1163,10 @@ and it has no name</p></li>
 
 <div class="doc_text">
 
-<p><tt>#include "<a href="/doxygen/BasicBlock_8h-source.html">llvm/BasicBlock.h</a>"</tt><br>
-doxygen info: <a href="/doxygen/classBasicBlock.html">BasicBlock Class</a><br>
+<p><tt>#include "<a
+href="/doxygen/BasicBlock_8h-source.html">llvm/BasicBlock.h</a>"</tt><br>
+doxygen info: <a href="/doxygen/structllvm_1_1BasicBlock.html">BasicBlock
+Class</a><br>
 Superclass: <a href="#Value"><tt>Value</tt></a></p>
 
 <p>This class represents a single entry multiple exit section of the code,
@@ -1229,7 +1246,8 @@ terminator, then a null pointer is returned.</p></li>
 
 <p><tt>#include "<a
 href="/doxygen/GlobalValue_8h-source.html">llvm/GlobalValue.h</a>"</tt><br>
-doxygen info: <a href="/doxygen/classGlobalValue.html">GlobalValue Class</a><br>
+doxygen info: <a href="/doxygen/classllvm_1_1GlobalValue.html">GlobalValue
+Class</a><br>
 Superclasses: <a href="#User"><tt>User</tt></a>, <a
 href="#Value"><tt>Value</tt></a></p>
 
@@ -1297,8 +1315,8 @@ GlobalValue is currently embedded into.</p></li>
 
 <p><tt>#include "<a
 href="/doxygen/Function_8h-source.html">llvm/Function.h</a>"</tt><br> doxygen
-info: <a href="/doxygen/classFunction.html">Function Class</a><br> Superclasses:
-<a href="#GlobalValue"><tt>GlobalValue</tt></a>, <a
+info: <a href="/doxygen/classllvm_1_1Function.html">Function Class</a><br>
+Superclasses: <a href="#GlobalValue"><tt>GlobalValue</tt></a>, <a
 href="#User"><tt>User</tt></a>, <a href="#Value"><tt>Value</tt></a></p>
 
 <p>The <tt>Function</tt> class represents a single procedure in LLVM.  It is
@@ -1431,7 +1449,7 @@ iterator<br>
 <p><tt>#include "<a
 href="/doxygen/GlobalVariable_8h-source.html">llvm/GlobalVariable.h</a>"</tt>
 <br>
-doxygen info: <a href="/doxygen/classGlobalVariable.html">GlobalVariable
+doxygen info: <a href="/doxygen/classllvm_1_1GlobalVariable.html">GlobalVariable
 Class</a><br> Superclasses: <a href="#GlobalValue"><tt>GlobalValue</tt></a>, <a
 href="#User"><tt>User</tt></a>, <a href="#Value"><tt>Value</tt></a></p>
 
@@ -1500,7 +1518,7 @@ change at runtime).</p>
 
 <p><tt>#include "<a
 href="/doxygen/Module_8h-source.html">llvm/Module.h</a>"</tt><br> doxygen info:
-<a href="/doxygen/classModule.html">Module Class</a></p>
+<a href="/doxygen/classllvm_1_1Module.html">Module Class</a></p>
 
 <p>The <tt>Module</tt> class represents the top level structure present in LLVM
 programs.  An LLVM module is effectively either a translation unit of the
@@ -1730,8 +1748,7 @@ types.</p>
   return false as they do with isSigned. This returns true for UByteTy,
   UShortTy, UIntTy, and ULongTy. </li>
 
-  <li><tt>bool isInteger() const</tt>: Equilivent to isSigned() || isUnsigned(),
-  but with only a single virtual function invocation.</li>
+  <li><tt>bool isInteger() const</tt>: Equivalent to isSigned() || isUnsigned().</li>
 
   <li><tt>bool isIntegral() const</tt>: Returns true if this is an integral
   type, which is either Bool type or one of the Integer types.</li>