aboutsummaryrefslogtreecommitdiffstats
path: root/docs/ProgrammersManual.html
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-06-04 18:20:42 +0000
committerChris Lattner <sabre@nondot.org>2008-06-04 18:20:42 +0000
commitfd62ee7537b4239d3f7fb32455a44fe6b1f68100 (patch)
tree46ba06455744f3df3b7d7c45bf109b86be10aaea /docs/ProgrammersManual.html
parent557d799fcd5a258872de6fef354ef4e4086e221e (diff)
downloadexternal_llvm-fd62ee7537b4239d3f7fb32455a44fe6b1f68100.zip
external_llvm-fd62ee7537b4239d3f7fb32455a44fe6b1f68100.tar.gz
external_llvm-fd62ee7537b4239d3f7fb32455a44fe6b1f68100.tar.bz2
Fix inst_iterator example.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/ProgrammersManual.html')
-rw-r--r--docs/ProgrammersManual.html9
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html
index 5932aaf..716d364 100644
--- a/docs/ProgrammersManual.html
+++ b/docs/ProgrammersManual.html
@@ -1484,8 +1484,8 @@ small example that shows how to dump all instructions in a function to the stand
#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 &lt;&lt; *i &lt;&lt; "\n";
+for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
+ llvm::cerr &lt;&lt; *I &lt;&lt; "\n";
</pre>
</div>
@@ -1497,7 +1497,10 @@ F, all you would need to do is something like:</p>
<div class="doc_code">
<pre>
std::set&lt;Instruction*&gt; worklist;
-worklist.insert(inst_begin(F), inst_end(F));
+// or better yet, SmallPtrSet&lt;Instruction*, 64&gt; worklist;
+
+for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
+ worklist.insert(&amp;*I);
</pre>
</div>