mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-13 07:50:50 +00:00
The DarwinAsmPrinter need not check for isDarwin. createPPCAsmPrinterPass
should create the right asmprinter subclass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dadceedbdb
commit
4da1c82f72
@ -26,8 +26,8 @@ class MachineCodeEmitter;
|
|||||||
|
|
||||||
FunctionPass *createPPCBranchSelectionPass();
|
FunctionPass *createPPCBranchSelectionPass();
|
||||||
FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
|
FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
|
||||||
FunctionPass *createDarwinCodePrinterPass(std::ostream &OS,
|
FunctionPass *createPPCAsmPrinterPass(std::ostream &OS,
|
||||||
PPCTargetMachine &TM);
|
PPCTargetMachine &TM);
|
||||||
FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM,
|
FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM,
|
||||||
MachineCodeEmitter &MCE);
|
MachineCodeEmitter &MCE);
|
||||||
void addPPCMachOObjectWriterPass(FunctionPassManager &FPM, std::ostream &o,
|
void addPPCMachOObjectWriterPass(FunctionPassManager &FPM, std::ostream &o,
|
||||||
|
@ -270,15 +270,6 @@ namespace {
|
|||||||
};
|
};
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
|
|
||||||
/// createDarwinCodePrinterPass - Returns a pass that prints the PPC assembly
|
|
||||||
/// code for a MachineFunction to the given output stream, in a format that the
|
|
||||||
/// Darwin assembler can deal with.
|
|
||||||
///
|
|
||||||
FunctionPass *llvm::createDarwinCodePrinterPass(std::ostream &o,
|
|
||||||
PPCTargetMachine &tm) {
|
|
||||||
return new DarwinAsmPrinter(o, tm, tm.getTargetAsmInfo());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Include the auto-generated portion of the assembly writer
|
// Include the auto-generated portion of the assembly writer
|
||||||
#include "PPCGenAsmWriter.inc"
|
#include "PPCGenAsmWriter.inc"
|
||||||
|
|
||||||
@ -639,10 +630,20 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
|
|||||||
// implementation of multiple entry points). If this doesn't occur, the
|
// implementation of multiple entry points). If this doesn't occur, the
|
||||||
// linker can safely perform dead code stripping. Since LLVM never generates
|
// linker can safely perform dead code stripping. Since LLVM never generates
|
||||||
// code that does this, it is always safe to set.
|
// code that does this, it is always safe to set.
|
||||||
if (Subtarget.isDarwin())
|
O << "\t.subsections_via_symbols\n";
|
||||||
O << "\t.subsections_via_symbols\n";
|
|
||||||
|
|
||||||
AsmPrinter::doFinalization(M);
|
AsmPrinter::doFinalization(M);
|
||||||
return false; // success
|
return false; // success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// createDarwinCodePrinterPass - Returns a pass that prints the PPC assembly
|
||||||
|
/// code for a MachineFunction to the given output stream, in a format that the
|
||||||
|
/// Darwin assembler can deal with.
|
||||||
|
///
|
||||||
|
FunctionPass *llvm::createPPCAsmPrinterPass(std::ostream &o,
|
||||||
|
PPCTargetMachine &tm) {
|
||||||
|
return new DarwinAsmPrinter(o, tm, tm.getTargetAsmInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ bool PPCTargetMachine::addPreEmitPass(FunctionPassManager &PM, bool Fast) {
|
|||||||
|
|
||||||
bool PPCTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
bool PPCTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
std::ostream &Out) {
|
std::ostream &Out) {
|
||||||
PM.add(createDarwinCodePrinterPass(Out, *this));
|
PM.add(createPPCAsmPrinterPass(Out, *this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user