From b0fdedb3fd123a47e7deca75d1e6f7d64218b07a Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 30 Sep 2009 23:12:50 +0000 Subject: [PATCH] Use MachineInstr as an processDebugLoc() argument. This will allow processDebugLoc() to handle scopes for DWARF debug info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83183 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/AsmPrinter.h | 2 +- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 4 ++-- lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 2 +- lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp | 2 +- lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp | 2 +- lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp | 2 +- lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp | 2 +- lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp | 2 +- lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp | 2 +- lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp | 2 +- lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp | 2 +- lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp | 2 +- lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 2 +- lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index 918b5a6b4d7..2f0e8d05417 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -358,7 +358,7 @@ namespace llvm { /// processDebugLoc - Processes the debug information of each machine /// instruction's DebugLoc. - void processDebugLoc(DebugLoc DL); + void processDebugLoc(const MachineInstr *MI); /// printInlineAsm - This method formats and prints the specified machine /// instruction that is an inline asm. diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index c84019be136..484ce94ffcd 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1347,10 +1347,10 @@ void AsmPrinter::PrintSpecial(const MachineInstr *MI, const char *Code) const { /// processDebugLoc - Processes the debug information of each machine /// instruction's DebugLoc. -void AsmPrinter::processDebugLoc(DebugLoc DL) { +void AsmPrinter::processDebugLoc(const MachineInstr *MI) { if (!MAI || !DW) return; - + DebugLoc DL = MI->getDebugLoc(); if (MAI->doesSupportDebugInformation() && DW->ShouldEmitDwarfDebug()) { if (!DL.isUnknown()) { DebugLocTuple CurDLT = MF->getDebugLocTuple(DL); diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 5d14a9b4d3f..bc0c0e75232 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -1036,7 +1036,7 @@ void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) { }} // Call the autogenerated instruction printer routines. - processDebugLoc(MI->getDebugLoc()); + processDebugLoc(MI); printInstruction(MI); if (VerboseAsm && !MI->getDebugLoc().isUnknown()) EmitComments(*MI); diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp index 0e36df3fa31..aed3b9a7898 100644 --- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp @@ -177,7 +177,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) { II != E; ++II) { // Print the assembly for the instruction. ++EmittedInsts; - processDebugLoc(II->getDebugLoc()); + processDebugLoc(II); printInstruction(II); diff --git a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp index 6a018af81de..1bb7678ec8f 100644 --- a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp +++ b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp @@ -146,7 +146,7 @@ bool BlackfinAsmPrinter::runOnMachineFunction(MachineFunction &MF) { for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); II != E; ++II) { // Print the assembly for the instruction. - processDebugLoc(II->getDebugLoc()); + processDebugLoc(II); printInstruction(II); if (VerboseAsm && !II->getDebugLoc().isUnknown()) diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp index fc6a76e2710..02809aff5be 100644 --- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp +++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp @@ -405,7 +405,7 @@ bool SPUAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, /// void SPUAsmPrinter::printMachineInstruction(const MachineInstr *MI) { ++EmittedInsts; - processDebugLoc(MI->getDebugLoc()); + processDebugLoc(MI); printInstruction(MI); if (VerboseAsm && !MI->getDebugLoc().isUnknown()) diff --git a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp index d849a837502..7dbd5ab483a 100644 --- a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp +++ b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp @@ -148,7 +148,7 @@ bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) { void MSP430AsmPrinter::printMachineInstruction(const MachineInstr *MI) { ++EmittedInsts; - processDebugLoc(MI->getDebugLoc()); + processDebugLoc(MI); // Call the autogenerated instruction printer routines. printInstruction(MI); diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp index fb5e5fc93bd..fd6d13eb3a3 100644 --- a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp +++ b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp @@ -278,7 +278,7 @@ bool MipsAsmPrinter::runOnMachineFunction(MachineFunction &MF) { for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); II != E; ++II) { - processDebugLoc(II->getDebugLoc()); + processDebugLoc(II); // Print the assembly for the instruction. printInstruction(II); diff --git a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp index 7eeefd1c761..a74ad661bc4 100644 --- a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp +++ b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp @@ -43,7 +43,7 @@ PIC16AsmPrinter::PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, } bool PIC16AsmPrinter::printMachineInstruction(const MachineInstr *MI) { - processDebugLoc(MI->getDebugLoc()); + processDebugLoc(MI); printInstruction(MI); diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index f55e6a14786..750cec93b6b 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -545,7 +545,7 @@ void PPCAsmPrinter::printPredicateOperand(const MachineInstr *MI, unsigned OpNo, void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) { ++EmittedInsts; - processDebugLoc(MI->getDebugLoc()); + processDebugLoc(MI); // Check for slwi/srwi mnemonics. if (MI->getOpcode() == PPC::RLWINM) { diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp index 81ac5324c17..04e5b69c354 100644 --- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp @@ -124,7 +124,7 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) { for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); II != E; ++II) { // Print the assembly for the instruction. - processDebugLoc(II->getDebugLoc()); + processDebugLoc(II); printInstruction(II); if (VerboseAsm && !II->getDebugLoc().isUnknown()) diff --git a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp index 442c46f81dc..5ba96494059 100644 --- a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp +++ b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp @@ -156,7 +156,7 @@ bool SystemZAsmPrinter::runOnMachineFunction(MachineFunction &MF) { void SystemZAsmPrinter::printMachineInstruction(const MachineInstr *MI) { ++EmittedInsts; - processDebugLoc(MI->getDebugLoc()); + processDebugLoc(MI); // Call the autogenerated instruction printer routines. printInstruction(MI); diff --git a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp index 153a6344a0e..4f89b716c12 100644 --- a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp @@ -653,7 +653,7 @@ bool X86AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, void X86AsmPrinter::printMachineInstruction(const MachineInstr *MI) { ++EmittedInsts; - processDebugLoc(MI->getDebugLoc()); + processDebugLoc(MI); printInstructionThroughMCStreamer(MI); diff --git a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp index 65378df42e4..4f17f2f9ff1 100644 --- a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp @@ -352,7 +352,7 @@ bool XCoreAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, void XCoreAsmPrinter::printMachineInstruction(const MachineInstr *MI) { ++EmittedInsts; - processDebugLoc(MI->getDebugLoc()); + processDebugLoc(MI); // Check for mov mnemonic unsigned src, dst, srcSR, dstSR;