summaryrefslogtreecommitdiffstats
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
commitf9d779ae66ca413d87834e75e7acf6910f2dc4d1 (patch)
tree01e5c93d5821078f03ddedfb8da6aa3f297d31f5
parent7bf5b1d17a895106ba73cca08ddf2387b9009d44 (diff)
downloadbcm5719-llvm-f9d779ae66ca413d87834e75e7acf6910f2dc4d1.tar.gz
bcm5719-llvm-f9d779ae66ca413d87834e75e7acf6910f2dc4d1.zip
* Fix a couple more <>&'s
* Correct an extremely minor technical point about a deprecated interface. llvm-svn: 3609
-rw-r--r--llvm/docs/ProgrammersManual.html21
1 files changed, 12 insertions, 9 deletions
diff --git a/llvm/docs/ProgrammersManual.html b/llvm/docs/ProgrammersManual.html
index 25a96a73735..945ac98755d 100644
--- a/llvm/docs/ProgrammersManual.html
+++ b/llvm/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
OpenPOWER on IntegriCloud