@@ -2965,9 +2965,9 @@ bool MipsAsmParser::loadAndAddSymbolAddress(const MCExpr *SymExpr,
2965
2965
Res.getConstant () == 0 && !IsLocalSym) {
2966
2966
if (UseXGOT) {
2967
2967
const MCExpr *CallHiExpr =
2968
- MipsMCExpr ::create (Mips::S_CALL_HI16, SymExpr , getContext ());
2968
+ MCSpecifierExpr ::create (SymExpr, Mips::S_CALL_HI16, getContext ());
2969
2969
const MCExpr *CallLoExpr =
2970
- MipsMCExpr ::create (Mips::S_CALL_LO16, SymExpr , getContext ());
2970
+ MCSpecifierExpr ::create (SymExpr, Mips::S_CALL_LO16, getContext ());
2971
2971
TOut.emitRX (Mips::LUi, DstReg, MCOperand::createExpr (CallHiExpr), IDLoc,
2972
2972
STI);
2973
2973
TOut.emitRRR (IsPtr64 ? Mips::DADDu : Mips::ADDu, DstReg, DstReg, GPReg,
@@ -2976,7 +2976,7 @@ bool MipsAsmParser::loadAndAddSymbolAddress(const MCExpr *SymExpr,
2976
2976
MCOperand::createExpr (CallLoExpr), IDLoc, STI);
2977
2977
} else {
2978
2978
const MCExpr *CallExpr =
2979
- MipsMCExpr ::create (Mips::S_GOT_CALL, SymExpr , getContext ());
2979
+ MCSpecifierExpr ::create (SymExpr, Mips::S_GOT_CALL, getContext ());
2980
2980
TOut.emitRRX (IsPtr64 ? Mips::LD : Mips::LW, DstReg, GPReg,
2981
2981
MCOperand::createExpr (CallExpr), IDLoc, STI);
2982
2982
}
@@ -3009,9 +3009,9 @@ bool MipsAsmParser::loadAndAddSymbolAddress(const MCExpr *SymExpr,
3009
3009
// this happens then the last instruction must use $rd as the result
3010
3010
// register.
3011
3011
const MCExpr *CallHiExpr =
3012
- MipsMCExpr ::create (Mips::S_GOT_HI16, SymExpr , getContext ());
3013
- const MCExpr *CallLoExpr =
3014
- MipsMCExpr::create ( Res.getAddSym (), Mips::S_GOT_LO16, getContext ());
3012
+ MCSpecifierExpr ::create (SymExpr, Mips::S_GOT_HI16, getContext ());
3013
+ const MCExpr *CallLoExpr = MCSpecifierExpr::create (
3014
+ Res.getAddSym (), Mips::S_GOT_LO16, getContext ());
3015
3015
3016
3016
TOut.emitRX (Mips::LUi, TmpReg, MCOperand::createExpr (CallHiExpr), IDLoc,
3017
3017
STI);
@@ -3042,8 +3042,8 @@ bool MipsAsmParser::loadAndAddSymbolAddress(const MCExpr *SymExpr,
3042
3042
// The daddiu's marked with a '>' may be omitted if they are redundant. If
3043
3043
// this happens then the last instruction must use $rd as the result
3044
3044
// register.
3045
- GotExpr =
3046
- MipsMCExpr::create (Res. getAddSym (), Mips::S_GOT_DISP, getContext ());
3045
+ GotExpr = MCSpecifierExpr::create (Res. getAddSym (), Mips::S_GOT_DISP,
3046
+ getContext ());
3047
3047
if (Res.getConstant () != 0 ) {
3048
3048
// Symbols fully resolve with just the %got_disp(symbol) but we
3049
3049
// must still account for any offset to the symbol for
@@ -3070,14 +3070,14 @@ bool MipsAsmParser::loadAndAddSymbolAddress(const MCExpr *SymExpr,
3070
3070
// this happens then the last instruction must use $rd as the result
3071
3071
// register.
3072
3072
if (IsLocalSym) {
3073
- GotExpr = MipsMCExpr ::create (Mips::S_GOT, SymExpr , getContext ());
3074
- LoExpr = MipsMCExpr ::create (Mips::S_LO, SymExpr , getContext ());
3073
+ GotExpr = MCSpecifierExpr ::create (SymExpr, Mips::S_GOT, getContext ());
3074
+ LoExpr = MCSpecifierExpr ::create (SymExpr, Mips::S_LO, getContext ());
3075
3075
} else {
3076
3076
// External symbols fully resolve the symbol with just the %got(symbol)
3077
3077
// but we must still account for any offset to the symbol for
3078
3078
// expressions like symbol+8.
3079
3079
GotExpr =
3080
- MipsMCExpr ::create (Res.getAddSym (), Mips::S_GOT, getContext ());
3080
+ MCSpecifierExpr ::create (Res.getAddSym (), Mips::S_GOT, getContext ());
3081
3081
if (Res.getConstant () != 0 )
3082
3082
LoExpr = MCConstantExpr::create (Res.getConstant (), getContext ());
3083
3083
}
@@ -3097,8 +3097,10 @@ bool MipsAsmParser::loadAndAddSymbolAddress(const MCExpr *SymExpr,
3097
3097
return false ;
3098
3098
}
3099
3099
3100
- const auto *HiExpr = MipsMCExpr::create (Mips::S_HI, SymExpr, getContext ());
3101
- const auto *LoExpr = MipsMCExpr::create (Mips::S_LO, SymExpr, getContext ());
3100
+ const auto *HiExpr =
3101
+ MCSpecifierExpr::create (SymExpr, Mips::S_HI, getContext ());
3102
+ const auto *LoExpr =
3103
+ MCSpecifierExpr::create (SymExpr, Mips::S_LO, getContext ());
3102
3104
3103
3105
// This is the 64-bit symbol address expansion.
3104
3106
if (ABI.ArePtrs64bit () && isGP64bit ()) {
@@ -3110,9 +3112,9 @@ bool MipsAsmParser::loadAndAddSymbolAddress(const MCExpr *SymExpr,
3110
3112
// source register.
3111
3113
3112
3114
const auto *HighestExpr =
3113
- MipsMCExpr ::create (Mips::S_HIGHEST, SymExpr , getContext ());
3115
+ MCSpecifierExpr ::create (SymExpr, Mips::S_HIGHEST, getContext ());
3114
3116
const auto *HigherExpr =
3115
- MipsMCExpr ::create (Mips::S_HIGHER, SymExpr , getContext ());
3117
+ MCSpecifierExpr ::create (SymExpr, Mips::S_HIGHER, getContext ());
3116
3118
3117
3119
bool RdRegIsRsReg =
3118
3120
UseSrcReg &&
@@ -3310,7 +3312,8 @@ bool MipsAsmParser::emitPartialAddress(MipsTargetStreamer &TOut, SMLoc IDLoc,
3310
3312
3311
3313
if (IsPicEnabled) {
3312
3314
const MCExpr *GotSym = MCSymbolRefExpr::create (Sym, getContext ());
3313
- const auto *GotExpr = MipsMCExpr::create (Mips::S_GOT, GotSym, getContext ());
3315
+ const auto *GotExpr =
3316
+ MCSpecifierExpr::create (GotSym, Mips::S_GOT, getContext ());
3314
3317
3315
3318
if (isABI_O32 () || isABI_N32 ()) {
3316
3319
TOut.emitRRX (Mips::LW, ATReg, GPReg, MCOperand::createExpr (GotExpr),
@@ -3321,7 +3324,8 @@ bool MipsAsmParser::emitPartialAddress(MipsTargetStreamer &TOut, SMLoc IDLoc,
3321
3324
}
3322
3325
} else { // !IsPicEnabled
3323
3326
const MCExpr *HiSym = MCSymbolRefExpr::create (Sym, getContext ());
3324
- const auto *HiExpr = MipsMCExpr::create (Mips::S_HI, HiSym, getContext ());
3327
+ const auto *HiExpr =
3328
+ MCSpecifierExpr::create (HiSym, Mips::S_HI, getContext ());
3325
3329
3326
3330
// FIXME: This is technically correct but gives a different result to gas,
3327
3331
// but gas is incomplete there (it has a fixme noting it doesn't work with
@@ -3334,10 +3338,10 @@ bool MipsAsmParser::emitPartialAddress(MipsTargetStreamer &TOut, SMLoc IDLoc,
3334
3338
} else { // isABI_N64()
3335
3339
const MCExpr *HighestSym = MCSymbolRefExpr::create (Sym, getContext ());
3336
3340
const auto *HighestExpr =
3337
- MipsMCExpr ::create (Mips::S_HIGHEST, HighestSym , getContext ());
3341
+ MCSpecifierExpr ::create (HighestSym, Mips::S_HIGHEST, getContext ());
3338
3342
const MCExpr *HigherSym = MCSymbolRefExpr::create (Sym, getContext ());
3339
3343
const auto *HigherExpr =
3340
- MipsMCExpr ::create (Mips::S_HIGHER, HigherSym , getContext ());
3344
+ MCSpecifierExpr ::create (HigherSym, Mips::S_HIGHER, getContext ());
3341
3345
3342
3346
TOut.emitRX (Mips::LUi, ATReg, MCOperand::createExpr (HighestExpr), IDLoc,
3343
3347
STI);
@@ -3424,7 +3428,7 @@ bool MipsAsmParser::expandLoadSingleImmToFPR(MCInst &Inst, SMLoc IDLoc,
3424
3428
3425
3429
MCSymbol *Sym = getContext ().createTempSymbol ();
3426
3430
const MCExpr *LoSym = MCSymbolRefExpr::create (Sym, getContext ());
3427
- const auto *LoExpr = MipsMCExpr ::create (Mips::S_LO, LoSym , getContext ());
3431
+ const auto *LoExpr = MCSpecifierExpr ::create (LoSym, Mips::S_LO, getContext ());
3428
3432
3429
3433
getStreamer ().switchSection (ReadOnlySection);
3430
3434
getStreamer ().emitLabel (Sym, IDLoc);
@@ -3474,7 +3478,7 @@ bool MipsAsmParser::expandLoadDoubleImmToGPR(MCInst &Inst, SMLoc IDLoc,
3474
3478
3475
3479
MCSymbol *Sym = getContext ().createTempSymbol ();
3476
3480
const MCExpr *LoSym = MCSymbolRefExpr::create (Sym, getContext ());
3477
- const auto *LoExpr = MipsMCExpr ::create (Mips::S_LO, LoSym , getContext ());
3481
+ const auto *LoExpr = MCSpecifierExpr ::create (LoSym, Mips::S_LO, getContext ());
3478
3482
3479
3483
getStreamer ().switchSection (ReadOnlySection);
3480
3484
getStreamer ().emitLabel (Sym, IDLoc);
@@ -3554,7 +3558,7 @@ bool MipsAsmParser::expandLoadDoubleImmToFPR(MCInst &Inst, bool Is64FPU,
3554
3558
3555
3559
MCSymbol *Sym = getContext ().createTempSymbol ();
3556
3560
const MCExpr *LoSym = MCSymbolRefExpr::create (Sym, getContext ());
3557
- const auto *LoExpr = MipsMCExpr ::create (Mips::S_LO, LoSym , getContext ());
3561
+ const auto *LoExpr = MCSpecifierExpr ::create (LoSym, Mips::S_LO, getContext ());
3558
3562
3559
3563
getStreamer ().switchSection (ReadOnlySection);
3560
3564
getStreamer ().emitLabel (Sym, IDLoc);
@@ -3777,15 +3781,15 @@ void MipsAsmParser::expandMem16Inst(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
3777
3781
// sw $8, %lo(sym)($at)
3778
3782
const MCExpr *OffExpr = OffsetOp.getExpr ();
3779
3783
MCOperand LoOperand = MCOperand::createExpr (
3780
- MipsMCExpr ::create (Mips::S_LO, OffExpr , getContext ()));
3784
+ MCSpecifierExpr ::create (OffExpr, Mips::S_LO, getContext ()));
3781
3785
MCOperand HiOperand = MCOperand::createExpr (
3782
- MipsMCExpr ::create (Mips::S_HI, OffExpr , getContext ()));
3786
+ MCSpecifierExpr ::create (OffExpr, Mips::S_HI, getContext ()));
3783
3787
3784
3788
if (ABI.IsN64 ()) {
3785
3789
MCOperand HighestOperand = MCOperand::createExpr (
3786
- MipsMCExpr ::create (Mips::S_HIGHEST, OffExpr , getContext ()));
3790
+ MCSpecifierExpr ::create (OffExpr, Mips::S_HIGHEST, getContext ()));
3787
3791
MCOperand HigherOperand = MCOperand::createExpr (
3788
- MipsMCExpr ::create (Mips::S_HIGHER, OffExpr , getContext ()));
3792
+ MCSpecifierExpr ::create (OffExpr, Mips::S_HIGHER, getContext ()));
3789
3793
3790
3794
TOut.emitRX (Mips::LUi, TmpReg, HighestOperand, IDLoc, STI);
3791
3795
TOut.emitRRX (Mips::DADDiu, TmpReg, TmpReg, HigherOperand, IDLoc, STI);
@@ -6394,7 +6398,7 @@ const MCExpr *MipsAsmParser::parseRelocExpr() {
6394
6398
while (Ops.size ()) {
6395
6399
if (Parser.parseToken (AsmToken::RParen, " expected ')'" ))
6396
6400
return nullptr ;
6397
- Res = MipsMCExpr ::create (Ops.pop_back_val (), Res , getContext ());
6401
+ Res = MCSpecifierExpr ::create (Res, Ops.pop_back_val (), getContext ());
6398
6402
}
6399
6403
return Res;
6400
6404
}
0 commit comments