aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
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
commitafc38686b426645ad10562c7eddfd6785663f1bb (patch)
treeb5bbb28adfc9941cf4167068abe51f2ab20dbddd /lib/VMCore
parentb3bc8fa75508ae996dbc71283186502f2c43f47c (diff)
downloadexternal_llvm-afc38686b426645ad10562c7eddfd6785663f1bb.zip
external_llvm-afc38686b426645ad10562c7eddfd6785663f1bb.tar.gz
external_llvm-afc38686b426645ad10562c7eddfd6785663f1bb.tar.bz2
Avoid emitting a useless comment for a basic block with no uses (which
often happens for the entry basic block of a function) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AsmWriter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 48195d0..7501696 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/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(),