mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-12 06:06:19 +00:00
Change interface so that we can add to the end of a basic block
without getting an assertion from ilist that we are dereferencing ilist<T>::end(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11345 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0eda78a372
commit
024126ee23
@ -17,11 +17,11 @@
|
|||||||
#define LLVM_TARGET_MREGISTERINFO_H
|
#define LLVM_TARGET_MREGISTERINFO_H
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
class Type;
|
class Type;
|
||||||
class MachineBasicBlock;
|
|
||||||
class MachineFunction;
|
class MachineFunction;
|
||||||
class MachineInstr;
|
class MachineInstr;
|
||||||
|
|
||||||
@ -227,17 +227,17 @@ public:
|
|||||||
//
|
//
|
||||||
|
|
||||||
virtual int storeRegToStackSlot(MachineBasicBlock &MBB,
|
virtual int storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI,
|
MachineBasicBlock::iterator MI,
|
||||||
unsigned SrcReg, int FrameIndex,
|
unsigned SrcReg, int FrameIndex,
|
||||||
const TargetRegisterClass *RC) const = 0;
|
const TargetRegisterClass *RC) const = 0;
|
||||||
|
|
||||||
virtual int loadRegFromStackSlot(MachineBasicBlock &MBB,
|
virtual int loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI,
|
MachineBasicBlock::iterator MI,
|
||||||
unsigned DestReg, int FrameIndex,
|
unsigned DestReg, int FrameIndex,
|
||||||
const TargetRegisterClass *RC) const = 0;
|
const TargetRegisterClass *RC) const = 0;
|
||||||
|
|
||||||
virtual int copyRegToReg(MachineBasicBlock &MBB,
|
virtual int copyRegToReg(MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI,
|
MachineBasicBlock::iterator MI,
|
||||||
unsigned DestReg, unsigned SrcReg,
|
unsigned DestReg, unsigned SrcReg,
|
||||||
const TargetRegisterClass *RC) const = 0;
|
const TargetRegisterClass *RC) const = 0;
|
||||||
|
|
||||||
@ -262,7 +262,7 @@ public:
|
|||||||
///
|
///
|
||||||
virtual int eliminateCallFramePseudoInstr(MachineFunction &MF,
|
virtual int eliminateCallFramePseudoInstr(MachineFunction &MF,
|
||||||
MachineBasicBlock &MBB,
|
MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI) const {
|
MachineBasicBlock::iterator MI) const {
|
||||||
assert(getCallFrameSetupOpcode()== -1 && getCallFrameDestroyOpcode()== -1 &&
|
assert(getCallFrameSetupOpcode()== -1 && getCallFrameDestroyOpcode()== -1 &&
|
||||||
"eliminateCallFramePseudoInstr must be implemented if using"
|
"eliminateCallFramePseudoInstr must be implemented if using"
|
||||||
" call frame setup/destroy pseudo instructions!");
|
" call frame setup/destroy pseudo instructions!");
|
||||||
@ -290,7 +290,7 @@ public:
|
|||||||
/// added to (negative if removed from) the basic block.
|
/// added to (negative if removed from) the basic block.
|
||||||
///
|
///
|
||||||
virtual int eliminateFrameIndex(MachineFunction &MF,
|
virtual int eliminateFrameIndex(MachineFunction &MF,
|
||||||
MachineInstr* MI) const = 0;
|
MachineBasicBlock::iterator MI) const = 0;
|
||||||
|
|
||||||
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
||||||
/// the function. The return value is the number of instructions
|
/// the function. The return value is the number of instructions
|
||||||
|
@ -47,7 +47,7 @@ static unsigned getIdx(const TargetRegisterClass *RC) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int X86RegisterInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
int X86RegisterInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI,
|
MachineBasicBlock::iterator MI,
|
||||||
unsigned SrcReg, int FrameIdx,
|
unsigned SrcReg, int FrameIdx,
|
||||||
const TargetRegisterClass *RC) const {
|
const TargetRegisterClass *RC) const {
|
||||||
static const unsigned Opcode[] =
|
static const unsigned Opcode[] =
|
||||||
@ -59,7 +59,7 @@ int X86RegisterInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int X86RegisterInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
int X86RegisterInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI,
|
MachineBasicBlock::iterator MI,
|
||||||
unsigned DestReg, int FrameIdx,
|
unsigned DestReg, int FrameIdx,
|
||||||
const TargetRegisterClass *RC) const{
|
const TargetRegisterClass *RC) const{
|
||||||
static const unsigned Opcode[] =
|
static const unsigned Opcode[] =
|
||||||
@ -70,7 +70,7 @@ int X86RegisterInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int X86RegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
|
int X86RegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI,
|
MachineBasicBlock::iterator MI,
|
||||||
unsigned DestReg, unsigned SrcReg,
|
unsigned DestReg, unsigned SrcReg,
|
||||||
const TargetRegisterClass *RC) const {
|
const TargetRegisterClass *RC) const {
|
||||||
static const unsigned Opcode[] =
|
static const unsigned Opcode[] =
|
||||||
@ -93,7 +93,7 @@ static bool hasFP(MachineFunction &MF) {
|
|||||||
|
|
||||||
int X86RegisterInfo::eliminateCallFramePseudoInstr(MachineFunction &MF,
|
int X86RegisterInfo::eliminateCallFramePseudoInstr(MachineFunction &MF,
|
||||||
MachineBasicBlock &MBB,
|
MachineBasicBlock &MBB,
|
||||||
MachineInstr* I) const {
|
MachineBasicBlock::iterator I) const {
|
||||||
MachineInstr *New = 0, *Old = I;
|
MachineInstr *New = 0, *Old = I;
|
||||||
if (hasFP(MF)) {
|
if (hasFP(MF)) {
|
||||||
// If we have a frame pointer, turn the adjcallstackup instruction into a
|
// If we have a frame pointer, turn the adjcallstackup instruction into a
|
||||||
@ -127,7 +127,7 @@ int X86RegisterInfo::eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int X86RegisterInfo::eliminateFrameIndex(MachineFunction &MF,
|
int X86RegisterInfo::eliminateFrameIndex(MachineFunction &MF,
|
||||||
MachineInstr* II) const {
|
MachineBasicBlock::iterator II) const {
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
MachineInstr &MI = *II;
|
MachineInstr &MI = *II;
|
||||||
while (!MI.getOperand(i).isFrameIndex()) {
|
while (!MI.getOperand(i).isFrameIndex()) {
|
||||||
|
@ -28,26 +28,26 @@ struct X86RegisterInfo : public X86GenRegisterInfo {
|
|||||||
|
|
||||||
/// Code Generation virtual methods...
|
/// Code Generation virtual methods...
|
||||||
int storeRegToStackSlot(MachineBasicBlock &MBB,
|
int storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI,
|
MachineBasicBlock::iterator MI,
|
||||||
unsigned SrcReg, int FrameIndex,
|
unsigned SrcReg, int FrameIndex,
|
||||||
const TargetRegisterClass *RC) const;
|
const TargetRegisterClass *RC) const;
|
||||||
|
|
||||||
int loadRegFromStackSlot(MachineBasicBlock &MBB,
|
int loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI,
|
MachineBasicBlock::iterator MI,
|
||||||
unsigned DestReg, int FrameIndex,
|
unsigned DestReg, int FrameIndex,
|
||||||
const TargetRegisterClass *RC) const;
|
const TargetRegisterClass *RC) const;
|
||||||
|
|
||||||
int copyRegToReg(MachineBasicBlock &MBB,
|
int copyRegToReg(MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI,
|
MachineBasicBlock::iterator MI,
|
||||||
unsigned DestReg, unsigned SrcReg,
|
unsigned DestReg, unsigned SrcReg,
|
||||||
const TargetRegisterClass *RC) const;
|
const TargetRegisterClass *RC) const;
|
||||||
|
|
||||||
int eliminateCallFramePseudoInstr(MachineFunction &MF,
|
int eliminateCallFramePseudoInstr(MachineFunction &MF,
|
||||||
MachineBasicBlock &MBB,
|
MachineBasicBlock &MBB,
|
||||||
MachineInstr* MI) const;
|
MachineBasicBlock::iterator MI) const;
|
||||||
|
|
||||||
int eliminateFrameIndex(MachineFunction &MF,
|
int eliminateFrameIndex(MachineFunction &MF,
|
||||||
MachineInstr* MI) const;
|
MachineBasicBlock::iterator MI) const;
|
||||||
|
|
||||||
int processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
int processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user