summaryrefslogtreecommitdiff
path: root/docs/ProgrammersManual.html
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-06 22:51:10 +0000
committerChris Lattner <sabre@nondot.org>2002-09-06 22:51:10 +0000
commit2b76306eb7ab0f8981446da96b5340ed5fb814ef (patch)
tree0ef87dc9812a5233bb0dd2a38ffe747f8b35e74a /docs/ProgrammersManual.html
parent83b5ee060df9a309c541908e113b9565eea91d56 (diff)
downloadllvm-2b76306eb7ab0f8981446da96b5340ed5fb814ef.tar.gz
llvm-2b76306eb7ab0f8981446da96b5340ed5fb814ef.tar.bz2
llvm-2b76306eb7ab0f8981446da96b5340ed5fb814ef.tar.xz
* Fix a couple more <>&'s
* Correct an extremely minor technical point about a deprecated interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/ProgrammersManual.html')
-rw-r--r--docs/ProgrammersManual.html21
1 files changed, 12 insertions, 9 deletions
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html
index 25a96a7373..945ac98755 100644
--- a/docs/ProgrammersManual.html
+++ b/docs/ProgrammersManual.html
@@ -251,22 +251,25 @@ 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&
+ for(BasicBlock::iterator i = blk-&gt;begin(), e = blk-&gt;end(); i != e; ++i) {
+ // the next statement works since operator&lt;&lt;(ostream&amp;,...)
+ // is overloaded for Instruction&amp;
- cerr << *i << endl;
+ cerr &lt;&lt; *i &lt;&lt; endl;
}
</pre>
However, this isn't really the best way to print out the contents of a
<tt>BasicBlock</tt>! Since the ostream operators are overloaded for
virtually anything you'll care about, you could have just invoked the
-print routine on the basic block itself: <tt>cerr << blk <<
-endl;</tt>. You might expect this to print out the pointer value of
-blk, but operator<< is overloaded for BasicBlock* as well: if you
-really want to print the pointer value explicitly, you'll have to
-cast.
+print routine on the basic block itself: <tt>cerr &lt;&lt; *blk &lt;&lt;
+"\n";</tt>.<p>
+
+Note that currently operator&lt;&lt; is implemented for <tt>Value*</tt>, so it
+will print out the contents of the pointer, instead of
+the pointer value you might expect. This is a deprecated interface that will
+be removed in the future, so it's best not to depend on it. To print out the
+pointer value for now, you must cast to <tt>void*</tt>.<p>
<!-- _______________________________________________________________________ -->
</ul><h4><a name="iterate_convert"><hr size=0>Turning an iterator into a class