[llvm-commits] [llvm] r78830 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Dan Gohman
gohman at apple.com
Wed Aug 12 11:47:06 PDT 2009
Author: djg
Date: Wed Aug 12 13:47:05 2009
New Revision: 78830
URL: http://llvm.org/viewvc/llvm-project?rev=78830&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=78830&r1=78829&r2=78830&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Aug 12 13:47:05 2009
@@ -1311,7 +1311,8 @@
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 @@
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);
More information about the llvm-commits
mailing list