diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-08 05:15:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-08 05:15:50 +0000 |
commit | 3fee6eda1d6654eb895bb3e069cee42c8a6474fa (patch) | |
tree | b7ccccbfbc163cd2e5ae2346615e5a0305c883cd /docs/ProgrammersManual.html | |
parent | 0ce6f93e9355f339dd3945b9fb0133ef60e5d1a2 (diff) |
llvm::cerr is gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/ProgrammersManual.html')
-rw-r--r-- | docs/ProgrammersManual.html | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index eaed402d8a..4e97bc02f2 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -1654,7 +1654,7 @@ an example that prints the name of a <tt>BasicBlock</tt> and the number of for (Function::iterator i = func->begin(), e = func->end(); i != e; ++i) // <i>Print out the name of the basic block if it has one, and then the</i> // <i>number of instructions that it contains</i> - llvm::cerr << "Basic block (name=" << i->getName() << ") has " + errs() << "Basic block (name=" << i->getName() << ") has " << i->size() << " instructions.\n"; </pre> </div> @@ -1687,14 +1687,14 @@ a <tt>BasicBlock</tt>:</p> for (BasicBlock::iterator i = blk->begin(), e = blk->end(); i != e; ++i) // <i>The next statement works since operator<<(ostream&,...)</i> // <i>is overloaded for Instruction&</i> - llvm::cerr << *i << "\n"; + errs() << *i << "\n"; </pre> </div> <p>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>llvm::cerr << *blk << "\n";</tt>.</p> +basic block itself: <tt>errs() << *blk << "\n";</tt>.</p> </div> @@ -1720,7 +1720,7 @@ small example that shows how to dump all instructions in a function to the stand // <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"; + errs() << *I << "\n"; </pre> </div> @@ -1799,7 +1799,7 @@ without actually obtaining it via iteration over some structure:</p> void printNextInstruction(Instruction* inst) { BasicBlock::iterator it(inst); ++it; // <i>After this line, it refers to the instruction after *inst</i> - if (it != inst->getParent()->end()) llvm::cerr << *it << "\n"; + if (it != inst->getParent()->end()) errs() << *it << "\n"; } </pre> </div> @@ -1917,8 +1917,8 @@ Function *F = ...; for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i) if (Instruction *Inst = dyn_cast<Instruction>(*i)) { - llvm::cerr << "F is used in instruction:\n"; - llvm::cerr << *Inst << "\n"; + errs() << "F is used in instruction:\n"; + errs() << *Inst << "\n"; } </pre> </div> |