mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Fix 80-columns, tab characters, and comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207472 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4ef6c0908b
commit
4ffd83b92b
@ -225,7 +225,8 @@ void mergeSPUpdatesUp(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI,
|
||||
}
|
||||
}
|
||||
|
||||
/// mergeSPUpdatesDown - Merge two stack-manipulating instructions lower iterator.
|
||||
/// mergeSPUpdatesDown - Merge two stack-manipulating instructions lower
|
||||
/// iterator.
|
||||
static
|
||||
void mergeSPUpdatesDown(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator &MBBI,
|
||||
@ -257,13 +258,12 @@ void mergeSPUpdatesDown(MachineBasicBlock &MBB,
|
||||
}
|
||||
|
||||
/// mergeSPUpdates - Checks the instruction before/after the passed
|
||||
/// instruction. If it is an ADD/SUB/LEA instruction it is deleted argument and the
|
||||
/// stack adjustment is returned as a positive value for ADD/LEA and a negative for
|
||||
/// SUB.
|
||||
/// instruction. If it is an ADD/SUB/LEA instruction it is deleted argument and
|
||||
/// the stack adjustment is returned as a positive value for ADD/LEA and a
|
||||
/// negative for SUB.
|
||||
static int mergeSPUpdates(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator &MBBI,
|
||||
unsigned StackPtr,
|
||||
bool doMergeWithPrevious) {
|
||||
MachineBasicBlock::iterator &MBBI, unsigned StackPtr,
|
||||
bool doMergeWithPrevious) {
|
||||
if ((doMergeWithPrevious && MBBI == MBB.begin()) ||
|
||||
(!doMergeWithPrevious && MBBI == MBB.end()))
|
||||
return 0;
|
||||
@ -909,7 +909,8 @@ void X86FrameLowering::emitEpilogue(MachineFunction &MF,
|
||||
}
|
||||
}
|
||||
|
||||
int X86FrameLowering::getFrameIndexOffset(const MachineFunction &MF, int FI) const {
|
||||
int X86FrameLowering::getFrameIndexOffset(const MachineFunction &MF,
|
||||
int FI) const {
|
||||
const X86RegisterInfo *RegInfo =
|
||||
static_cast<const X86RegisterInfo*>(MF.getTarget().getRegisterInfo());
|
||||
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
@ -1260,22 +1261,23 @@ X86FrameLowering::adjustForSegmentedStacks(MachineFunction &MF) const {
|
||||
.addReg(0).addImm(0).addReg(0).addImm(TlsOffset).addReg(TlsReg);
|
||||
} else if (STI.isTargetDarwin()) {
|
||||
|
||||
// TlsOffset doesn't fit into a mod r/m byte so we need an extra register
|
||||
// TlsOffset doesn't fit into a mod r/m byte so we need an extra register.
|
||||
unsigned ScratchReg2;
|
||||
bool SaveScratch2;
|
||||
if (CompareStackPointer) {
|
||||
// The primary scratch register is available for holding the TLS offset
|
||||
// The primary scratch register is available for holding the TLS offset.
|
||||
ScratchReg2 = GetScratchRegister(Is64Bit, MF, true);
|
||||
SaveScratch2 = false;
|
||||
} else {
|
||||
// Need to use a second register to hold the TLS offset
|
||||
ScratchReg2 = GetScratchRegister(Is64Bit, MF, false);
|
||||
|
||||
// Unfortunately, with fastcc the second scratch register may hold an arg
|
||||
// Unfortunately, with fastcc the second scratch register may hold an
|
||||
// argument.
|
||||
SaveScratch2 = MF.getRegInfo().isLiveIn(ScratchReg2);
|
||||
}
|
||||
|
||||
// If Scratch2 is live-in then it needs to be saved
|
||||
// If Scratch2 is live-in then it needs to be saved.
|
||||
assert((!MF.getRegInfo().isLiveIn(ScratchReg2) || SaveScratch2) &&
|
||||
"Scratch register is live-in and not saved");
|
||||
|
||||
@ -1352,14 +1354,14 @@ X86FrameLowering::adjustForSegmentedStacks(MachineFunction &MF) const {
|
||||
/// http://publications.uu.se/uu/fulltext/nbn_se_uu_diva-2688.pdf)
|
||||
///
|
||||
/// CheckStack:
|
||||
/// temp0 = sp - MaxStack
|
||||
/// if( temp0 < SP_LIMIT(P) ) goto IncStack else goto OldStart
|
||||
/// temp0 = sp - MaxStack
|
||||
/// if( temp0 < SP_LIMIT(P) ) goto IncStack else goto OldStart
|
||||
/// OldStart:
|
||||
/// ...
|
||||
/// ...
|
||||
/// IncStack:
|
||||
/// call inc_stack # doubles the stack space
|
||||
/// temp0 = sp - MaxStack
|
||||
/// if( temp0 < SP_LIMIT(P) ) goto IncStack else goto OldStart
|
||||
/// call inc_stack # doubles the stack space
|
||||
/// temp0 = sp - MaxStack
|
||||
/// if( temp0 < SP_LIMIT(P) ) goto IncStack else goto OldStart
|
||||
void X86FrameLowering::adjustForHiPEPrologue(MachineFunction &MF) const {
|
||||
const X86InstrInfo &TII = *TM.getInstrInfo();
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
|
Loading…
Reference in New Issue
Block a user