mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-06 16:46:40 +00:00
Provide set of reserved registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70704 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fd1b7c778c
commit
dcb802cf7b
@ -80,8 +80,8 @@ SDValue MSP430TargetLowering::LowerFORMAL_ARGUMENTS(SDValue Op,
|
|||||||
/// generate load operations for arguments places on the stack.
|
/// generate load operations for arguments places on the stack.
|
||||||
// FIXME: struct return stuff
|
// FIXME: struct return stuff
|
||||||
// FIXME: varargs
|
// FIXME: varargs
|
||||||
SDValue MSP430TargetLowering:: LowerCCCArguments(SDValue Op,
|
SDValue MSP430TargetLowering::LowerCCCArguments(SDValue Op,
|
||||||
SelectionDAG &DAG) {
|
SelectionDAG &DAG) {
|
||||||
MachineFunction &MF = DAG.getMachineFunction();
|
MachineFunction &MF = DAG.getMachineFunction();
|
||||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||||
MachineRegisterInfo &RegInfo = MF.getRegInfo();
|
MachineRegisterInfo &RegInfo = MF.getRegInfo();
|
||||||
@ -193,8 +193,8 @@ SDValue MSP430TargetLowering::LowerRET(SDValue Op, SelectionDAG &DAG) {
|
|||||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||||
Op.getOperand(i*2+1), Flag);
|
Op.getOperand(i*2+1), Flag);
|
||||||
|
|
||||||
// guarantee that all emitted copies are
|
// Guarantee that all emitted copies are stuck together,
|
||||||
// stuck together, avoiding something bad
|
// avoiding something bad.
|
||||||
Flag = Chain.getValue(1);
|
Flag = Chain.getValue(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,19 @@ MSP430RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
|
|||||||
|
|
||||||
BitVector
|
BitVector
|
||||||
MSP430RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
|
MSP430RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
|
||||||
assert(0 && "Not implemented yet!");
|
BitVector Reserved(getNumRegs());
|
||||||
|
|
||||||
|
// Mark 4 special registers as reserved.
|
||||||
|
Reserved.set(MSP430::PC);
|
||||||
|
Reserved.set(MSP430::SP);
|
||||||
|
Reserved.set(MSP430::SR);
|
||||||
|
Reserved.set(MSP430::CG);
|
||||||
|
|
||||||
|
// Mark frame pointer as reserved if needed.
|
||||||
|
if (hasFP(MF))
|
||||||
|
Reserved.set(MSP430::FP);
|
||||||
|
|
||||||
|
return Reserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MSP430RegisterInfo::hasFP(const MachineFunction &MF) const {
|
bool MSP430RegisterInfo::hasFP(const MachineFunction &MF) const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user