diff options
author | Chris Lattner <sabre@nondot.org> | 2008-06-04 18:20:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-06-04 18:20:42 +0000 |
commit | 09ebde227ee24f57b077b4f36e6a67a054c18431 (patch) | |
tree | 460722164948bbe8e542b8e80d6e3c22265fae54 /llvm/docs/ProgrammersManual.html | |
parent | 9e273163371d51c55225c8584c7e4fcc18525e61 (diff) | |
download | bcm5719-llvm-09ebde227ee24f57b077b4f36e6a67a054c18431.tar.gz bcm5719-llvm-09ebde227ee24f57b077b4f36e6a67a054c18431.zip |
Fix inst_iterator example.
llvm-svn: 51954
Diffstat (limited to 'llvm/docs/ProgrammersManual.html')
-rw-r--r-- | llvm/docs/ProgrammersManual.html | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/docs/ProgrammersManual.html b/llvm/docs/ProgrammersManual.html index 5932aaf727f..716d364ed56 100644 --- a/llvm/docs/ProgrammersManual.html +++ b/llvm/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 << *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 @@ F, all you would need to do is something like:</p> <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> |