mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Move CallFrameSetupOpcode and CallFrameDestroyOpcode to TargetInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134030 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -44,7 +44,9 @@ class TargetInstrInfo : public MCInstrInfo {
|
||||
TargetInstrInfo(const TargetInstrInfo &); // DO NOT IMPLEMENT
|
||||
void operator=(const TargetInstrInfo &); // DO NOT IMPLEMENT
|
||||
public:
|
||||
TargetInstrInfo(const MCInstrDesc *desc, unsigned NumOpcodes);
|
||||
TargetInstrInfo(const MCInstrDesc *desc, unsigned NumOpcodes,
|
||||
int CallFrameSetupOpcode = -1,
|
||||
int CallFrameDestroyOpcode = -1);
|
||||
virtual ~TargetInstrInfo();
|
||||
|
||||
/// getRegClass - Givem a machine instruction descriptor, returns the register
|
||||
@@ -86,6 +88,15 @@ private:
|
||||
AliasAnalysis *AA) const;
|
||||
|
||||
public:
|
||||
/// getCallFrameSetup/DestroyOpcode - These methods return the opcode of the
|
||||
/// frame setup/destroy instructions if they exist (-1 otherwise). Some
|
||||
/// targets use pseudo instructions in order to abstract away the difference
|
||||
/// between operating with a frame pointer and operating without, through the
|
||||
/// use of these two instructions.
|
||||
///
|
||||
int getCallFrameSetupOpcode() const { return CallFrameSetupOpcode; }
|
||||
int getCallFrameDestroyOpcode() const { return CallFrameDestroyOpcode; }
|
||||
|
||||
/// isCoalescableExtInstr - Return true if the instruction is a "coalescable"
|
||||
/// extension instruction. That is, it's like a copy where it's legal for the
|
||||
/// source to overlap the destination. e.g. X86::MOVSX64rr32. If this returns
|
||||
@@ -656,6 +667,9 @@ public:
|
||||
virtual
|
||||
bool hasLowDefLatency(const InstrItineraryData *ItinData,
|
||||
const MachineInstr *DefMI, unsigned DefIdx) const;
|
||||
|
||||
private:
|
||||
int CallFrameSetupOpcode, CallFrameDestroyOpcode;
|
||||
};
|
||||
|
||||
/// TargetInstrInfoImpl - This is the default implementation of
|
||||
@@ -664,7 +678,9 @@ public:
|
||||
/// libcodegen, not in libtarget.
|
||||
class TargetInstrInfoImpl : public TargetInstrInfo {
|
||||
protected:
|
||||
TargetInstrInfoImpl(const MCInstrDesc *desc, unsigned NumOpcodes)
|
||||
TargetInstrInfoImpl(const MCInstrDesc *desc, unsigned NumOpcodes,
|
||||
int CallFrameSetupOpcode = -1,
|
||||
int CallFrameDestroyOpcode = -1)
|
||||
: TargetInstrInfo(desc, NumOpcodes) {}
|
||||
public:
|
||||
virtual void ReplaceTailWithBranchTo(MachineBasicBlock::iterator OldInst,
|
||||
|
@@ -275,15 +275,12 @@ private:
|
||||
const TargetRegisterInfoDesc *InfoDesc; // Extra desc array for codegen
|
||||
const char *const *SubRegIndexNames; // Names of subreg indexes.
|
||||
regclass_iterator RegClassBegin, RegClassEnd; // List of regclasses
|
||||
int CallFrameSetupOpcode, CallFrameDestroyOpcode;
|
||||
|
||||
protected:
|
||||
TargetRegisterInfo(const TargetRegisterInfoDesc *ID,
|
||||
regclass_iterator RegClassBegin,
|
||||
regclass_iterator RegClassEnd,
|
||||
const char *const *subregindexnames,
|
||||
int CallFrameSetupOpcode = -1,
|
||||
int CallFrameDestroyOpcode = -1);
|
||||
const char *const *subregindexnames);
|
||||
virtual ~TargetRegisterInfo();
|
||||
public:
|
||||
|
||||
@@ -661,15 +658,6 @@ public:
|
||||
return false; // Must return a value in order to compile with VS 2005
|
||||
}
|
||||
|
||||
/// getCallFrameSetup/DestroyOpcode - These methods return the opcode of the
|
||||
/// frame setup/destroy instructions if they exist (-1 otherwise). Some
|
||||
/// targets use pseudo instructions in order to abstract away the difference
|
||||
/// between operating with a frame pointer and operating without, through the
|
||||
/// use of these two instructions.
|
||||
///
|
||||
int getCallFrameSetupOpcode() const { return CallFrameSetupOpcode; }
|
||||
int getCallFrameDestroyOpcode() const { return CallFrameDestroyOpcode; }
|
||||
|
||||
/// eliminateCallFramePseudoInstr - This method is called during prolog/epilog
|
||||
/// code insertion to eliminate call frame setup and destroy pseudo
|
||||
/// instructions (but only if the Target is using them). It is responsible
|
||||
@@ -681,9 +669,6 @@ public:
|
||||
eliminateCallFramePseudoInstr(MachineFunction &MF,
|
||||
MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI) const {
|
||||
assert(getCallFrameSetupOpcode()== -1 && getCallFrameDestroyOpcode()== -1 &&
|
||||
"eliminateCallFramePseudoInstr must be implemented if using"
|
||||
" call frame setup/destroy pseudo instructions!");
|
||||
assert(0 && "Call Frame Pseudo Instructions do not exist on this target!");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user