aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCExpr.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-03-15 16:10:18 -0700
committerFangrui Song <i@maskray.me>2025-03-15 16:10:19 -0700
commit7722d7519ca2679e105e2db68c889b3727938c8d (patch)
treec74da07a0330b957c4d682aed7da6787610a1a1c /llvm/lib/MC/MCExpr.cpp
parentff2ed154a8a9ea52adb3667833fe6fddd27b0487 (diff)
downloadllvm-7722d7519ca2679e105e2db68c889b3727938c8d.zip
llvm-7722d7519ca2679e105e2db68c889b3727938c8d.tar.gz
llvm-7722d7519ca2679e105e2db68c889b3727938c8d.tar.bz2
[MC] evaluateAsRelocatableImpl: remove the Fixup argument
Follow-up to d6fbffa23c84e622735b3e880fd800985c1c0072 . This commit updates all call sites and removes the argument from the function.
Diffstat (limited to 'llvm/lib/MC/MCExpr.cpp')
-rw-r--r--llvm/lib/MC/MCExpr.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index 999b968..8ac996f 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/lib/MC/MCExpr.cpp
@@ -286,8 +286,8 @@ bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
}
bool IsRelocatable = evaluateAsRelocatableImpl(Value, Asm, Addrs, InSet);
- Res = Value.getConstant();
- // Value with RefKind (e.g. %hi(0xdeadbeef) in MIPS) is not considered
+ Res = Value.getConstant(); // Value with RefKind (e.g. %hi(0xdeadbeef) in
+ // MIPS) is not considered
// absolute (the value is unknown at parse time), even if it might be resolved
// by evaluateFixup.
return IsRelocatable && Value.isAbsolute() && Value.getRefKind() == 0;
@@ -493,15 +493,12 @@ static bool evaluateSymbolicAdd(const MCAssembler *Asm,
return true;
}
-bool MCExpr::evaluateAsRelocatable(MCValue &Res, const MCAssembler *Asm,
- const MCFixup *Fixup) const {
+bool MCExpr::evaluateAsRelocatable(MCValue &Res, const MCAssembler *Asm) const {
return evaluateAsRelocatableImpl(Res, Asm, nullptr, false);
}
-
bool MCExpr::evaluateAsValue(MCValue &Res, const MCAssembler &Asm) const {
return evaluateAsRelocatableImpl(Res, &Asm, nullptr, true);
}
-
static bool canExpand(const MCSymbol &Sym, bool InSet) {
if (Sym.isWeakExternal())
return false;
@@ -524,9 +521,7 @@ bool MCExpr::evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
++stats::MCExprEvaluate;
switch (getKind()) {
case Target:
- return cast<MCTargetExpr>(this)->evaluateAsRelocatableImpl(Res, Asm,
- nullptr);
-
+ return cast<MCTargetExpr>(this)->evaluateAsRelocatableImpl(Res, Asm);
case Constant:
Res = MCValue::get(cast<MCConstantExpr>(this)->getValue());
return true;
@@ -589,7 +584,6 @@ bool MCExpr::evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
if (!AUE->getSubExpr()->evaluateAsRelocatableImpl(Value, Asm, Addrs, InSet))
return false;
-
switch (AUE->getOpcode()) {
case MCUnaryExpr::LNot:
if (!Value.isAbsolute())