[llvm-commits] [llvm] r83170 - in /llvm/trunk/lib/Target: ARM/AsmPrinter/ARMAsmPrinter.cpp CellSPU/AsmPrinter/SPUAsmPrinter.cpp XCore/AsmPrinter/XCoreAsmPrinter.cpp
Bob Wilson
bob.wilson at apple.com
Wed Sep 30 14:24:46 PDT 2009
Author: bwilson
Date: Wed Sep 30 16:24:45 2009
New Revision: 83170
URL: http://llvm.org/viewvc/llvm-project?rev=83170&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=83170&r1=83169&r2=83170&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Wed Sep 30 16:24:45 2009
@@ -50,7 +50,6 @@
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 @@
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 Result = AsmPrinter::doInitialization(M);
- DW = getAnalysisIfAvailable<DwarfWriter>();
// Use unified assembler syntax mode for Thumb.
if (Subtarget->isThumb())
Modified: llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=83170&r1=83169&r2=83170&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Wed Sep 30 16:24:45 2009
@@ -286,18 +286,16 @@
/// 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::doInitialization(Module &M) {
- bool Result = AsmPrinter::doInitialization(M);
- DW = getAnalysisIfAvailable<DwarfWriter>();
- return Result;
-}
-
/*!
Emit a global variable according to its section, alignment, etc.
Modified: llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp?rev=83170&r1=83169&r2=83170&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp Wed Sep 30 16:24:45 2009
@@ -53,12 +53,11 @@
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 @@
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 @@
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);
More information about the llvm-commits
mailing list