mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Add definitions of two subclasses of MipsFrameLowering, Mips16FrameLowering and
MipsSEFrameLowering. Implement MipsSEFrameLowering::hasReservedCallFrame. Call frames will not be reserved if there is a call with a large call frame or there are variable sized objects on the stack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161090 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -12,9 +12,11 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MipsTargetMachine.h"
|
||||
#include "MipsSEInstrInfo.h"
|
||||
#include "Mips16InstrInfo.h"
|
||||
#include "Mips.h"
|
||||
#include "Mips16FrameLowering.h"
|
||||
#include "Mips16InstrInfo.h"
|
||||
#include "MipsSEFrameLowering.h"
|
||||
#include "MipsSEInstrInfo.h"
|
||||
#include "llvm/PassManager.h"
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/Support/TargetRegistry.h"
|
||||
@ -39,6 +41,18 @@ static const MipsInstrInfo *genInstrInfo(MipsTargetMachine &TM) {
|
||||
return II;
|
||||
}
|
||||
|
||||
static const MipsFrameLowering *genFrameLowering(MipsTargetMachine &TM,
|
||||
const MipsSubtarget &ST) {
|
||||
const MipsFrameLowering *FL;
|
||||
|
||||
if (TM.getSubtargetImpl()->inMips16Mode())
|
||||
FL = new Mips16FrameLowering(ST);
|
||||
else
|
||||
FL = new MipsSEFrameLowering(ST);
|
||||
|
||||
return FL;
|
||||
}
|
||||
|
||||
// DataLayout --> Big-endian, 32-bit pointer/ABI/alignment
|
||||
// The stack is always 8 byte aligned
|
||||
// On function prologue, the stack is created by decrementing
|
||||
@ -62,7 +76,7 @@ MipsTargetMachine(const Target &T, StringRef TT,
|
||||
"E-p:64:64:64-i8:8:32-i16:16:32-i64:64:64-f128:128:128-n32" :
|
||||
"E-p:32:32:32-i8:8:32-i16:16:32-i64:64:64-n32")),
|
||||
InstrInfo(genInstrInfo(*this)),
|
||||
FrameLowering(Subtarget),
|
||||
FrameLowering(genFrameLowering(*this, Subtarget)),
|
||||
TLInfo(*this), TSInfo(*this), JITInfo() {
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user