Skip to content

Commit 590d2a3

Browse files
committed
[Mips,MC] Replace getSymA()->getSymbol() with getAddSym. NFC
We will replace the MCSymbolRefExpr member in MCValue with MCSymbol. This change reduces dependence on MCSymbolRefExpr.
1 parent d9a767c commit 590d2a3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ bool AVRMCExpr::evaluateAsRelocatableImpl(MCValue &Result,
8181
return false;
8282

8383
MCContext &Context = Asm->getContext();
84-
const MCSymbolRefExpr *Sym = Value.getSymA();
85-
MCSymbolRefExpr::VariantKind Modifier = Sym->getKind();
86-
if (Modifier != MCSymbolRefExpr::VK_None)
84+
const MCSymbolRefExpr *Sym = nullptr;
85+
auto Spec = AVRMCExpr::VK_None;
86+
if (Value.getSymSpecifier() != MCSymbolRefExpr::VK_None)
8787
return false;
8888
assert(!Value.getSubSym());
89-
if (specifier == VK_PM) {
90-
Modifier = MCSymbolRefExpr::VariantKind(AVRMCExpr::VK_PM);
91-
}
89+
if (specifier == VK_PM)
90+
Spec = AVRMCExpr::VK_PM;
9291

93-
Sym = MCSymbolRefExpr::create(&Sym->getSymbol(), Modifier, Context);
92+
// TODO: don't attach specifier to MCSymbolRefExpr.
93+
Sym = MCSymbolRefExpr::create(Value.getAddSym(), Spec, Context);
9494
Result = MCValue::get(Sym, nullptr, Value.getConstant());
9595
}
9696

0 commit comments

Comments
 (0)