diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-03 01:09:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-03 01:09:55 +0000 |
commit | d1ff72b8a797304f146e4293db8c814231ea8cb3 (patch) | |
tree | f5933f6d4223c094abac69d75fdba2b8033e90af /lib/CodeGen/AsmPrinter | |
parent | 0d883e3f8484491d010b8f8b7a1aecc58cb5fa8e (diff) | |
download | external_llvm-d1ff72b8a797304f146e4293db8c814231ea8cb3.zip external_llvm-d1ff72b8a797304f146e4293db8c814231ea8cb3.tar.gz external_llvm-d1ff72b8a797304f146e4293db8c814231ea8cb3.tar.bz2 |
rejigger the world so that EmitInstruction prints the \n at
the end of the instruction instead of expecting the caller to
do it. This currently causes the asm-verbose instruction
comments to be on the next line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 71668f5..3358d04 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -351,15 +351,19 @@ void AsmPrinter::EmitFunctionBody() { case TargetInstrInfo::EH_LABEL: case TargetInstrInfo::GC_LABEL: printLabel(II); + O << '\n'; break; case TargetInstrInfo::INLINEASM: printInlineAsm(II); + O << '\n'; break; case TargetInstrInfo::IMPLICIT_DEF: printImplicitDef(II); + O << '\n'; break; case TargetInstrInfo::KILL: printKill(II); + O << '\n'; break; default: EmitInstruction(II); @@ -367,7 +371,6 @@ void AsmPrinter::EmitFunctionBody() { } if (VerboseAsm) EmitComments(*II); - O << '\n'; // FIXME: Clean up processDebugLoc. processDebugLoc(II, false); @@ -1580,7 +1583,7 @@ static void PrintChildLoopComment(raw_ostream &OS, const MachineLoop *Loop, } } -/// EmitComments - Pretty-print comments for basic blocks. +/// PrintBasicBlockLoopComments - Pretty-print comments for basic blocks. static void PrintBasicBlockLoopComments(const MachineBasicBlock &MBB, const MachineLoopInfo *LI, const AsmPrinter &AP) { @@ -1716,8 +1719,6 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const { if (!VerboseAsm) return; - bool Newline = false; - if (!MI.getDebugLoc().isUnknown()) { DILocation DLT = MF->getDILocation(MI.getDebugLoc()); @@ -1733,7 +1734,7 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const { O << ':' << DLT.getLineNumber(); if (DLT.getColumnNumber() != 0) O << ':' << DLT.getColumnNumber(); - Newline = true; + O << '\n'; } // Check for spills and reloads @@ -1748,37 +1749,29 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const { if (TM.getInstrInfo()->isLoadFromStackSlotPostFE(&MI, FI)) { if (FrameInfo->isSpillSlotObjectIndex(FI)) { MMO = *MI.memoperands_begin(); - if (Newline) O << '\n'; O.PadToColumn(MAI->getCommentColumn()); - O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Reload"; - Newline = true; + O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Reload\n"; } } else if (TM.getInstrInfo()->hasLoadFromStackSlot(&MI, MMO, FI)) { if (FrameInfo->isSpillSlotObjectIndex(FI)) { - if (Newline) O << '\n'; O.PadToColumn(MAI->getCommentColumn()); O << MAI->getCommentString() << ' ' - << MMO->getSize() << "-byte Folded Reload"; - Newline = true; + << MMO->getSize() << "-byte Folded Reload\n"; } } else if (TM.getInstrInfo()->isStoreToStackSlotPostFE(&MI, FI)) { if (FrameInfo->isSpillSlotObjectIndex(FI)) { MMO = *MI.memoperands_begin(); - if (Newline) O << '\n'; O.PadToColumn(MAI->getCommentColumn()); - O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Spill"; - Newline = true; + O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Spill\n"; } } else if (TM.getInstrInfo()->hasStoreToStackSlot(&MI, MMO, FI)) { if (FrameInfo->isSpillSlotObjectIndex(FI)) { - if (Newline) O << '\n'; O.PadToColumn(MAI->getCommentColumn()); O << MAI->getCommentString() << ' ' - << MMO->getSize() << "-byte Folded Spill"; - Newline = true; + << MMO->getSize() << "-byte Folded Spill\n"; } } @@ -1787,9 +1780,8 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const { if (TM.getInstrInfo()->isMoveInstr(MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) { if (MI.getAsmPrinterFlag(ReloadReuse)) { - if (Newline) O << '\n'; O.PadToColumn(MAI->getCommentColumn()); - O << MAI->getCommentString() << " Reload Reuse"; + O << MAI->getCommentString() << " Reload Reuse\n"; } } } |