Skip to content

Commit 687854a

Browse files
committed
[MC] Remove unneeded VK_None argument from MCSymbolRefExpr::create. NFC
1 parent a6151f4 commit 687854a

File tree

6 files changed

+16
-30
lines changed

6 files changed

+16
-30
lines changed

llvm/lib/MC/MCDwarf.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,7 @@ static void EmitGenDwarfAranges(MCStreamer *MCOS,
916916
assert(StartSymbol && "StartSymbol must not be NULL");
917917
assert(EndSymbol && "EndSymbol must not be NULL");
918918

919-
const MCExpr *Addr = MCSymbolRefExpr::create(
920-
StartSymbol, MCSymbolRefExpr::VK_None, context);
919+
const MCExpr *Addr = MCSymbolRefExpr::create(StartSymbol, context);
921920
const MCExpr *Size =
922921
makeEndMinusStartExpr(context, *StartSymbol, *EndSymbol, 0);
923922
MCOS->emitValue(Addr, AddrSize);
@@ -1018,13 +1017,11 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
10181017
assert(EndSymbol && "EndSymbol must not be NULL");
10191018

10201019
// AT_low_pc, the first address of the default .text section.
1021-
const MCExpr *Start = MCSymbolRefExpr::create(
1022-
StartSymbol, MCSymbolRefExpr::VK_None, context);
1020+
const MCExpr *Start = MCSymbolRefExpr::create(StartSymbol, context);
10231021
MCOS->emitValue(Start, AddrSize);
10241022

10251023
// AT_high_pc, the last address of the default .text section.
1026-
const MCExpr *End = MCSymbolRefExpr::create(
1027-
EndSymbol, MCSymbolRefExpr::VK_None, context);
1024+
const MCExpr *End = MCSymbolRefExpr::create(EndSymbol, context);
10281025
MCOS->emitValue(End, AddrSize);
10291026
}
10301027

@@ -1091,8 +1088,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
10911088
MCOS->emitInt32(Entry.getLineNumber());
10921089

10931090
// AT_low_pc, start address of the label.
1094-
const MCExpr *AT_low_pc = MCSymbolRefExpr::create(Entry.getLabel(),
1095-
MCSymbolRefExpr::VK_None, context);
1091+
const auto *AT_low_pc = MCSymbolRefExpr::create(Entry.getLabel(), context);
10961092
MCOS->emitValue(AT_low_pc, AddrSize);
10971093
}
10981094

