diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-12 18:47:05 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-12 18:47:05 +0000 |
commit | aceb935add69c51c7dc5fbac7be8353a916c1436 (patch) | |
tree | befd1ded35f97cbde23d87c15e0248e9a1d9eade | |
parent | aee7e49c505725d762099a0b21becd03f35c5ada (diff) | |
download | bcm5719-llvm-aceb935add69c51c7dc5fbac7be8353a916c1436.tar.gz bcm5719-llvm-aceb935add69c51c7dc5fbac7be8353a916c1436.zip |
Fix a few more places to use PadToColumn instead of tabs. And fix
the basic block label printing to check whether a block has a name
before printing a comment character and whitespace for it.
llvm-svn: 78830
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 35354750ef8..f0aa304a8bb 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1311,7 +1311,8 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) { if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) { SmallString<40> S; CI->getValue().toStringUnsigned(S, 16); - O << "\t\t\t" << TAI->getCommentString() << " 0x" << S.c_str(); + O.PadToColumn(TAI->getCommentColumn(), 1); + O << TAI->getCommentString() << " 0x" << S.c_str(); } } O << '\n'; @@ -1635,11 +1636,12 @@ void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB, if (printColon) O << ':'; if (printComment) { - O.PadToColumn(TAI->getCommentColumn(), 1); - - if (MBB->getBasicBlock()) - O << '\t' << TAI->getCommentString() << ' ' - << MBB->getBasicBlock()->getNameStr(); + if (const BasicBlock *BB = MBB->getBasicBlock()) + if (BB->hasName()) { + O.PadToColumn(TAI->getCommentColumn(), 1); + O << TAI->getCommentString() << ' ' + << MBB->getBasicBlock()->getName(); + } if (printColon) EmitComments(*MBB); |