diff options
author | Bob Wilson <bob.wilson@apple.com> | 2009-09-30 21:24:45 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2009-09-30 21:24:45 +0000 |
commit | cd8cb7f1e4075f66179e15deb0c0aecaf09fe4be (patch) | |
tree | 66ecc63e186b5d335af75102004bd384da7fce1a | |
parent | cd36d91b6775ae45eb46eb2a0f4ac47b4a8cb9d8 (diff) | |
download | external_llvm-cd8cb7f1e4075f66179e15deb0c0aecaf09fe4be.zip external_llvm-cd8cb7f1e4075f66179e15deb0c0aecaf09fe4be.tar.gz external_llvm-cd8cb7f1e4075f66179e15deb0c0aecaf09fe4be.tar.bz2 |
The AsmPrinter base class contains a DwarfWriter member, so there's no need
for derived AsmPrinters to add another one. In some cases, fixing this
removes the need to override the doInitialization method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83170 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 4 | ||||
-rw-r--r-- | lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp | 10 | ||||
-rw-r--r-- | lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp | 11 |
3 files changed, 3 insertions, 22 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 6fc47ef..71497b4 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -50,7 +50,6 @@ STATISTIC(EmittedInsts, "Number of machine instrs printed"); namespace { class VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter { - DwarfWriter *DW; /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can /// make the right decision when printing asm code for different targets. @@ -84,7 +83,7 @@ namespace { public: explicit ARMAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, const MCAsmInfo *T, bool V) - : AsmPrinter(O, TM, T, V), DW(0), AFI(NULL), MCP(NULL), + : AsmPrinter(O, TM, T, V), AFI(NULL), MCP(NULL), InCPMode(false) { Subtarget = &TM.getSubtarget<ARMSubtarget>(); } @@ -1066,7 +1065,6 @@ bool ARMAsmPrinter::doInitialization(Module &M) { } bool Result = AsmPrinter::doInitialization(M); - DW = getAnalysisIfAvailable<DwarfWriter>(); // Use unified assembler syntax mode for Thumb. if (Subtarget->isThumb()) diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp index 13f01c6..fc6a76e 100644 --- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp +++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp @@ -286,18 +286,16 @@ namespace { /// LinuxAsmPrinter - SPU assembly printer, customized for Linux class VISIBILITY_HIDDEN LinuxAsmPrinter : public SPUAsmPrinter { - DwarfWriter *DW; public: explicit LinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, const MCAsmInfo *T, bool V) - : SPUAsmPrinter(O, TM, T, V), DW(0) {} + : SPUAsmPrinter(O, TM, T, V) {} virtual const char *getPassName() const { return "STI CBEA SPU Assembly Printer"; } bool runOnMachineFunction(MachineFunction &F); - bool doInitialization(Module &M); void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -484,12 +482,6 @@ bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) { } -bool LinuxAsmPrinter::doInitialization(Module &M) { - bool Result = AsmPrinter::doInitialization(M); - DW = getAnalysisIfAvailable<DwarfWriter>(); - return Result; -} - /*! Emit a global variable according to its section, alignment, etc. diff --git a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp index fe45ec3..65378df 100644 --- a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp @@ -53,12 +53,11 @@ static cl::opt<unsigned> MaxThreads("xcore-max-threads", cl::Optional, namespace { class VISIBILITY_HIDDEN XCoreAsmPrinter : public AsmPrinter { - DwarfWriter *DW; const XCoreSubtarget &Subtarget; public: explicit XCoreAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, const MCAsmInfo *T, bool V) - : AsmPrinter(O, TM, T, V), DW(0), + : AsmPrinter(O, TM, T, V), Subtarget(TM.getSubtarget<XCoreSubtarget>()) {} virtual const char *getPassName() const { @@ -84,7 +83,6 @@ namespace { void printMachineInstruction(const MachineInstr *MI); bool runOnMachineFunction(MachineFunction &F); - bool doInitialization(Module &M); void getAnalysisUsage(AnalysisUsage &AU) const { AsmPrinter::getAnalysisUsage(AU); @@ -369,13 +367,6 @@ void XCoreAsmPrinter::printMachineInstruction(const MachineInstr *MI) { O << '\n'; } -bool XCoreAsmPrinter::doInitialization(Module &M) { - bool Result = AsmPrinter::doInitialization(M); - DW = getAnalysisIfAvailable<DwarfWriter>(); - - return Result; -} - // Force static initialization. extern "C" void LLVMInitializeXCoreAsmPrinter() { RegisterAsmPrinter<XCoreAsmPrinter> X(TheXCoreTarget); |