aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-07 16:58:55 +0000
committerChris Lattner <sabre@nondot.org>2001-06-07 16:58:55 +0000
commitb9a4578df5e240d2e2e5d3f1f538188a054d70b4 (patch)
treec79763e2fdce3eae1ca80fded08de741dd71b65e
parentbbcfc51f3b2c483a8212205dbfae3b59400b306d (diff)
Fixed to print slightly differently. Added use counts for labels
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/AsmWriter.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index e23403b0d0..7ff410d1f8 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -129,15 +129,16 @@ bool AssemblyWriter::processMethodArgument(const MethodArgument *Arg) {
//
bool AssemblyWriter::processBasicBlock(const BasicBlock *BB) {
if (BB->hasName()) { // Print out the label if it exists...
- Out << "\n" << BB->getName() << ":\n";
+ Out << "\n" << BB->getName() << ":";
} else {
int Slot = Table.getValSlot(BB);
- Out << "\t\t\t\t; <label>:";
+ Out << "\n; <label>:";
if (Slot >= 0)
- Out << Slot << endl; // Extra newline seperates out label's
+ Out << Slot; // Extra newline seperates out label's
else
- Out << "<badref>\n";
+ Out << "<badref>";
}
+ Out << "\t\t\t\t\t;[#uses=" << BB->use_size() << "]\n"; // Output # uses
ModuleAnalyzer::processBasicBlock(BB);
return false;
@@ -227,15 +228,16 @@ bool AssemblyWriter::processInstruction(const Instruction *I) {
// Print a little comment after the instruction indicating which slot it
// occupies.
//
- if (!I->hasName() && I->getType() != Type::VoidTy) {
- int Slot = Table.getValSlot(I); // Print out the def slot taken...
- Out << "\t\t; <" << I->getType() << ">:";
- if (Slot >= 0) Out << Slot;
- else Out << "<badref>";
+ if (I->getType() != Type::VoidTy) {
+ Out << "\t\t; <" << I->getType() << ">";
+ 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 << endl;
return false;