mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
ARM MachO: sort out isTargetDarwin/isTargetIOS/... checks.
The ARM backend has been using most of the MachO related subtarget checks almost interchangeably, and since the only target it's had to run on has been IOS (which is all three of MachO, Darwin and IOS) it's worked out OK so far. But we'd like to support embedded targets under the "*-*-none-macho" triple, which means everything starts falling apart and inconsistent behaviours emerge. This patch should pick a reasonably sensible set of behaviours for the new triple (and any others that come along, with luck). Some choices were debatable (notably FP == r7 or r11), but we can revisit those later when deficiencies become apparent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198617 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -195,7 +195,7 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
case ARM::R12:
|
||||
if (Reg == FramePtr)
|
||||
FramePtrSpillFI = FI;
|
||||
if (STI.isTargetIOS())
|
||||
if (STI.isTargetMachO())
|
||||
GPRCS2Size += 4;
|
||||
else
|
||||
GPRCS1Size += 4;
|
||||
@@ -454,7 +454,7 @@ void ARMFrameLowering::emitEpilogue(MachineFunction &MF,
|
||||
// Jump to label or value in register.
|
||||
if (RetOpcode == ARM::TCRETURNdi) {
|
||||
unsigned TCOpcode = STI.isThumb() ?
|
||||
(STI.isTargetIOS() ? ARM::tTAILJMPd : ARM::tTAILJMPdND) :
|
||||
(STI.isTargetMachO() ? ARM::tTAILJMPd : ARM::tTAILJMPdND) :
|
||||
ARM::TAILJMPd;
|
||||
MachineInstrBuilder MIB = BuildMI(MBB, MBBI, dl, TII.get(TCOpcode));
|
||||
if (JumpTarget.isGlobal())
|
||||
@@ -599,7 +599,7 @@ void ARMFrameLowering::emitPushInst(MachineBasicBlock &MBB,
|
||||
unsigned LastReg = 0;
|
||||
for (; i != 0; --i) {
|
||||
unsigned Reg = CSI[i-1].getReg();
|
||||
if (!(Func)(Reg, STI.isTargetIOS())) continue;
|
||||
if (!(Func)(Reg, STI.isTargetMachO())) continue;
|
||||
|
||||
// D-registers in the aligned area DPRCS2 are NOT spilled here.
|
||||
if (Reg >= ARM::D8 && Reg < ARM::D8 + NumAlignedDPRCS2Regs)
|
||||
@@ -672,7 +672,7 @@ void ARMFrameLowering::emitPopInst(MachineBasicBlock &MBB,
|
||||
bool DeleteRet = false;
|
||||
for (; i != 0; --i) {
|
||||
unsigned Reg = CSI[i-1].getReg();
|
||||
if (!(Func)(Reg, STI.isTargetIOS())) continue;
|
||||
if (!(Func)(Reg, STI.isTargetMachO())) continue;
|
||||
|
||||
// The aligned reloads from area DPRCS2 are not inserted here.
|
||||
if (Reg >= ARM::D8 && Reg < ARM::D8 + NumAlignedDPRCS2Regs)
|
||||
@@ -1221,7 +1221,7 @@ ARMFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||
if (Spilled) {
|
||||
NumGPRSpills++;
|
||||
|
||||
if (!STI.isTargetIOS()) {
|
||||
if (!STI.isTargetMachO()) {
|
||||
if (Reg == ARM::LR)
|
||||
LRSpilled = true;
|
||||
CS1Spilled = true;
|
||||
@@ -1243,7 +1243,7 @@ ARMFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!STI.isTargetIOS()) {
|
||||
if (!STI.isTargetMachO()) {
|
||||
UnspilledCS1GPRs.push_back(Reg);
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user