diff options
| author | Fangrui Song <i@maskray.me> | 2025-03-05 22:10:07 -0800 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2025-03-05 22:10:08 -0800 |
| commit | 75f6fe2ee5eb3e966cd4c335abd018921d6337d3 (patch) | |
| tree | 79489923bf6ba2fe8e353d9d06cc08f5d491dc80 /llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | |
| parent | a6ccda28f7569c1a03620d7520de7cfadc11f4a5 (diff) | |
[MC] Remove unneeded MCSymbolRefExpr::create overload and add comments
The StringRef overload is often error-prone as users might forget to
register the MCSymbol.
Add comments to MCTargetExpr and MCSymbolRefExpr::VariantKind.
In the distant future the VariantKind parameter might be removed.
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp')
| -rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index a2ca90c35bad..6ed77d45b8a7 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -1269,9 +1269,7 @@ void MipsTargetELFStreamer::emitDirectiveCpLoad(unsigned RegNo) { TmpInst.setOpcode(Mips::LUi); TmpInst.addOperand(MCOperand::createReg(GPReg)); const MCExpr *HiSym = MipsMCExpr::create( - MipsMCExpr::MEK_HI, - MCSymbolRefExpr::create("_gp_disp", MCSymbolRefExpr::VK_None, - MCA.getContext()), + MipsMCExpr::MEK_HI, MCSymbolRefExpr::create(GP_Disp, MCA.getContext()), MCA.getContext()); TmpInst.addOperand(MCOperand::createExpr(HiSym)); getStreamer().emitInstruction(TmpInst, STI); @@ -1282,9 +1280,7 @@ void MipsTargetELFStreamer::emitDirectiveCpLoad(unsigned RegNo) { TmpInst.addOperand(MCOperand::createReg(GPReg)); TmpInst.addOperand(MCOperand::createReg(GPReg)); const MCExpr *LoSym = MipsMCExpr::create( - MipsMCExpr::MEK_LO, - MCSymbolRefExpr::create("_gp_disp", MCSymbolRefExpr::VK_None, - MCA.getContext()), + MipsMCExpr::MEK_LO, MCSymbolRefExpr::create(GP_Disp, MCA.getContext()), MCA.getContext()); TmpInst.addOperand(MCOperand::createExpr(LoSym)); getStreamer().emitInstruction(TmpInst, STI); |
