From 55c0461d266d066a9605207775d73751133431f5 Mon Sep 17 00:00:00 2001
From: Chris Lattner
// 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&
cerr << *i << "\n";
+ // 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& + std::cerr << *i << "\n"; +
However, this isn't really the best way to print out the contents of a BasicBlock! 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: cerr << *blk << "\n";.
- -Note that currently operator<< is implemented for Value*, 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 void*.
+basic block itself: std::cerr << *blk << "\n";. @@ -2035,9 +2035,6 @@ will loop infinitely.