Skip to content

Commit fe56c4c

Browse files
committed
[MC] Remove unneeded VK_None argument from MCSymbolRefExpr::create. NFC
1 parent 7e5821b commit fe56c4c

28 files changed

+57
-102
lines changed

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,10 +1581,8 @@ const MCExpr *TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(
15811581
StubSym = MachineModuleInfoImpl::StubValueTy(const_cast<MCSymbol *>(Sym),
15821582
!GV->hasLocalLinkage());
15831583

1584-
const MCExpr *BSymExpr =
1585-
MCSymbolRefExpr::create(BaseSym, MCSymbolRefExpr::VK_None, Ctx);
1586-
const MCExpr *LHS =
1587-
MCSymbolRefExpr::create(Stub, MCSymbolRefExpr::VK_None, Ctx);
1584+
const MCExpr *BSymExpr = MCSymbolRefExpr::create(BaseSym, Ctx);
1585+
const MCExpr *LHS = MCSymbolRefExpr::create(Stub, Ctx);
15881586

15891587
if (!Offset)
15901588
return MCBinaryExpr::createSub(LHS, BSymExpr, Ctx);
@@ -2306,8 +2304,7 @@ const MCExpr *TargetLoweringObjectFileWasm::lowerRelativeReference(
23062304
return nullptr;
23072305

23082306
return MCBinaryExpr::createSub(
2309-
MCSymbolRefExpr::create(TM.getSymbol(LHS), MCSymbolRefExpr::VK_None,
2310-
getContext()),
2307+
MCSymbolRefExpr::create(TM.getSymbol(LHS), getContext()),
23112308
MCSymbolRefExpr::create(TM.getSymbol(RHS), getContext()), getContext());
23122309
}
23132310

llvm/lib/MC/MCELFStreamer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,7 @@ void MCELFStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE,
448448
}
449449
S = S->getSection().getBeginSymbol();
450450
S->setUsedInReloc();
451-
SRE = MCSymbolRefExpr::create(S, MCSymbolRefExpr::VK_None, getContext(),
452-
SRE->getLoc());
451+
SRE = MCSymbolRefExpr::create(S, getContext(), SRE->getLoc());
453452
}
454453
const MCConstantExpr *MCOffset = MCConstantExpr::create(Offset, getContext());
455454
if (std::optional<std::pair<bool, std::string>> Err =

llvm/lib/MC/MCParser/AsmParser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,8 +1187,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc,
11871187
// Emit a temporary label to the streamer and refer to it.
11881188
MCSymbol *Sym = Ctx.createTempSymbol();
11891189
Out.emitLabel(Sym);
1190-
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None,
1191-
getContext());
1190+
Res = MCSymbolRefExpr::create(Sym, getContext());
11921191
EndLoc = FirstTokenLoc;
11931192
return false;
11941193
}
@@ -1315,7 +1314,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc,
13151314
// temporary label to the streamer and refer to it.
13161315
MCSymbol *Sym = Ctx.createTempSymbol();
13171316
Out.emitLabel(Sym);
1318-
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
1317+
Res = MCSymbolRefExpr::create(Sym, getContext());
13191318
EndLoc = Lexer.getTok().getEndLoc();
13201319
Lex(); // Eat identifier.
13211320
return false;

llvm/lib/MC/MCParser/MCAsmParserExtension.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ bool MCAsmParserExtension::parseDirectiveCGProfile(StringRef, SMLoc) {
5454
MCSymbol *ToSym = getContext().getOrCreateSymbol(To);
5555

5656
getStreamer().emitCGProfileEntry(
57-
MCSymbolRefExpr::create(FromSym, MCSymbolRefExpr::VK_None, getContext(),
58-
FromLoc),
59-
MCSymbolRefExpr::create(ToSym, MCSymbolRefExpr::VK_None, getContext(),
60-
ToLoc),
61-
Count);
57+
MCSymbolRefExpr::create(FromSym, getContext(), FromLoc),
58+
MCSymbolRefExpr::create(ToSym, getContext(), ToLoc), Count);
6259
return false;
6360
}

