[llvm-commits] [llvm] r51954 - /llvm/trunk/docs/ProgrammersManual.html
Chris Lattner
sabre at nondot.org
Wed Jun 4 11:20:43 PDT 2008
Author: lattner
Date: Wed Jun 4 13:20:42 2008
New Revision: 51954
URL: http://llvm.org/viewvc/llvm-project?rev=51954&view=rev
Log:
Fix inst_iterator example.
Modified:
llvm/trunk/docs/ProgrammersManual.html
Modified: llvm/trunk/docs/ProgrammersManual.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.html?rev=51954&r1=51953&r2=51954&view=diff
==============================================================================
--- llvm/trunk/docs/ProgrammersManual.html (original)
+++ llvm/trunk/docs/ProgrammersManual.html Wed Jun 4 13:20:42 2008
@@ -1484,8 +1484,8 @@
#include "<a href="/doxygen/InstIterator_8h-source.html">llvm/Support/InstIterator.h</a>"
// <i>F is a pointer to a Function instance</i>
-for (inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i)
- llvm::cerr << *i << "\n";
+for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
+ llvm::cerr << *I << "\n";
</pre>
</div>
@@ -1497,7 +1497,10 @@
<div class="doc_code">
<pre>
std::set<Instruction*> worklist;
-worklist.insert(inst_begin(F), inst_end(F));
+// or better yet, SmallPtrSet<Instruction*, 64> worklist;
+
+for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
+ worklist.insert(&*I);
</pre>
</div>
More information about the llvm-commits
mailing list