From 3fee6eda1d6654eb895bb3e069cee42c8a6474fa Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 8 Sep 2009 05:15:50 +0000 Subject: llvm::cerr is gone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81189 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ProgrammersManual.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/ProgrammersManual.html') 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 BasicBlock and the number of for (Function::iterator i = func->begin(), e = func->end(); i != e; ++i) // Print out the name of the basic block if it has one, and then the // number of instructions that it contains - llvm::cerr << "Basic block (name=" << i->getName() << ") has " + errs() << "Basic block (name=" << i->getName() << ") has " << i->size() << " instructions.\n"; @@ -1687,14 +1687,14 @@ a BasicBlock:

for (BasicBlock::iterator i = blk->begin(), e = blk->end(); i != e; ++i) // The next statement works since operator<<(ostream&,...) // is overloaded for Instruction& - llvm::cerr << *i << "\n"; + errs() << *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: llvm::cerr << *blk << "\n";.

+basic block itself: errs() << *blk << "\n";.

@@ -1720,7 +1720,7 @@ small example that shows how to dump all instructions in a function to the stand // F is a pointer to a Function instance for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) - llvm::cerr << *I << "\n"; + errs() << *I << "\n"; @@ -1799,7 +1799,7 @@ without actually obtaining it via iteration over some structure:

void printNextInstruction(Instruction* inst) { BasicBlock::iterator it(inst); ++it; // After this line, it refers to the instruction after *inst - if (it != inst->getParent()->end()) llvm::cerr << *it << "\n"; + if (it != inst->getParent()->end()) errs() << *it << "\n"; } @@ -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"; } -- cgit v1.2.3-18-g5258