@@ -101,12 +101,12 @@ class MSP430Operand : public MCParsedAsmOperand {
101101 } Kind;
102102
103103 struct Memory {
104- unsigned Reg;
104+ MCRegister Reg;
105105 const MCExpr *Offset;
106106 };
107107 union {
108108 const MCExpr *Imm;
109- unsigned Reg;
109+ MCRegister Reg;
110110 StringRef Tok;
111111 Memory Mem;
112112 };
@@ -116,11 +116,11 @@ class MSP430Operand : public MCParsedAsmOperand {
116116public:
117117 MSP430Operand (StringRef Tok, SMLoc const &S)
118118 : Kind(k_Tok), Tok(Tok), Start(S), End(S) {}
119- MSP430Operand (KindTy Kind, unsigned Reg, SMLoc const &S, SMLoc const &E)
119+ MSP430Operand (KindTy Kind, MCRegister Reg, SMLoc const &S, SMLoc const &E)
120120 : Kind(Kind), Reg(Reg), Start(S), End(E) {}
121121 MSP430Operand (MCExpr const *Imm, SMLoc const &S, SMLoc const &E)
122122 : Kind(k_Imm), Imm(Imm), Start(S), End(E) {}
123- MSP430Operand (unsigned Reg, MCExpr const *Expr, SMLoc const &S,
123+ MSP430Operand (MCRegister Reg, MCExpr const *Expr, SMLoc const &S,
124124 SMLoc const &E)
125125 : Kind(k_Mem), Mem({Reg, Expr}), Start(S), End(E) {}
126126
@@ -188,7 +188,7 @@ class MSP430Operand : public MCParsedAsmOperand {
188188 return Reg;
189189 }
190190
191- void setReg (unsigned RegNo) {
191+ void setReg (MCRegister RegNo) {
192192 assert (Kind == k_Reg && " Invalid access!" );
193193 Reg = RegNo;
194194 }
@@ -197,30 +197,29 @@ class MSP430Operand : public MCParsedAsmOperand {
197197 return std::make_unique<MSP430Operand>(Str, S);
198198 }
199199
200- static std::unique_ptr<MSP430Operand> CreateReg (unsigned RegNum , SMLoc S,
200+ static std::unique_ptr<MSP430Operand> CreateReg (MCRegister Reg , SMLoc S,
201201 SMLoc E) {
202- return std::make_unique<MSP430Operand>(k_Reg, RegNum , S, E);
202+ return std::make_unique<MSP430Operand>(k_Reg, Reg , S, E);
203203 }
204204
205205 static std::unique_ptr<MSP430Operand> CreateImm (const MCExpr *Val, SMLoc S,
206206 SMLoc E) {
207207 return std::make_unique<MSP430Operand>(Val, S, E);
208208 }
209209
210- static std::unique_ptr<MSP430Operand> CreateMem (unsigned RegNum,
211- const MCExpr *Val,
212- SMLoc S, SMLoc E) {
213- return std::make_unique<MSP430Operand>(RegNum, Val, S, E);
210+ static std::unique_ptr<MSP430Operand>
211+ CreateMem (MCRegister Reg, const MCExpr *Val, SMLoc S, SMLoc E) {
212+ return std::make_unique<MSP430Operand>(Reg, Val, S, E);
214213 }
215214
216- static std::unique_ptr<MSP430Operand> CreateIndReg (unsigned RegNum , SMLoc S,
217- SMLoc E) {
218- return std::make_unique<MSP430Operand>(k_IndReg, RegNum , S, E);
215+ static std::unique_ptr<MSP430Operand> CreateIndReg (MCRegister Reg , SMLoc S,
216+ SMLoc E) {
217+ return std::make_unique<MSP430Operand>(k_IndReg, Reg , S, E);
219218 }
220219
221- static std::unique_ptr<MSP430Operand> CreatePostIndReg (unsigned RegNum, SMLoc S ,
222- SMLoc E) {
223- return std::make_unique<MSP430Operand>(k_PostIndReg, RegNum , S, E);
220+ static std::unique_ptr<MSP430Operand> CreatePostIndReg (MCRegister Reg ,
221+ SMLoc S, SMLoc E) {
222+ return std::make_unique<MSP430Operand>(k_PostIndReg, Reg , S, E);
224223 }
225224
226225 SMLoc getStartLoc () const override { return Start; }
@@ -545,8 +544,8 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeMSP430AsmParser() {
545544#define GET_MATCHER_IMPLEMENTATION
546545#include " MSP430GenAsmMatcher.inc"
547546
548- static unsigned convertGR16ToGR8 (unsigned Reg) {
549- switch (Reg) {
547+ static MCRegister convertGR16ToGR8 (MCRegister Reg) {
548+ switch (Reg. id () ) {
550549 default :
551550 llvm_unreachable (" Unknown GR16 register" );
552551 case MSP430::PC: return MSP430::PCB;
@@ -575,7 +574,7 @@ unsigned MSP430AsmParser::validateTargetOperandClass(MCParsedAsmOperand &AsmOp,
575574 if (!Op.isReg ())
576575 return Match_InvalidOperand;
577576
578- unsigned Reg = Op.getReg ();
577+ MCRegister Reg = Op.getReg ();
579578 bool isGR16 =
580579 MSP430MCRegisterClasses[MSP430::GR16RegClassID].contains (Reg);
581580
0 commit comments