Skip to content

Commit f0bc171

Browse files
committed
[Mips] Simplify evaluateAsRelocatableImpl and avoid getSymB calls
The MCValue::SymB MCSymbolRefExpr member might be replaced with a MCSymbol in the future. Reduce direct access.
1 parent 1f96788 commit f0bc171

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,14 @@ bool MipsMCExpr::evaluateAsRelocatableImpl(MCValue &Res,
140140
if (!SubExpr->evaluateAsRelocatable(Res, Asm))
141141
return false;
142142

143-
Res = MCValue::get(Res.getSymA(), Res.getSymB(), Res.getConstant(),
144-
MEK_Special);
143+
Res.setSpecifier(MEK_Special);
145144
return true;
146145
}
147146

148147
if (!getSubExpr()->evaluateAsRelocatable(Res, Asm))
149148
return false;
150-
Res = MCValue::get(Res.getSymA(), Res.getSymB(), Res.getConstant(),
151-
getSpecifier());
152-
return !Res.getSymB();
149+
Res.setSpecifier(specifier);
150+
return !Res.getSubSym();
153151
}
154152

155153
void MipsMCExpr::visitUsedExpr(MCStreamer &Streamer) const {

0 commit comments

Comments
 (0)