mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 17:28:54 +00:00
Wrap some darwin'isms with isDarwin checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30541 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -49,9 +49,11 @@ namespace {
|
|||||||
|
|
||||||
struct VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
|
struct VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
|
||||||
std::set<std::string> FnStubs, GVStubs;
|
std::set<std::string> FnStubs, GVStubs;
|
||||||
|
const PPCSubtarget &Subtarget;
|
||||||
|
|
||||||
PPCAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
|
PPCAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
|
||||||
: AsmPrinter(O, TM, T) {}
|
: AsmPrinter(O, TM, T), Subtarget(TM.getSubtarget<PPCSubtarget>()) {
|
||||||
|
}
|
||||||
|
|
||||||
virtual const char *getPassName() const {
|
virtual const char *getPassName() const {
|
||||||
return "PowerPC Assembly Printer";
|
return "PowerPC Assembly Printer";
|
||||||
@@ -248,7 +250,7 @@ namespace {
|
|||||||
DarwinAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
|
DarwinAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
|
||||||
const TargetAsmInfo *T)
|
const TargetAsmInfo *T)
|
||||||
: PPCAsmPrinter(O, TM, T), DW(O, this, T) {
|
: PPCAsmPrinter(O, TM, T), DW(O, this, T) {
|
||||||
bool isPPC64 = TM.getSubtargetImpl()->isPPC64();
|
bool isPPC64 = Subtarget.isPPC64();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char *getPassName() const {
|
virtual const char *getPassName() const {
|
||||||
@@ -480,7 +482,7 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
|
|
||||||
bool DarwinAsmPrinter::doInitialization(Module &M) {
|
bool DarwinAsmPrinter::doInitialization(Module &M) {
|
||||||
if (TM.getSubtarget<PPCSubtarget>().isGigaProcessor())
|
if (Subtarget.isGigaProcessor())
|
||||||
O << "\t.machine ppc970\n";
|
O << "\t.machine ppc970\n";
|
||||||
AsmPrinter::doInitialization(M);
|
AsmPrinter::doInitialization(M);
|
||||||
|
|
||||||
@@ -637,7 +639,8 @@ 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.
|
||||||
O << "\t.subsections_via_symbols\n";
|
if (Subtarget.isDarwin())
|
||||||
|
O << "\t.subsections_via_symbols\n";
|
||||||
|
|
||||||
AsmPrinter::doFinalization(M);
|
AsmPrinter::doFinalization(M);
|
||||||
return false; // success
|
return false; // success
|
||||||
|
Reference in New Issue
Block a user