@@ -1124,8 +1120,8 @@ static MCSymbol *emitGenDwarfRanges(MCStreamer *MCOS) {
11241120
for (MCSection *Sec : Sections) {
11251121
const MCSymbol *StartSymbol = Sec->getBeginSymbol();
11261122
const MCSymbol *EndSymbol = Sec->getEndSymbol(context);
1127-
const MCExpr *SectionStartAddr = MCSymbolRefExpr::create(
1128-
StartSymbol, MCSymbolRefExpr::VK_None, context);
1123+
const MCExpr *SectionStartAddr =
1124+
MCSymbolRefExpr::create(StartSymbol, context);
11291125
const MCExpr *SectionSize =
11301126
makeEndMinusStartExpr(context, *StartSymbol, *EndSymbol, 0);
11311127
MCOS->emitInt8(dwarf::DW_RLE_start_length);
@@ -1143,8 +1139,8 @@ static MCSymbol *emitGenDwarfRanges(MCStreamer *MCOS) {
11431139
const MCSymbol *EndSymbol = Sec->getEndSymbol(context);
11441140

11451141
// Emit a base address selection entry for the section start.
1146-
const MCExpr *SectionStartAddr = MCSymbolRefExpr::create(
1147-
StartSymbol, MCSymbolRefExpr::VK_None, context);
1142+
const MCExpr *SectionStartAddr =
1143+
MCSymbolRefExpr::create(StartSymbol, context);
11481144
MCOS->emitFill(AddrSize, 0xFF);
11491145
MCOS->emitValue(SectionStartAddr, AddrSize);
11501146

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,7 @@ void AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(
10071007
MCBinaryExpr::createSub(
10081008
MCSymbolRefExpr::create(KernelCodeSymbol,
10091009
MCSymbolRefExpr::VK_AMDGPU_REL64, Context),
1010-
MCSymbolRefExpr::create(KernelDescriptorSymbol,
1011-
MCSymbolRefExpr::VK_None, Context),
1012-
Context),
1010+
MCSymbolRefExpr::create(KernelDescriptorSymbol, Context), Context),
10131011
sizeof(amdhsa::kernel_descriptor_t::kernel_code_entry_byte_offset));
10141012
for (uint32_t i = 0; i < sizeof(amdhsa::kernel_descriptor_t::reserved1); ++i)
10151013
Streamer.emitInt8(0u);

llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9066,7 +9066,6 @@ bool ARMAsmParser::processInstruction(MCInst &Inst,
90669066
Out.emitLabel(Dot);
90679067
const MCExpr *OpExpr = Inst.getOperand(2).getExpr();
90689068
const MCExpr *InstPC = MCSymbolRefExpr::create(Dot,
9069-
MCSymbolRefExpr::VK_None,
90709069
getContext());
90719070
const MCExpr *Const8 = MCConstantExpr::create(8, getContext());
90729071
const MCExpr *ReadPC = MCBinaryExpr::createAdd(InstPC, Const8,

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,6 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
10101010
const MCExpr *Exp = MCSymbolRefExpr::create(PICOffset, OutContext);
10111011
const MCExpr *PB =
10121012
MCSymbolRefExpr::create(MF->getPICBaseSymbol(),
1013-
MCSymbolRefExpr::VK_None,
10141013
OutContext);
10151014
const MCOperand TR = TmpInst.getOperand(1);
10161015
const MCOperand PICR = TmpInst.getOperand(0);
@@ -1404,16 +1403,12 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
14041403
case PPC::PPC32GOT: {
14051404
MCSymbol *GOTSymbol =
14061405
OutContext.getOrCreateSymbol(StringRef("_GLOBAL_OFFSET_TABLE_"));
1407-
const MCExpr *SymGotTlsL =
1408-
PPCMCExpr::create(PPCMCExpr::VK_PPC_LO,
1409-
MCSymbolRefExpr::create(
1410-
GOTSymbol, MCSymbolRefExpr::VK_None, OutContext),
1411-
OutContext);
1412-
const MCExpr *SymGotTlsHA =
1413-
PPCMCExpr::create(PPCMCExpr::VK_PPC_HA,
1414-
MCSymbolRefExpr::create(
1415-
GOTSymbol, MCSymbolRefExpr::VK_None, OutContext),
1416-
OutContext);
1406+
const MCExpr *SymGotTlsL = PPCMCExpr::create(
1407+
PPCMCExpr::VK_PPC_LO, MCSymbolRefExpr::create(GOTSymbol, OutContext),
1408+
OutContext);
1409+
const MCExpr *SymGotTlsHA = PPCMCExpr::create(
1410+
PPCMCExpr::VK_PPC_HA, MCSymbolRefExpr::create(GOTSymbol, OutContext),
1411+
OutContext);
14171412
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::LI)
14181413
.addReg(MI->getOperand(0).getReg())
14191414
.addExpr(SymGotTlsL));

llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ static const MCSymbolRefExpr *getTLSGetOffset(MCContext &Context) {
8686
static const MCSymbolRefExpr *getGlobalOffsetTable(MCContext &Context) {
8787
StringRef Name = "_GLOBAL_OFFSET_TABLE_";
8888
return MCSymbolRefExpr::create(Context.getOrCreateSymbol(Name),
89-
MCSymbolRefExpr::VK_None,
9089
Context);
9190
}
9291

llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,7 @@ bool XtensaAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
410410
TmpInst.setOpcode(Xtensa::L32R);
411411
const MCExpr *Value = MCConstantExpr::create(ImmOp64, getContext());
412412
MCSymbol *Sym = getContext().createTempSymbol();
413-
const MCExpr *Expr = MCSymbolRefExpr::create(
414-
Sym, MCSymbolRefExpr::VK_None, getContext());
413+
const MCExpr *Expr = MCSymbolRefExpr::create(Sym, getContext());
415414
const MCExpr *OpExpr = XtensaMCExpr::create(
416415
Expr, XtensaMCExpr::VK_Xtensa_None, getContext());
417416
TmpInst.addOperand(Inst.getOperand(0));

0 commit comments

Comments
 (0)