llvm/lib/MC/MCParser/MasmParser.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,8 +1404,7 @@ bool MasmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc,
14041404
// temporary label to the streamer and refer to it.
14051405
MCSymbol *Sym = Ctx.createTempSymbol();
14061406
Out.emitLabel(Sym);
1407-
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None,
1408-
getContext());
1407+
Res = MCSymbolRefExpr::create(Sym, getContext());
14091408
EndLoc = FirstTokenLoc;
14101409
return false;
14111410
}
@@ -1491,8 +1490,8 @@ bool MasmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc,
14911490
}
14921491

14931492
// Otherwise create a symbol ref.
1494-
const MCExpr *SymRef = MCSymbolRefExpr::create(
1495-
Sym, MCSymbolRefExpr::VK_None, getContext(), FirstTokenLoc);
1493+
const MCExpr *SymRef =
1494+
MCSymbolRefExpr::create(Sym, getContext(), FirstTokenLoc);
14961495
if (Info.Offset) {
14971496
Res = MCBinaryExpr::create(
14981497
MCBinaryExpr::Add, SymRef,
@@ -1548,7 +1547,7 @@ bool MasmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc,
15481547
// temporary label to the streamer and refer to it.
15491548
MCSymbol *Sym = Ctx.createTempSymbol();
15501549
Out.emitLabel(Sym);
1551-
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
1550+
Res = MCSymbolRefExpr::create(Sym, getContext());
15521551
EndLoc = Lexer.getTok().getEndLoc();
15531552
Lex(); // Eat identifier.
15541553
return false;

llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,8 +1362,7 @@ void AArch64AsmPrinter::emitFunctionEntryLabel() {
13621362
auto emitFunctionAlias = [&](MCSymbol *Src, MCSymbol *Dst) {
13631363
OutStreamer->emitSymbolAttribute(Src, MCSA_WeakAntiDep);
13641364
OutStreamer->emitAssignment(
1365-
Src, MCSymbolRefExpr::create(Dst, MCSymbolRefExpr::VK_None,
1366-
MMI->getContext()));
1365+
Src, MCSymbolRefExpr::create(Dst, MMI->getContext()));
13671366
};
13681367

13691368
auto getSymbolFromMetadata = [&](StringRef Name) {
@@ -1436,8 +1435,7 @@ void AArch64AsmPrinter::emitGlobalAlias(const Module &M,
14361435
OutStreamer->endCOFFSymbolDef();
14371436
OutStreamer->emitSymbolAttribute(Sym, MCSA_Weak);
14381437
OutStreamer->emitAssignment(
1439-
Sym, MCSymbolRefExpr::create(ExpSym, MCSymbolRefExpr::VK_None,
1440-
MMI->getContext()));
1438+
Sym, MCSymbolRefExpr::create(ExpSym, MMI->getContext()));
14411439
return;
14421440
}
14431441
}

llvm/lib/Target/AArch64/AArch64MCInstLower.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ MCOperand AArch64MCInstLower::lowerSymbolOperandELF(const MachineOperand &MO,
261261
if (MO.getTargetFlags() & AArch64II::MO_NC)
262262
RefFlags |= AArch64MCExpr::VK_NC;
263263

264-
const MCExpr *Expr =
265-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, Ctx);
264+
const MCExpr *Expr = MCSymbolRefExpr::create(Sym, Ctx);
266265
if (!MO.isJTI() && MO.getOffset())
267266
Expr = MCBinaryExpr::createAdd(
268267
Expr, MCConstantExpr::create(MO.getOffset(), Ctx), Ctx);
@@ -316,8 +315,7 @@ MCOperand AArch64MCInstLower::lowerSymbolOperandCOFF(const MachineOperand &MO,
316315
RefFlags |= AArch64MCExpr::VK_NC;
317316
}
318317

319-
const MCExpr *Expr =
320-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, Ctx);
318+
const MCExpr *Expr = MCSymbolRefExpr::create(Sym, Ctx);
321319
if (!MO.isJTI() && MO.getOffset())
322320
Expr = MCBinaryExpr::createAdd(
323321
Expr, MCConstantExpr::create(MO.getOffset(), Ctx), Ctx);

llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ void AArch64TargetELFStreamer::finish() {
537537
const auto &Sym = cast<MCSymbolELF>(Symbol);
538538
if (!Sym.isMemtag())
539539
continue;
540-
auto *SRE = MCSymbolRefExpr::create(&Sym, MCSymbolRefExpr::VK_None, Ctx);
540+
auto *SRE = MCSymbolRefExpr::create(&Sym, Ctx);
541541
(void)S.emitRelocDirective(*Zero, "BFD_RELOC_NONE", SRE, SMLoc(),
542542
*Ctx.getSubtargetInfo());
543543
}

llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ ParseStatus CSKYAsmParser::parseCSKYSymbol(OperandVector &Operands) {
12051205
}
12061206
Res = V;
12071207
} else
1208-
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
1208+
Res = MCSymbolRefExpr::create(Sym, getContext());
12091209

12101210
MCBinaryExpr::Opcode Opcode;
12111211
switch (getLexer().getKind()) {
@@ -1277,7 +1277,7 @@ ParseStatus CSKYAsmParser::parseDataSymbol(OperandVector &Operands) {
12771277
}
12781278
Res = V;
12791279
} else {
1280-
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
1280+
Res = MCSymbolRefExpr::create(Sym, getContext());
12811281
}
12821282

12831283
MCBinaryExpr::Opcode Opcode;
@@ -1352,7 +1352,7 @@ ParseStatus CSKYAsmParser::parseConstpoolSymbol(OperandVector &Operands) {
13521352
}
13531353
Res = V;
13541354
} else {
1355-
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
1355+
Res = MCSymbolRefExpr::create(Sym, getContext());
13561356
}
13571357

13581358
MCBinaryExpr::Opcode Opcode;

llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ void CSKYAsmPrinter::emitMachineConstantPoolValue(
219219
MCSym = GetExternalSymbolSymbol(Sym);
220220
}
221221
// Create an MCSymbol for the reference.
222-
const MCExpr *Expr =
223-
MCSymbolRefExpr::create(MCSym, MCSymbolRefExpr::VK_None, OutContext);
222+
const MCExpr *Expr = MCSymbolRefExpr::create(MCSym, OutContext);
224223

225224
if (CCPV->getPCAdjustment()) {
226225

llvm/lib/Target/CSKY/CSKYMCInstLower.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ MCOperand CSKYMCInstLower::lowerSymbolOperand(const MachineOperand &MO,
6464
Kind = CSKYMCExpr::VK_CSKY_ADDR_LO16;
6565
break;
6666
}
67-
const MCExpr *ME =
68-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, Ctx);
67+
const MCExpr *ME = MCSymbolRefExpr::create(Sym, Ctx);
6968

7069
if (Kind != CSKYMCExpr::VK_CSKY_None)
7170
ME = CSKYMCExpr::create(ME, Kind, Ctx);

llvm/lib/Target/Lanai/LanaiMCInstLower.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ MCOperand LanaiMCInstLower::LowerSymbolOperand(const MachineOperand &MO,
8080
llvm_unreachable("Unknown target flag on GV operand");
8181
}
8282

83-
const MCExpr *Expr =
84-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, Ctx);
83+
const MCExpr *Expr = MCSymbolRefExpr::create(Sym, Ctx);
8584
if (!MO.isJTI() && MO.getOffset())
8685
Expr = MCBinaryExpr::createAdd(
8786
Expr, MCConstantExpr::create(MO.getOffset(), Ctx), Ctx);

llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ ParseStatus LoongArchAsmParser::parseSImm26Operand(OperandVector &Operands) {
810810
SMLoc E = SMLoc::getFromPointer(S.getPointer() + Identifier.size());
811811

812812
MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);
813-
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
813+
Res = MCSymbolRefExpr::create(Sym, getContext());
814814
Res = LoongArchMCExpr::create(Res, LoongArchMCExpr::VK_LoongArch_CALL,
815815
getContext());
816816
Operands.push_back(LoongArchOperand::createImm(Res, S, E));

llvm/lib/Target/LoongArch/LoongArchMCInstLower.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ static MCOperand lowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym,
126126
// TODO: Handle more target-flags.
127127
}
128128

129-
const MCExpr *ME =
130-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, Ctx);
129+
const MCExpr *ME = MCSymbolRefExpr::create(Sym, Ctx);
131130

132131
if (!MO.isJTI() && !MO.isMBB() && MO.getOffset())
133132
ME = MCBinaryExpr::createAdd(

llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,8 +2095,7 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
20952095
MCSymbol *TmpLabel = getContext().createTempSymbol();
20962096
const MCExpr *TmpExpr = MCSymbolRefExpr::create(TmpLabel, getContext());
20972097
const MCExpr *RelocJalrExpr =
2098-
MCSymbolRefExpr::create(JalSym, MCSymbolRefExpr::VK_None,
2099-
getContext(), IDLoc);
2098+
MCSymbolRefExpr::create(JalSym, getContext(), IDLoc);
21002099

21012100
TOut.getStreamer().emitRelocDirective(
21022101
*TmpExpr, inMicroMipsMode() ? "R_MICROMIPS_JALR" : "R_MIPS_JALR",
@@ -3313,8 +3312,7 @@ bool MipsAsmParser::emitPartialAddress(MipsTargetStreamer &TOut, SMLoc IDLoc,
33133312
return true;
33143313

33153314
if(IsPicEnabled) {
3316-
const MCExpr *GotSym =
3317-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
3315+
const MCExpr *GotSym = MCSymbolRefExpr::create(Sym, getContext());
33183316
const MipsMCExpr *GotExpr =
33193317
MipsMCExpr::create(MipsMCExpr::MEK_GOT, GotSym, getContext());
33203318

@@ -3326,8 +3324,7 @@ bool MipsAsmParser::emitPartialAddress(MipsTargetStreamer &TOut, SMLoc IDLoc,
33263324
IDLoc, STI);
33273325
}
33283326
} else { //!IsPicEnabled
3329-
const MCExpr *HiSym =
3330-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
3327+
const MCExpr *HiSym = MCSymbolRefExpr::create(Sym, getContext());
33313328
const MipsMCExpr *HiExpr =
33323329
MipsMCExpr::create(MipsMCExpr::MEK_HI, HiSym, getContext());
33333330

@@ -3340,12 +3337,10 @@ bool MipsAsmParser::emitPartialAddress(MipsTargetStreamer &TOut, SMLoc IDLoc,
33403337
if(isABI_O32() || isABI_N32()) {
33413338
TOut.emitRX(Mips::LUi, ATReg, MCOperand::createExpr(HiExpr), IDLoc, STI);
33423339
} else { //isABI_N64()
3343-
const MCExpr *HighestSym =
3344-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
3340+
const MCExpr *HighestSym = MCSymbolRefExpr::create(Sym, getContext());
33453341
const MipsMCExpr *HighestExpr =
33463342
MipsMCExpr::create(MipsMCExpr::MEK_HIGHEST, HighestSym, getContext());
3347-
const MCExpr *HigherSym =
3348-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
3343+
const MCExpr *HigherSym = MCSymbolRefExpr::create(Sym, getContext());
33493344
const MipsMCExpr *HigherExpr =
33503345
MipsMCExpr::create(MipsMCExpr::MEK_HIGHER, HigherSym, getContext());
33513346

@@ -3433,8 +3428,7 @@ bool MipsAsmParser::expandLoadSingleImmToFPR(MCInst &Inst, SMLoc IDLoc,
34333428
getContext().getELFSection(".rodata", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
34343429

34353430
MCSymbol *Sym = getContext().createTempSymbol();
3436-
const MCExpr *LoSym =
3437-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
3431+
const MCExpr *LoSym = MCSymbolRefExpr::create(Sym, getContext());
34383432
const MipsMCExpr *LoExpr =
34393433
MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext());
34403434

@@ -3485,8 +3479,7 @@ bool MipsAsmParser::expandLoadDoubleImmToGPR(MCInst &Inst, SMLoc IDLoc,
34853479
getContext().getELFSection(".rodata", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
34863480

34873481
MCSymbol *Sym = getContext().createTempSymbol();
3488-
const MCExpr *LoSym =
3489-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
3482+
const MCExpr *LoSym = MCSymbolRefExpr::create(Sym, getContext());
34903483
const MipsMCExpr *LoExpr =
34913484
MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext());
34923485

@@ -3567,8 +3560,7 @@ bool MipsAsmParser::expandLoadDoubleImmToFPR(MCInst &Inst, bool Is64FPU,
35673560
getContext().getELFSection(".rodata", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
35683561

35693562
MCSymbol *Sym = getContext().createTempSymbol();
3570-
const MCExpr *LoSym =
3571-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
3563+
const MCExpr *LoSym = MCSymbolRefExpr::create(Sym, getContext());
35723564
const MipsMCExpr *LoExpr =
35733565
MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext());
35743566

@@ -6457,8 +6449,7 @@ bool MipsAsmParser::parseOperand(OperandVector &Operands, StringRef Mnemonic) {
64576449
SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
64586450
MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);
64596451
// Otherwise create a symbol reference.
6460-
const MCExpr *SymRef =
6461-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
6452+
const MCExpr *SymRef = MCSymbolRefExpr::create(Sym, getContext());
64626453

64636454
Operands.push_back(MipsOperand::CreateImm(SymRef, S, E, *this));
64646455
return false;

llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,9 +1118,7 @@ void MipsTargetELFStreamer::emitDirectiveEnd(StringRef Name) {
11181118
Sec->setAlignment(Align(4));
11191119

11201120
MCSymbol *Sym = Context.getOrCreateSymbol(Name);
1121-
const MCSymbolRefExpr *ExprRef =
1122-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, Context);
1123-
1121+
const auto *ExprRef = MCSymbolRefExpr::create(Sym, Context);
11241122
OS.emitValueImpl(ExprRef, 4);
11251123

11261124
OS.emitIntValue(GPRInfoSet ? GPRBitMask : 0, 4); // reg_mask
@@ -1143,8 +1141,7 @@ void MipsTargetELFStreamer::emitDirectiveEnd(StringRef Name) {
11431141
MCSymbol *CurPCSym = Context.createTempSymbol();
11441142
OS.emitLabel(CurPCSym);
11451143
const MCExpr *Size = MCBinaryExpr::createSub(
1146-
MCSymbolRefExpr::create(CurPCSym, MCSymbolRefExpr::VK_None, Context),
1147-
ExprRef, Context);
1144+
MCSymbolRefExpr::create(CurPCSym, Context), ExprRef, Context);
11481145

11491146
// The ELFObjectWriter can determine the absolute size as it has access to
11501147
// the layout information of the assembly file, so a size expression rather

llvm/lib/Target/Mips/MipsAsmPrinter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,7 @@ void MipsAsmPrinter::EmitSled(const MachineInstr &MI, SledKind Kind) {
11991199

12001200
// Emit "B .tmpN" instruction, which jumps over the nop sled to the actual
12011201
// start of function
1202-
const MCExpr *TargetExpr = MCSymbolRefExpr::create(
1203-
Target, MCSymbolRefExpr::VariantKind::VK_None, OutContext);
1202+
const MCExpr *TargetExpr = MCSymbolRefExpr::create(Target, OutContext);
12041203
EmitToStreamer(*OutStreamer, MCInstBuilder(Mips::BEQ)
12051204
.addReg(Mips::ZERO)
12061205
.addReg(Mips::ZERO)

llvm/lib/Target/Mips/MipsTargetObjectFile.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ MCSection *MipsTargetObjectFile::getSectionForConstant(const DataLayout &DL,
186186

187187
const MCExpr *
188188
MipsTargetObjectFile::getDebugThreadLocalSymbol(const MCSymbol *Sym) const {
189-
const MCExpr *Expr =
190-
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
189+
const MCExpr *Expr = MCSymbolRefExpr::create(Sym, getContext());
191190
Expr = MCBinaryExpr::createAdd(
192191
Expr, MCConstantExpr::create(0x8000, getContext()), getContext());
193192
return MipsMCExpr::create(MipsMCExpr::MEK_DTPREL, Expr, getContext());

llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ unsigned NVPTXAsmPrinter::encodeVirtualRegister(unsigned Reg) {
245245

246246
MCOperand NVPTXAsmPrinter::GetSymbolRef(const MCSymbol *Symbol) {
247247
const MCExpr *Expr;
248-
Expr = MCSymbolRefExpr::create(Symbol, MCSymbolRefExpr::VK_None,
249-
OutContext);
248+
Expr = MCSymbolRefExpr::create(Symbol, OutContext);
250249
return MCOperand::createExpr(Expr);
251250
}
252251

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,7 @@ void PPCAsmPrinter::EmitAIXTlsCallHelper(const MachineInstr *MI) {
680680
"Only expecting to emit calls to get the thread pointer on AIX!");
681681

682682
MCSymbol *TlsCall = createMCSymbolForTlsGetAddr(OutContext, MI->getOpcode());
683-
const MCExpr *TlsRef =
684-
MCSymbolRefExpr::create(TlsCall, MCSymbolRefExpr::VK_None, OutContext);
683+
const MCExpr *TlsRef = MCSymbolRefExpr::create(TlsCall, OutContext);
685684
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::BLA).addExpr(TlsRef));
686685
}
687686

@@ -1008,8 +1007,7 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
10081007
MCSymbol *PICOffset =
10091008
MF->getInfo<PPCFunctionInfo>()->getPICOffsetSymbol(*MF);
10101009
TmpInst.setOpcode(PPC::LWZ);
1011-
const MCExpr *Exp =
1012-
MCSymbolRefExpr::create(PICOffset, MCSymbolRefExpr::VK_None, OutContext);
1010+
const MCExpr *Exp = MCSymbolRefExpr::create(PICOffset, OutContext);
10131011
const MCExpr *PB =
10141012
MCSymbolRefExpr::create(MF->getPICBaseSymbol(),
10151013
MCSymbolRefExpr::VK_None,
@@ -1064,8 +1062,7 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
10641062
// 'MOSymbol'. Said TOC entry will be synthesized later.
10651063
MCSymbol *TOCEntry =
10661064
lookUpOrCreateTOCEntry(MOSymbol, getTOCEntryTypeForMO(MO), VK);
1067-
const MCExpr *Exp =
1068-
MCSymbolRefExpr::create(TOCEntry, MCSymbolRefExpr::VK_None, OutContext);
1065+
const MCExpr *Exp = MCSymbolRefExpr::create(TOCEntry, OutContext);
10691066

10701067
// AIX uses the label directly as the lwz displacement operand for
10711068
// references into the toc section. The displacement value will be generated
@@ -1110,8 +1107,7 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
11101107
// Map the operand to its corresponding MCSymbol.
11111108
const MCSymbol *const MOSymbol = getMCSymbolForTOCPseudoMO(MO, *this);
11121109

1113-
const MCExpr *Exp =
1114-
MCSymbolRefExpr::create(MOSymbol, MCSymbolRefExpr::VK_None, OutContext);
1110+
const MCExpr *Exp = MCSymbolRefExpr::create(MOSymbol, OutContext);
11151111

11161112
TmpInst.getOperand(2) = MCOperand::createExpr(Exp);
11171113
EmitToStreamer(*OutStreamer, TmpInst);

0 commit comments

Comments
 (0)