[llvm-commits] CVS: llvm/www/docs/ProgrammersManual.html

Joel Stanley jstanley at cs.uiuc.edu
Fri Sep 6 18:44:00 PDT 2002


Changes in directory llvm/www/docs:

ProgrammersManual.html updated: 1.10 -> 1.11

---
Log message:


---
Diffs of the changes:

Index: llvm/www/docs/ProgrammersManual.html
diff -u llvm/www/docs/ProgrammersManual.html:1.10 llvm/www/docs/ProgrammersManual.html:1.11
--- llvm/www/docs/ProgrammersManual.html:1.10	Fri Sep  6 18:05:12 2002
+++ llvm/www/docs/ProgrammersManual.html	Fri Sep  6 18:42:40 2002
@@ -244,19 +244,17 @@
 </ul><h4><a name="iterate_basicblock"><hr size=0>Iterating over the
 <tt>Instruction</tt>s in a <tt>BasicBlock</tt> </h4><ul>
 
-Just like when dealing with <tt>BasicBlock</tt>s in <tt>Function</tt>s, it's
-easy to iterate over the individual instructions that make up
-<tt>BasicBlock</tt>s.  Here's a code snippet that prints out each instruction in
-a <tt>BasicBlock</tt>:
+Just like when dealing with <tt>BasicBlock</tt>s in
+<tt>Function</tt>s, it's easy to iterate over the individual
+instructions that make up <tt>BasicBlock</tt>s.  Here's a code snippet
+that prints out each instruction in a <tt>BasicBlock</tt>:
 
 <pre>
   // blk is a pointer to a BasicBlock instance
   for(BasicBlock::iterator i = blk->begin(), e = blk->end(); i != e; ++i) {
      // the next statement works since operator<<(ostream&,...) 
      // is overloaded for Instruction&
-
      cerr << *i << endl;
-  }
 </pre>
 
 However, this isn't really the best way to print out the contents of a
@@ -323,12 +321,8 @@
     if(it != inst->getParent()->end()) cerr <&lt *it <&lt endl;
 }
 </pre>
-
-Of course, this example is strictly pedagogical, because it'd be
-better to do something like 
-
-<pre>if(inst->getNext()) cerr <&lt inst->getNext() <&lt endl;</pre>
-
+Of course, this example is strictly pedagogical, because it'd be much
+better to explicitly grab the next instruction directly from inst.
 
 <!--   dereferenced iterator = Class &
        iterators have converting constructor for 'Class *'
@@ -401,7 +395,6 @@
 We could then print out the value of callCounter (if we wanted to)
 inside the doFinalization method of our FunctionPass.
 
-
 <!-- ======================================================================= -->
 </ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
 <tr><td> </td><td width="100%">  
@@ -1243,6 +1236,10 @@
 <a href="mailto:sabre at nondot.org">Chris Lattner</a></address>
 <!-- Created: Tue Aug  6 15:00:33 CDT 2002 -->
 <!-- hhmts start -->
+<<<<<<< ProgrammersManual.html
+Last modified: Fri Sep  6 18:24:38 EDT 2002
+=======
 Last modified: Fri Sep  6 18:03:31 EDT 2002
+>>>>>>> 1.10
 <!-- hhmts end -->
 </font></body></html>





More information about the llvm-commits mailing list