mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183491 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
54a56fad36
commit
637eab6a3b
@ -37,13 +37,11 @@ static cl::opt<bool> MBDisableDelaySlotFiller(
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct Filler : public MachineFunctionPass {
|
struct Filler : public MachineFunctionPass {
|
||||||
|
|
||||||
TargetMachine &TM;
|
TargetMachine &TM;
|
||||||
const TargetInstrInfo *TII;
|
|
||||||
|
|
||||||
static char ID;
|
static char ID;
|
||||||
Filler(TargetMachine &tm)
|
Filler(TargetMachine &tm)
|
||||||
: MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { }
|
: MachineFunctionPass(ID), TM(tm) { }
|
||||||
|
|
||||||
virtual const char *getPassName() const {
|
virtual const char *getPassName() const {
|
||||||
return "MBlaze Delay Slot Filler";
|
return "MBlaze Delay Slot Filler";
|
||||||
@ -239,7 +237,7 @@ bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
Changed = true;
|
Changed = true;
|
||||||
|
|
||||||
if (D == MBB.end())
|
if (D == MBB.end())
|
||||||
BuildMI(MBB, ++J, I->getDebugLoc(), TII->get(MBlaze::NOP));
|
BuildMI(MBB, ++J, I->getDebugLoc(),TM.getInstrInfo()->get(MBlaze::NOP));
|
||||||
else
|
else
|
||||||
MBB.splice(++J, &MBB, D);
|
MBB.splice(++J, &MBB, D);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ using namespace llvm;
|
|||||||
|
|
||||||
MBlazeInstrInfo::MBlazeInstrInfo(MBlazeTargetMachine &tm)
|
MBlazeInstrInfo::MBlazeInstrInfo(MBlazeTargetMachine &tm)
|
||||||
: MBlazeGenInstrInfo(MBlaze::ADJCALLSTACKDOWN, MBlaze::ADJCALLSTACKUP),
|
: MBlazeGenInstrInfo(MBlaze::ADJCALLSTACKDOWN, MBlaze::ADJCALLSTACKUP),
|
||||||
TM(tm), RI(*TM.getSubtargetImpl(), *this) {}
|
TM(tm), RI(*TM.getSubtargetImpl()) {}
|
||||||
|
|
||||||
static bool isZeroImm(const MachineOperand &op) {
|
static bool isZeroImm(const MachineOperand &op) {
|
||||||
return op.isImm() && op.getImm() == 0;
|
return op.isImm() && op.getImm() == 0;
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
MBlazeRegisterInfo::
|
MBlazeRegisterInfo::
|
||||||
MBlazeRegisterInfo(const MBlazeSubtarget &ST, const TargetInstrInfo &tii)
|
MBlazeRegisterInfo(const MBlazeSubtarget &ST)
|
||||||
: MBlazeGenRegisterInfo(MBlaze::R15), Subtarget(ST), TII(tii) {}
|
: MBlazeGenRegisterInfo(MBlaze::R15), Subtarget(ST) {}
|
||||||
|
|
||||||
unsigned MBlazeRegisterInfo::getPICCallReg() {
|
unsigned MBlazeRegisterInfo::getPICCallReg() {
|
||||||
return MBlaze::R20;
|
return MBlaze::R20;
|
||||||
|
@ -37,10 +37,8 @@ namespace MBlaze {
|
|||||||
|
|
||||||
struct MBlazeRegisterInfo : public MBlazeGenRegisterInfo {
|
struct MBlazeRegisterInfo : public MBlazeGenRegisterInfo {
|
||||||
const MBlazeSubtarget &Subtarget;
|
const MBlazeSubtarget &Subtarget;
|
||||||
const TargetInstrInfo &TII;
|
|
||||||
|
|
||||||
MBlazeRegisterInfo(const MBlazeSubtarget &Subtarget,
|
MBlazeRegisterInfo(const MBlazeSubtarget &Subtarget);
|
||||||
const TargetInstrInfo &tii);
|
|
||||||
|
|
||||||
/// Get PIC indirect call register
|
/// Get PIC indirect call register
|
||||||
static unsigned getPICCallReg();
|
static unsigned getPICCallReg();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user