Changed option name from inline-threshold to basic-inline-threshold because
[oota-llvm.git] / docs / ProgrammersManual.html
index 46b82ddc21fb6f23c335d58a578b248562ae68c7..708211fa7d2886f34ef38fe7851d4c942b319b69 100644 (file)
@@ -1614,7 +1614,7 @@ class OurFunctionPass : public FunctionPass {
 
     virtual runOnFunction(Function& F) {
       for (Function::iterator b = F.begin(), be = F.end(); b != be; ++b) {
-        for (BasicBlock::iterator i = b->begin(); ie = b->end(); i != ie; ++i) {
+        for (BasicBlock::iterator i = b->begin(), ie = b->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);
 
@@ -2232,7 +2234,7 @@ insert entries into the symbol table.</p>
 
 <div class="doc_text">
 <p>The <tt><a href="http://llvm.org/doxygen/classllvm_1_1User.html">
-User</a></tt> class provides a base for expressing the ownership of <tt>User</tt>
+User</a></tt> class provides a basis for expressing the ownership of <tt>User</tt>
 towards other <tt><a href="http://llvm.org/doxygen/classllvm_1_1Value.html">
 Value</a></tt>s. The <tt><a href="http://llvm.org/doxygen/classllvm_1_1Use.html">
 Use</a></tt> helper class is employed to do the bookkeeping and to facilitate <i>O(1)</i>
@@ -2240,7 +2242,7 @@ addition and removal.</p>
 
 <!-- ______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="PATypeHolder">Interaction and relationship between <tt>User</tt> and <tt>Use</tt> objects</a>
+  <a name="Use2User">Interaction and relationship between <tt>User</tt> and <tt>Use</tt> objects</a>
 </div>
 
 <div class="doc_text">
@@ -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
@@ -2301,17 +2303,17 @@ will enforce the following memory layouts:</p>
 
 <!-- ______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="PATypeHolder">The waymarking algorithm</a>
+  <a name="Waymarking">The waymarking algorithm</a>
 </div>
 
 <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>
@@ -2342,7 +2344,7 @@ stops, so that the <i>worst case is 20 memory accesses</i> when there are
 
 <!-- ______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="PATypeHolder">Reference implementation</a>
+  <a name="ReferenceImpl">Reference implementation</a>
 </div>
 
 <div class="doc_text">
@@ -2432,7 +2434,7 @@ OK, passed 500 tests.
 
 <!-- ______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="PATypeHolder">Tagging considerations</a>
+  <a name="Tagging">Tagging considerations</a>
 </div>
 
 <p>
@@ -2441,10 +2443,11 @@ 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
-the LSBit set.</p>
+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. (Portability is relying on the fact that all known compilers place the
+<tt>vptr</tt> in the first word of the instances.)</p>
 
 </div>
 
@@ -2489,7 +2492,7 @@ the <tt>lib/VMCore</tt> directory.</p>
 
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="m_Value">Important Public Methods</a>
+  <a name="m_Type">Important Public Methods</a>
 </div>
 
 <div class="doc_text">
@@ -2511,7 +2514,7 @@ the <tt>lib/VMCore</tt> directory.</p>
 
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="m_Value">Important Derived Types</a>
+  <a name="derivedtypes">Important Derived Types</a>
 </div>
 <div class="doc_text">
 <dl>
@@ -3167,7 +3170,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
@@ -3409,7 +3412,7 @@ arguments. An argument has a pointer to the parent Function.</p>
 <hr>
 <address>
   <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
-  src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
+  src="http://jigsaw.w3.org/css-validator/images/vcss-blue" 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 Strict"></a>