mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
Unify CALLSEQ_{START,END}. They take 4 parameters: the chain, two stack
adjustment fields, and an optional flag. If there is a "dynamic_stackalloc" in the code, make sure that it's bracketed by CALLSEQ_START and CALLSEQ_END. If not, then there is the potential for the stack to be changed while the stack's being used by another instruction (like a call). This can only result in tears... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44037 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -769,10 +769,13 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
||||
bool isThumb = AFI->isThumbFunction();
|
||||
ARMCC::CondCodes Pred = isThumb
|
||||
? ARMCC::AL : (ARMCC::CondCodes)Old->getOperand(1).getImmedValue();
|
||||
unsigned PredReg = isThumb ? 0 : Old->getOperand(2).getReg();
|
||||
if (Opc == ARM::ADJCALLSTACKDOWN || Opc == ARM::tADJCALLSTACKDOWN) {
|
||||
// Note: PredReg is operand 2 for ADJCALLSTACKDOWN.
|
||||
unsigned PredReg = isThumb ? 0 : Old->getOperand(2).getReg();
|
||||
emitSPUpdate(MBB, I, -Amount, Pred, PredReg, isThumb, TII);
|
||||
} else {
|
||||
// Note: PredReg is operand 3 for ADJCALLSTACKUP.
|
||||
unsigned PredReg = isThumb ? 0 : Old->getOperand(3).getReg();
|
||||
assert(Opc == ARM::ADJCALLSTACKUP || Opc == ARM::tADJCALLSTACKUP);
|
||||
emitSPUpdate(MBB, I, Amount, Pred, PredReg, isThumb, TII);
|
||||
}
|
||||
|
Reference in New Issue
Block a user