Skip to content

Commit cadfaa8

Browse files
committed
[AVR,CSKY] Migrate away from MCValue::getSymB
The MCValue::SymB MCSymbolRefExpr member might be replaced with a MCSymbol in the future. Reduce direct access.
1 parent 33246f7 commit cadfaa8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ bool AVRMCExpr::evaluateAsRelocatableImpl(MCValue &Result,
8585
MCSymbolRefExpr::VariantKind Modifier = Sym->getKind();
8686
if (Modifier != MCSymbolRefExpr::VK_None)
8787
return false;
88+
assert(!Value.getSubSym());
8889
if (specifier == VK_PM) {
8990
Modifier = MCSymbolRefExpr::VariantKind(AVRMCExpr::VK_PM);
9091
}
9192

9293
Sym = MCSymbolRefExpr::create(&Sym->getSymbol(), Modifier, Context);
93-
Result = MCValue::get(Sym, Value.getSymB(), Value.getConstant());
94+
Result = MCValue::get(Sym, nullptr, Value.getConstant());
9495
}
9596

9697
return true;

llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ bool CSKYMCExpr::evaluateAsRelocatableImpl(MCValue &Res,
7272
if (!getSubExpr()->evaluateAsRelocatable(Res, Asm))
7373
return false;
7474
Res.setSpecifier(specifier);
75-
return !Res.getSymB();
75+
return !Res.getSubSym();
7676
}

0 commit comments

Comments
 (0)