mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
llvm::cerr is gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0ce6f93e93
commit
3fee6eda1d
@ -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)
|
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>Print out the name of the basic block if it has one, and then the</i>
|
||||||
// <i>number of instructions that it contains</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";
|
<< i->size() << " instructions.\n";
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
@ -1687,14 +1687,14 @@ a <tt>BasicBlock</tt>:</p>
|
|||||||
for (BasicBlock::iterator i = blk->begin(), e = blk->end(); i != e; ++i)
|
for (BasicBlock::iterator i = blk->begin(), e = blk->end(); i != e; ++i)
|
||||||
// <i>The next statement works since operator<<(ostream&,...)</i>
|
// <i>The next statement works since operator<<(ostream&,...)</i>
|
||||||
// <i>is overloaded for Instruction&</i>
|
// <i>is overloaded for Instruction&</i>
|
||||||
llvm::cerr << *i << "\n";
|
errs() << *i << "\n";
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>However, this isn't really the best way to print out the contents of a
|
<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
|
<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
|
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>
|
</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>
|
// <i>F is a pointer to a Function instance</i>
|
||||||
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
|
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
|
||||||
llvm::cerr << *I << "\n";
|
errs() << *I << "\n";
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -1799,7 +1799,7 @@ without actually obtaining it via iteration over some structure:</p>
|
|||||||
void printNextInstruction(Instruction* inst) {
|
void printNextInstruction(Instruction* inst) {
|
||||||
BasicBlock::iterator it(inst);
|
BasicBlock::iterator it(inst);
|
||||||
++it; // <i>After this line, it refers to the instruction after *inst</i>
|
++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>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
@ -1917,8 +1917,8 @@ Function *F = ...;
|
|||||||
|
|
||||||
for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i)
|
for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i)
|
||||||
if (Instruction *Inst = dyn_cast<Instruction>(*i)) {
|
if (Instruction *Inst = dyn_cast<Instruction>(*i)) {
|
||||||
llvm::cerr << "F is used in instruction:\n";
|
errs() << "F is used in instruction:\n";
|
||||||
llvm::cerr << *Inst << "\n";
|
errs() << *Inst << "\n";
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user