mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-28 05:19:42 +00:00
Added support for PIC code with "explicit relocations" *only*.
Removed all macro code for PIC (goodbye "la"). Support tested with shootout bench. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43697 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -203,6 +203,12 @@ foldMemoryOperand(MachineInstr* MI, unsigned OpNum, int FI) const
|
||||
return NewMI;
|
||||
}
|
||||
|
||||
MachineInstr *MipsRegisterInfo::
|
||||
foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
|
||||
MachineInstr* LoadMI) const {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Callee Saved Registers methods
|
||||
@@ -325,7 +331,7 @@ void MipsRegisterInfo::
|
||||
eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
|
||||
RegScavenger *RS) const
|
||||
{
|
||||
MachineInstr &MI = *II;
|
||||
MachineInstr &MI = *II;
|
||||
MachineFunction &MF = *MI.getParent()->getParent();
|
||||
|
||||
unsigned i = 0;
|
||||
@@ -359,7 +365,7 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
|
||||
#endif
|
||||
|
||||
MI.getOperand(i-1).ChangeToImmediate(Offset);
|
||||
MI.getOperand(i).ChangeToRegister(getFrameRegister(MF),false);
|
||||
MI.getOperand(i).ChangeToRegister(getFrameRegister(MF), false);
|
||||
}
|
||||
|
||||
void MipsRegisterInfo::
|
||||
@@ -453,7 +459,6 @@ emitPrologue(MachineFunction &MF) const
|
||||
if ((isPIC) && (MFI->hasCalls()))
|
||||
BuildMI(MBB, MBBI, TII.get(Mips::CPRESTORE))
|
||||
.addImm(MipsFI->getGPStackOffset());
|
||||
|
||||
}
|
||||
|
||||
void MipsRegisterInfo::
|
||||
@@ -498,6 +503,17 @@ emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const
|
||||
|
||||
void MipsRegisterInfo::
|
||||
processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
|
||||
// Set the SPOffset on the FI where GP must be saved/loaded.
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
if (MFI->hasCalls()) {
|
||||
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
|
||||
#ifndef NDEBUG
|
||||
DOUT << "processFunctionBeforeFrameFinalized\n";
|
||||
DOUT << "GPOffset :" << MipsFI->getGPStackOffset() << "\n";
|
||||
DOUT << "FI :" << MipsFI->getGPFI() << "\n";
|
||||
#endif
|
||||
MFI->setObjectOffset(MipsFI->getGPFI(), MipsFI->getGPStackOffset());
|
||||
}
|
||||
}
|
||||
|
||||
unsigned MipsRegisterInfo::
|
||||
|
||||
Reference in New Issue
Block a user