Fixed to print slightly differently. Added use counts for labels

llvm-svn: 9
This commit is contained in:
Chris Lattner 2001-06-07 16:58:55 +00:00
parent e358b22776
commit a2f01878b7

View file

@ -129,15 +129,16 @@ bool AssemblyWriter::processMethodArgument(const MethodArgument *Arg) {
// //
bool AssemblyWriter::processBasicBlock(const BasicBlock *BB) { bool AssemblyWriter::processBasicBlock(const BasicBlock *BB) {
if (BB->hasName()) { // Print out the label if it exists... if (BB->hasName()) { // Print out the label if it exists...
Out << "\n" << BB->getName() << ":\n"; Out << "\n" << BB->getName() << ":";
} else { } else {
int Slot = Table.getValSlot(BB); int Slot = Table.getValSlot(BB);
Out << "\t\t\t\t; <label>:"; Out << "\n; <label>:";
if (Slot >= 0) if (Slot >= 0)
Out << Slot << endl; // Extra newline seperates out label's Out << Slot; // Extra newline seperates out label's
else else
Out << "<badref>\n"; Out << "<badref>";
} }
Out << "\t\t\t\t\t;[#uses=" << BB->use_size() << "]\n"; // Output # uses
ModuleAnalyzer::processBasicBlock(BB); ModuleAnalyzer::processBasicBlock(BB);
return false; return false;
@ -227,15 +228,16 @@ bool AssemblyWriter::processInstruction(const Instruction *I) {
// Print a little comment after the instruction indicating which slot it // Print a little comment after the instruction indicating which slot it
// occupies. // occupies.
// //
if (!I->hasName() && I->getType() != Type::VoidTy) { if (I->getType() != Type::VoidTy) {
int Slot = Table.getValSlot(I); // Print out the def slot taken... Out << "\t\t; <" << I->getType() << ">";
Out << "\t\t; <" << I->getType() << ">:";
if (Slot >= 0) Out << Slot;
else Out << "<badref>";
if (!I->hasName()) {
int Slot = Table.getValSlot(I); // Print out the def slot taken...
if (Slot >= 0) Out << ":" << Slot;
else Out << ":<badref>";
}
Out << "\t[#uses=" << I->use_size() << "]"; // Output # uses Out << "\t[#uses=" << I->use_size() << "]"; // Output # uses
} }
Out << endl; Out << endl;
return false; return false;