@@ -137,7 +137,7 @@ class RISCVAsmParser : public MCTargetAsmParser {
137
137
// Helper to emit a combination of AUIPC and SecondOpcode. Used to implement
138
138
// helpers such as emitLoadLocalAddress and emitLoadAddress.
139
139
void emitAuipcInstPair (MCRegister DestReg, MCRegister TmpReg,
140
- const MCExpr *Symbol, RISCVMCExpr ::Specifier VKHi,
140
+ const MCExpr *Symbol, RISCV ::Specifier VKHi,
141
141
unsigned SecondOpcode, SMLoc IDLoc, MCStreamer &Out);
142
142
143
143
// Helper to emit pseudo instruction "lla" used in PC-rel addressing.
@@ -295,8 +295,7 @@ class RISCVAsmParser : public MCTargetAsmParser {
295
295
#undef GET_OPERAND_DIAGNOSTIC_TYPES
296
296
};
297
297
298
- static bool classifySymbolRef (const MCExpr *Expr,
299
- RISCVMCExpr::Specifier &Kind);
298
+ static bool classifySymbolRef (const MCExpr *Expr, RISCV::Specifier &Kind);
300
299
static bool isSymbolDiff (const MCExpr *Expr);
301
300
302
301
RISCVAsmParser (const MCSubtargetInfo &STI, MCAsmParser &Parser,
@@ -544,7 +543,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
544
543
if (evaluateConstantImm (getImm (), Imm))
545
544
return isShiftedInt<N - 1 , 1 >(fixImmediateForRV32 (Imm, isRV64Imm ()));
546
545
547
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
546
+ RISCV ::Specifier VK = RISCV::S_None;
548
547
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
549
548
VK == RISCV::S_None;
550
549
}
@@ -559,7 +558,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
559
558
if (evaluateConstantImm (getImm (), Imm))
560
559
return isInt<N>(fixImmediateForRV32 (Imm, isRV64Imm ()));
561
560
562
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
561
+ RISCV ::Specifier VK = RISCV::S_None;
563
562
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
564
563
VK == RISCV::S_None;
565
564
}
@@ -572,7 +571,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
572
571
if (!isImm () || evaluateConstantImm (getImm (), Imm))
573
572
return false ;
574
573
575
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
574
+ RISCV ::Specifier VK = RISCV::S_None;
576
575
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
577
576
VK == RISCV::S_None;
578
577
}
@@ -583,7 +582,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
583
582
if (!isImm () || evaluateConstantImm (getImm (), Imm))
584
583
return false ;
585
584
586
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
585
+ RISCV ::Specifier VK = RISCV::S_None;
587
586
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
588
587
VK == ELF::R_RISCV_CALL_PLT;
589
588
}
@@ -594,7 +593,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
594
593
if (!isImm () || evaluateConstantImm (getImm (), Imm))
595
594
return false ;
596
595
597
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
596
+ RISCV ::Specifier VK = RISCV::S_None;
598
597
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
599
598
VK == ELF::R_RISCV_CALL_PLT;
600
599
}
@@ -605,7 +604,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
605
604
if (!isImm () || evaluateConstantImm (getImm (), Imm))
606
605
return false ;
607
606
608
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
607
+ RISCV ::Specifier VK = RISCV::S_None;
609
608
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
610
609
VK == ELF::R_RISCV_TPREL_ADD;
611
610
}
@@ -616,7 +615,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
616
615
if (!isImm () || evaluateConstantImm (getImm (), Imm))
617
616
return false ;
618
617
619
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
618
+ RISCV ::Specifier VK = RISCV::S_None;
620
619
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
621
620
VK == ELF::R_RISCV_TLSDESC_CALL;
622
621
}
@@ -870,7 +869,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
870
869
if (evaluateConstantImm (getImm (), Imm))
871
870
return isInt<12 >(fixImmediateForRV32 (Imm, isRV64Imm ()));
872
871
873
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
872
+ RISCV ::Specifier VK = RISCV::S_None;
874
873
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
875
874
(VK == RISCV::S_LO || VK == RISCV::S_PCREL_LO ||
876
875
VK == RISCV::S_TPREL_LO || VK == ELF::R_RISCV_TLSDESC_LOAD_LO12 ||
@@ -902,7 +901,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
902
901
if (evaluateConstantImm (getImm (), Imm))
903
902
return isInt<20 >(fixImmediateForRV32 (Imm, isRV64Imm ()));
904
903
905
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
904
+ RISCV ::Specifier VK = RISCV::S_None;
906
905
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
907
906
VK == RISCV::S_QC_ABS20;
908
907
}
@@ -915,7 +914,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
915
914
if (evaluateConstantImm (getImm (), Imm))
916
915
return isUInt<20 >(Imm);
917
916
918
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
917
+ RISCV ::Specifier VK = RISCV::S_None;
919
918
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
920
919
(VK == ELF::R_RISCV_HI20 || VK == ELF::R_RISCV_TPREL_HI20);
921
920
}
@@ -928,7 +927,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
928
927
if (evaluateConstantImm (getImm (), Imm))
929
928
return isUInt<20 >(Imm);
930
929
931
- RISCVMCExpr ::Specifier VK = RISCV::S_None;
930
+ RISCV ::Specifier VK = RISCV::S_None;
932
931
return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
933
932
(VK == ELF::R_RISCV_PCREL_HI20 || VK == ELF::R_RISCV_GOT_HI20 ||
934
933
VK == ELF::R_RISCV_TLS_GOT_HI20 || VK == ELF::R_RISCV_TLS_GD_HI20 ||
@@ -2099,7 +2098,7 @@ bool RISCVAsmParser::parseExprWithSpecifier(const MCExpr *&Res, SMLoc &E) {
2099
2098
if (getParser ().parseParenExpression (SubExpr, E))
2100
2099
return true ;
2101
2100
2102
- Res = RISCVMCExpr ::create (SubExpr, Spec, getContext ());
2101
+ Res = MCSpecifierExpr ::create (SubExpr, Spec, getContext ());
2103
2102
return false ;
2104
2103
}
2105
2104
@@ -2183,11 +2182,11 @@ ParseStatus RISCVAsmParser::parseCallSymbol(OperandVector &Operands) {
2183
2182
}
2184
2183
2185
2184
SMLoc E = SMLoc::getFromPointer (S.getPointer () + Identifier.size ());
2186
- RISCVMCExpr ::Specifier Kind = ELF::R_RISCV_CALL_PLT;
2185
+ RISCV ::Specifier Kind = ELF::R_RISCV_CALL_PLT;
2187
2186
2188
2187
MCSymbol *Sym = getContext ().getOrCreateSymbol (Identifier);
2189
2188
Res = MCSymbolRefExpr::create (Sym, getContext ());
2190
- Res = RISCVMCExpr ::create (Res, Kind, getContext ());
2189
+ Res = MCSpecifierExpr ::create (Res, Kind, getContext ());
2191
2190
Operands.push_back (RISCVOperand::createImm (Res, S, E, isRV64 ()));
2192
2191
return ParseStatus::Success;
2193
2192
}
@@ -2203,7 +2202,7 @@ ParseStatus RISCVAsmParser::parsePseudoJumpSymbol(OperandVector &Operands) {
2203
2202
if (Res->getKind () != MCExpr::ExprKind::SymbolRef)
2204
2203
return Error (S, " operand must be a valid jump target" );
2205
2204
2206
- Res = RISCVMCExpr ::create (Res, ELF::R_RISCV_CALL_PLT, getContext ());
2205
+ Res = MCSpecifierExpr ::create (Res, ELF::R_RISCV_CALL_PLT, getContext ());
2207
2206
Operands.push_back (RISCVOperand::createImm (Res, S, E, isRV64 ()));
2208
2207
return ParseStatus::Success;
2209
2208
}
@@ -2918,10 +2917,9 @@ bool RISCVAsmParser::parseInstruction(ParseInstructionInfo &Info,
2918
2917
}
2919
2918
2920
2919
bool RISCVAsmParser::classifySymbolRef (const MCExpr *Expr,
2921
- RISCVMCExpr ::Specifier &Kind) {
2920
+ RISCV ::Specifier &Kind) {
2922
2921
Kind = RISCV::S_None;
2923
-
2924
- if (const RISCVMCExpr *RE = dyn_cast<RISCVMCExpr>(Expr)) {
2922
+ if (const auto *RE = dyn_cast<MCSpecifierExpr>(Expr)) {
2925
2923
Kind = RE->getSpecifier ();
2926
2924
Expr = RE->getSubExpr ();
2927
2925
}
@@ -3434,7 +3432,7 @@ void RISCVAsmParser::emitLoadImm(MCRegister DestReg, int64_t Value,
3434
3432
3435
3433
void RISCVAsmParser::emitAuipcInstPair (MCRegister DestReg, MCRegister TmpReg,
3436
3434
const MCExpr *Symbol,
3437
- RISCVMCExpr ::Specifier VKHi,
3435
+ RISCV ::Specifier VKHi,
3438
3436
unsigned SecondOpcode, SMLoc IDLoc,
3439
3437
MCStreamer &Out) {
3440
3438
// A pair of instructions for PC-relative addressing; expands to
@@ -3445,11 +3443,11 @@ void RISCVAsmParser::emitAuipcInstPair(MCRegister DestReg, MCRegister TmpReg,
3445
3443
MCSymbol *TmpLabel = Ctx.createNamedTempSymbol (" pcrel_hi" );
3446
3444
Out.emitLabel (TmpLabel);
3447
3445
3448
- const RISCVMCExpr *SymbolHi = RISCVMCExpr ::create (Symbol, VKHi, Ctx);
3446
+ const auto *SymbolHi = MCSpecifierExpr ::create (Symbol, VKHi, Ctx);
3449
3447
emitToStreamer (Out,
3450
3448
MCInstBuilder (RISCV::AUIPC).addReg (TmpReg).addExpr (SymbolHi));
3451
3449
3452
- const MCExpr *RefToLinkTmpLabel = RISCVMCExpr ::create (
3450
+ const MCExpr *RefToLinkTmpLabel = MCSpecifierExpr ::create (
3453
3451
MCSymbolRefExpr::create (TmpLabel, Ctx), RISCV::S_PCREL_LO, Ctx);
3454
3452
3455
3453
emitToStreamer (Out, MCInstBuilder (SecondOpcode)
0 commit comments