@@ -102,13 +102,13 @@ RISCVFrameLowering::RISCVFrameLowering(const RISCVSubtarget &STI)
102
102
STI(STI) {}
103
103
104
104
// The register used to hold the frame pointer.
105
- static constexpr Register FPReg = RISCV::X8;
105
+ static constexpr MCPhysReg FPReg = RISCV::X8;
106
106
107
107
// The register used to hold the stack pointer.
108
- static constexpr Register SPReg = RISCV::X2;
108
+ static constexpr MCPhysReg SPReg = RISCV::X2;
109
109
110
110
// The register used to hold the return address.
111
- static constexpr Register RAReg = RISCV::X1;
111
+ static constexpr MCPhysReg RAReg = RISCV::X1;
112
112
113
113
// Offsets which need to be scale by XLen representing locations of CSRs which
114
114
// are given a fixed location by save/restore libcalls or Zcmp Push/Pop.
@@ -250,17 +250,17 @@ static int getLibCallID(const MachineFunction &MF,
250
250
if (CSI.empty () || !RVFI->useSaveRestoreLibCalls (MF))
251
251
return -1 ;
252
252
253
- Register MaxReg = RISCV::NoRegister ;
253
+ Register MaxReg;
254
254
for (auto &CS : CSI)
255
255
// assignCalleeSavedSpillSlots assigns negative frame indexes to
256
256
// registers which can be saved by libcall.
257
257
if (CS.getFrameIdx () < 0 )
258
258
MaxReg = std::max (MaxReg.id (), CS.getReg ().id ());
259
259
260
- if (MaxReg == RISCV::NoRegister )
260
+ if (! MaxReg)
261
261
return -1 ;
262
262
263
- switch (MaxReg) {
263
+ switch (MaxReg. id () ) {
264
264
default :
265
265
llvm_unreachable (" Something has gone wrong!" );
266
266
// clang-format off
@@ -339,7 +339,7 @@ getRestoreLibCallName(const MachineFunction &MF,
339
339
// representing registers to store/load.
340
340
static std::pair<unsigned , unsigned >
341
341
getPushPopEncodingAndNum (const Register MaxReg) {
342
- switch (MaxReg) {
342
+ switch (MaxReg. id () ) {
343
343
default :
344
344
llvm_unreachable (" Unexpected Reg for Push/Pop Inst" );
345
345
case RISCV::X27: /* s11*/
@@ -1809,7 +1809,7 @@ bool RISCVFrameLowering::assignCalleeSavedSpillSlots(
1809
1809
const TargetRegisterInfo *RegInfo = MF.getSubtarget ().getRegisterInfo ();
1810
1810
1811
1811
for (auto &CS : CSI) {
1812
- unsigned Reg = CS.getReg ();
1812
+ Register Reg = CS.getReg ();
1813
1813
const TargetRegisterClass *RC = RegInfo->getMinimalPhysRegClass (Reg);
1814
1814
unsigned Size = RegInfo->getSpillSize (*RC);
1815
1815
0 commit comments