mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
CodeGen: Use Register
This commit is contained in:
parent
b9a56d762d
commit
055a1e553d
@ -14,6 +14,7 @@
|
||||
#define LLVM_CODEGEN_MACHINEFRAMEINFO_H
|
||||
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/CodeGen/Register.h"
|
||||
#include "llvm/Support/Alignment.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include <cassert>
|
||||
@ -31,7 +32,7 @@ class AllocaInst;
|
||||
/// Callee saved reg can also be saved to a different register rather than
|
||||
/// on the stack by setting DstReg instead of FrameIdx.
|
||||
class CalleeSavedInfo {
|
||||
unsigned Reg;
|
||||
Register Reg;
|
||||
union {
|
||||
int FrameIdx;
|
||||
unsigned DstReg;
|
||||
@ -58,14 +59,14 @@ public:
|
||||
: Reg(R), FrameIdx(FI), Restored(true), SpilledToReg(false) {}
|
||||
|
||||
// Accessors.
|
||||
unsigned getReg() const { return Reg; }
|
||||
Register getReg() const { return Reg; }
|
||||
int getFrameIdx() const { return FrameIdx; }
|
||||
unsigned getDstReg() const { return DstReg; }
|
||||
void setFrameIdx(int FI) {
|
||||
FrameIdx = FI;
|
||||
SpilledToReg = false;
|
||||
}
|
||||
void setDstReg(unsigned SpillReg) {
|
||||
void setDstReg(Register SpillReg) {
|
||||
DstReg = SpillReg;
|
||||
SpilledToReg = true;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ static int getLibCallID(const MachineFunction &MF,
|
||||
// RISCVRegisterInfo::hasReservedSpillSlot assigns negative frame indexes to
|
||||
// registers which can be saved by libcall.
|
||||
if (CS.getFrameIdx() < 0)
|
||||
MaxReg = std::max(MaxReg.id(), CS.getReg());
|
||||
MaxReg = std::max(MaxReg.id(), CS.getReg().id());
|
||||
|
||||
if (MaxReg == RISCV::NoRegister)
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user