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 | 599c392e8d93a229de7d1a6a7182b40e33791f3c (patch) | |
tree | b7ccccbfbc163cd2e5ae2346615e5a0305c883cd /docs/ProgrammersManual.html | |
parent | 1efd4fd6a1b967fc3f0dbbd0d9c835ea5eec4f21 (diff) | |
download | external_llvm-599c392e8d93a229de7d1a6a7182b40e33791f3c.zip external_llvm-599c392e8d93a229de7d1a6a7182b40e33791f3c.tar.gz external_llvm-599c392e8d93a229de7d1a6a7182b40e33791f3c.tar.bz2 |
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 eaed402..4e97bc0 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> |