From 1e459c446786f46ed865183f1c6adb17e2e8fcea Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 26 Jan 2010 04:38:11 +0000 Subject: [PATCH] don't bother setting the AsmPrinter::MF ivar, now that AsmPrinter::SetupMachineFunction sets it. Note that systemz and msp430 didn't. Yay for reduced inconsistency! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94510 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 4 ---- lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp | 2 -- lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp | 2 -- lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp | 2 -- lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp | 2 -- lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp | 4 ---- lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp | 2 -- lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 1 - lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp | 5 +---- 9 files changed, 1 insertion(+), 23 deletions(-) diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 63aa7ce7eac..8b711fd54e4 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -241,8 +241,6 @@ namespace { /// method to print assembly for each instruction. /// bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - this->MF = &MF; - AFI = MF.getInfo(); MCP = MF.getConstantPool(); @@ -938,7 +936,6 @@ void ARMAsmPrinter::printJTBlockOperand(const MachineInstr *MI, int OpNum) { const char *JTEntryDirective = MAI->getData32bitsDirective(); - const MachineFunction *MF = MI->getParent()->getParent(); const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo(); const std::vector &JT = MJTI->getJumpTables(); const std::vector &JTBBs = JT[JTI].MBBs; @@ -975,7 +972,6 @@ void ARMAsmPrinter::printJT2BlockOperand(const MachineInstr *MI, int OpNum) { MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel2(JTI, MO2.getImm()); OutStreamer.EmitLabel(JTISymbol); - const MachineFunction *MF = MI->getParent()->getParent(); const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo(); const std::vector &JT = MJTI->getJumpTables(); const std::vector &JTBBs = JT[JTI].MBBs; diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp index 1606c54e1c4..c22ff75fe73 100644 --- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp @@ -124,8 +124,6 @@ void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) { /// method to print assembly for each instruction. /// bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - this->MF = &MF; - SetupMachineFunction(MF); O << "\n\n"; diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp index caf674c3a9d..08b45ea86f9 100644 --- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp +++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp @@ -403,8 +403,6 @@ void SPUAsmPrinter::printMachineInstruction(const MachineInstr *MI) { /// method to print assembly for each instruction. /// bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - this->MF = &MF; - SetupMachineFunction(MF); O << "\n\n"; diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp index fd0ab2d99b5..d96e207101f 100644 --- a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp +++ b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp @@ -248,8 +248,6 @@ void MipsAsmPrinter::emitFunctionEnd(MachineFunction &MF) { /// runOnMachineFunction - This uses the printMachineInstruction() /// method to print assembly for each instruction. bool MipsAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - this->MF = &MF; - SetupMachineFunction(MF); // Print out constants referenced by the function diff --git a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp index 0463596b820..f20c8044077 100644 --- a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp +++ b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp @@ -96,8 +96,6 @@ void PIC16AsmPrinter::ColorAutoSection(const Function *F) { /// directive and file begin debug directive (if required) for the function. /// bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) { - this->MF = &MF; - // This calls the base class function required to be called at beginning // of runOnMachineFunction. SetupMachineFunction(MF); diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index 6b0931480e3..e6fb24722cc 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -598,8 +598,6 @@ void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) { /// method to print assembly for each instruction. /// bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - this->MF = &MF; - SetupMachineFunction(MF); O << "\n\n"; @@ -701,8 +699,6 @@ bool PPCLinuxAsmPrinter::doFinalization(Module &M) { /// method to print assembly for each instruction. /// bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - this->MF = &MF; - SetupMachineFunction(MF); O << "\n\n"; diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp index 8fc4e5a1052..1026dbaa7fb 100644 --- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp @@ -85,8 +85,6 @@ namespace { /// method to print assembly for each instruction. /// bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - this->MF = &MF; - SetupMachineFunction(MF); // Print out constants referenced by the function diff --git a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp index c13040ab712..c5ed9180127 100644 --- a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp @@ -137,7 +137,6 @@ void X86AsmPrinter::emitFunctionHeader(const MachineFunction &MF) { /// bool X86AsmPrinter::runOnMachineFunction(MachineFunction &MF) { const Function *F = MF.getFunction(); - this->MF = &MF; CallingConv::ID CC = F->getCallingConv(); SetupMachineFunction(MF); diff --git a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp index 76dd337dce8..5f1e2d090a8 100644 --- a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp @@ -231,10 +231,7 @@ void XCoreAsmPrinter::emitFunctionEnd(MachineFunction &MF) { /// runOnMachineFunction - This uses the printMachineInstruction() /// method to print assembly for each instruction. /// -bool XCoreAsmPrinter::runOnMachineFunction(MachineFunction &MF) -{ - this->MF = &MF; - +bool XCoreAsmPrinter::runOnMachineFunction(MachineFunction &MF) { SetupMachineFunction(MF); // Print out constants referenced by the function