Forgot a file.
[oota-llvm.git] / docs / ProgrammersManual.html
index 2b9e6ca88bde73f51502753c127aa2a2c63fffc3..6b93e9cc0446e7daa8e66666bcc3b682f490fdcf 100644 (file)
@@ -333,7 +333,7 @@ file (note that you very rarely have to include this file directly).</p>
   <dt><tt>cast&lt;&gt;</tt>: </dt>
 
   <dd><p>The <tt>cast&lt;&gt;</tt> operator is a "checked cast" operation. It
-  converts a pointer or reference from a base class to a derived cast, causing
+  converts a pointer or reference from a base class to a derived class, causing
   an assertion failure if it is not really an instance of the right type.  This
   should be used in cases where you have some information that makes you believe
   that something is of the right type.  An example of the <tt>isa&lt;&gt;</tt>
@@ -1614,7 +1614,7 @@ class OurFunctionPass : public FunctionPass {
 
     virtual runOnFunction(Function&amp; F) {
       for (Function::iterator b = F.begin(), be = F.end(); b != be; ++b) {
-        for (BasicBlock::iterator i = b-&gt;begin(); ie = b-&gt;end(); i != ie; ++i) {
+        for (BasicBlock::iterator i = b-&gt;begin(), ie = b-&gt;end(); i != ie; ++i) {
           if (<a href="#CallInst">CallInst</a>* callInst = <a href="#isa">dyn_cast</a>&lt;<a
  href="#CallInst">CallInst</a>&gt;(&amp;*i)) {
             // <i>We know we've encountered a call instruction, so we</i>
@@ -1944,9 +1944,9 @@ and <tt>ReplaceInstWithInst</tt>.</p>
 <ul>
   <li><tt>ReplaceInstWithValue</tt>
 
-    <p>This function replaces all uses (within a basic block) of a given
-    instruction with a value, and then removes the original instruction. The
-    following example illustrates the replacement of the result of a particular
+    <p>This function replaces all uses of a given instruction with a value,
+    and then removes the original instruction. The following example
+    illustrates the replacement of the result of a particular
     <tt>AllocaInst</tt> that allocates memory for a single integer with a null
     pointer to an integer.</p>
 
@@ -1956,14 +1956,16 @@ AllocaInst* instToReplace = ...;
 BasicBlock::iterator ii(instToReplace);
 
 ReplaceInstWithValue(instToReplace-&gt;getParent()-&gt;getInstList(), ii,
-                     Constant::getNullValue(PointerType::get(Type::Int32Ty)));
+                     Constant::getNullValue(PointerType::getUnqual(Type::Int32Ty)));
 </pre></div></li>
 
   <li><tt>ReplaceInstWithInst</tt> 
 
     <p>This function replaces a particular instruction with another
-    instruction. The following example illustrates the replacement of one
-    <tt>AllocaInst</tt> with another.</p>
+    instruction, inserting the new instruction into the basic block at the
+    location where the old instruction was, and replacing any uses of the old
+    instruction with the new instruction. The following example illustrates
+    the replacement of one <tt>AllocaInst</tt> with another.</p>
 
 <div class="doc_code">
 <pre>
@@ -2089,7 +2091,7 @@ To build this, use the following LLVM APIs:
 // <i>Create the initial outer struct</i>
 <a href="#PATypeHolder">PATypeHolder</a> StructTy = OpaqueType::get();
 std::vector&lt;const Type*&gt; Elts;
-Elts.push_back(PointerType::get(StructTy));
+Elts.push_back(PointerType::getUnqual(StructTy));
 Elts.push_back(Type::Int32Ty);
 StructType *NewSTy = StructType::get(Elts);
 
@@ -2265,18 +2267,18 @@ array from the <tt>User</tt> object and there may be a variable
 number of them.</p>
 </ul>
 <p>
-Initially each layout will possess a direct pointer to the
+As of v2.4 each layout still possesses a direct pointer to the
 start of the array of <tt>Use</tt>s. Though not mandatory for layout a),
 we stick to this redundancy for the sake of simplicity.
-The <tt>User</tt> object will also store the number of <tt>Use</tt> objects it
+The <tt>User</tt> object also stores the number of <tt>Use</tt> objects it
 has. (Theoretically this information can also be calculated
 given the scheme presented below.)</p>
 <p>
 Special forms of allocation operators (<tt>operator new</tt>)
-will enforce the following memory layouts:</p>
+enforce the following memory layouts:</p>
 
 <ul>
-<li><p>Layout a) will be modelled by prepending the <tt>User</tt> object by the <tt>Use[]</tt> array.</p>
+<li><p>Layout a) is modelled by prepending the <tt>User</tt> object by the <tt>Use[]</tt> array.</p>
 
 <pre>
 ...---.---.---.---.-------...
@@ -2284,7 +2286,7 @@ will enforce the following memory layouts:</p>
 '''---'---'---'---'-------'''
 </pre>
 
-<li><p>Layout b) will be modelled by pointing at the Use[] array.</p>
+<li><p>Layout b) is modelled by pointing at the <tt>Use[]</tt> array.</p>
 <pre>
 .-------...
 | User
@@ -2306,12 +2308,12 @@ will enforce the following memory layouts:</p>
 
 <div class="doc_text">
 <p>
-Since the <tt>Use</tt> objects will be deprived of the direct pointer to
+Since the <tt>Use</tt> objects are deprived of the direct (back)pointer to
 their <tt>User</tt> objects, there must be a fast and exact method to
 recover it. This is accomplished by the following scheme:</p>
 </div>
 
-A bit-encoding in the 2 LSBits (least significant bits) of the <tt>Use::Prev</tt> will allow to find the
+A bit-encoding in the 2 LSBits (least significant bits) of the <tt>Use::Prev</tt> allows to find the
 start of the <tt>User</tt> object:
 <ul>
 <li><tt>00</tt> &mdash;&gt; binary digit 0</li>
@@ -2441,9 +2443,9 @@ never change after being set up, setters of <tt>Use::Prev</tt> must re-tag the
 new <tt>Use**</tt> on every modification. Accordingly getters must strip the
 tag bits.</p>
 <p>
-For layout b) instead of the <tt>User</tt> we will find a pointer (<tt>User*</tt> with LSBit set).
-Following this pointer brings us to the <tt>User</tt>. A portable trick will ensure
-that the first bytes of <tt>User</tt> (if interpreted as a pointer) will never have
+For layout b) instead of the <tt>User</tt> we find a pointer (<tt>User*</tt> with LSBit set).
+Following this pointer brings us to the <tt>User</tt>. A portable trick ensures
+that the first bytes of <tt>User</tt> (if interpreted as a pointer) never has
 the LSBit set.</p>
 
 </div>
@@ -3167,7 +3169,7 @@ is its address (after linking) which is guaranteed to be constant.</p>
     will automatically be inserted into that module's list of
     functions.</p></li>
 
-  <li><tt>bool isExternal()</tt>
+  <li><tt>bool isDeclaration()</tt>
 
     <p>Return whether or not the <tt>Function</tt> has a body defined.  If the
     function is "external", it does not have a body, and thus must be resolved
@@ -3411,7 +3413,7 @@ arguments. An argument has a pointer to the parent Function.</p>
   <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
   src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
   <a href="http://validator.w3.org/check/referer"><img
-  src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
+  src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Strict"></a>
 
   <a href="mailto:dhurjati@cs.uiuc.edu">Dinakar Dhurjati</a> and
   <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>