summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-14 16:02:05 +0000
committerChris Lattner <sabre@nondot.org>2002-05-14 16:02:05 +0000
commit408dbdb9adaec52d5cd7b889a9a4cb9e3e21cc79 (patch)
tree9713a1bf7d61ea5ae39f9dfafe93407562ab4215 /llvm
parent053c0939e31ddf587a407e7960d1c397f1a0bf96 (diff)
downloadbcm5719-llvm-408dbdb9adaec52d5cd7b889a9a4cb9e3e21cc79.tar.gz
bcm5719-llvm-408dbdb9adaec52d5cd7b889a9a4cb9e3e21cc79.zip
Avoid emitting a useless comment for a basic block with no uses (which
often happens for the entry basic block of a function) llvm-svn: 2624
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 48195d0598d..75016965128 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -636,16 +636,19 @@ void AssemblyWriter::printArgument(const Argument *Arg) {
//
void AssemblyWriter::printBasicBlock(const BasicBlock *BB) {
if (BB->hasName()) { // Print out the label if it exists...
- Out << "\n" << BB->getName() << ":";
- } else {
+ Out << "\n" << BB->getName() << ":\t\t\t\t\t;[#uses="
+ << BB->use_size() << "]"; // Output # uses
+ } else if (!BB->use_empty()) { // Don't print block # of no uses...
int Slot = Table.getValSlot(BB);
Out << "\n; <label>:";
if (Slot >= 0)
Out << Slot; // Extra newline seperates out label's
else
Out << "<badref>";
+ Out << "\t\t\t\t\t;[#uses=" << BB->use_size() << "]"; // Output # uses
}
- Out << "\t\t\t\t\t;[#uses=" << BB->use_size() << "]\n"; // Output # uses
+
+ Out << "\n";
// Output all of the instructions in the basic block...
for_each(BB->begin(), BB->end(),
OpenPOWER on IntegriCloud