mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
MC: Remove dead MCAssembler argument -- Rafael, can you check the FIXME I added
here? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122012 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
204e3b65eb
commit
92c66c7bf9
@ -50,8 +50,7 @@ private:
|
|||||||
protected:
|
protected:
|
||||||
explicit MCExpr(ExprKind _Kind) : Kind(_Kind) {}
|
explicit MCExpr(ExprKind _Kind) : Kind(_Kind) {}
|
||||||
|
|
||||||
bool EvaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
|
bool EvaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout,
|
||||||
const MCAsmLayout *Layout,
|
|
||||||
const SectionAddrMap *Addrs,
|
const SectionAddrMap *Addrs,
|
||||||
bool InSet) const;
|
bool InSet) const;
|
||||||
public:
|
public:
|
||||||
|
@ -267,7 +267,8 @@ bool MCExpr::EvaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!EvaluateAsRelocatableImpl(Value, Asm, Layout, Addrs, Addrs) ||
|
// FIXME: This use of Addrs is wrong, right?
|
||||||
|
if (!EvaluateAsRelocatableImpl(Value, Layout, Addrs, /*InSet=*/Addrs) ||
|
||||||
!Value.isAbsolute()) {
|
!Value.isAbsolute()) {
|
||||||
// EvaluateAsAbsolute is defined to return the "current value" of
|
// EvaluateAsAbsolute is defined to return the "current value" of
|
||||||
// the expression if we are given a Layout object, even in cases
|
// the expression if we are given a Layout object, even in cases
|
||||||
@ -377,14 +378,12 @@ static bool EvaluateSymbolicAdd(const MCAsmLayout *Layout,
|
|||||||
bool MCExpr::EvaluateAsRelocatable(MCValue &Res,
|
bool MCExpr::EvaluateAsRelocatable(MCValue &Res,
|
||||||
const MCAsmLayout *Layout) const {
|
const MCAsmLayout *Layout) const {
|
||||||
if (Layout)
|
if (Layout)
|
||||||
return EvaluateAsRelocatableImpl(Res, &Layout->getAssembler(), Layout,
|
return EvaluateAsRelocatableImpl(Res, Layout, 0, false);
|
||||||
0, false);
|
|
||||||
else
|
else
|
||||||
return EvaluateAsRelocatableImpl(Res, 0, 0, 0, false);
|
return EvaluateAsRelocatableImpl(Res, 0, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MCExpr::EvaluateAsRelocatableImpl(MCValue &Res,
|
bool MCExpr::EvaluateAsRelocatableImpl(MCValue &Res,
|
||||||
const MCAssembler *Asm,
|
|
||||||
const MCAsmLayout *Layout,
|
const MCAsmLayout *Layout,
|
||||||
const SectionAddrMap *Addrs,
|
const SectionAddrMap *Addrs,
|
||||||
bool InSet) const {
|
bool InSet) const {
|
||||||
@ -404,10 +403,8 @@ bool MCExpr::EvaluateAsRelocatableImpl(MCValue &Res,
|
|||||||
|
|
||||||
// Evaluate recursively if this is a variable.
|
// Evaluate recursively if this is a variable.
|
||||||
if (Sym.isVariable() && SRE->getKind() == MCSymbolRefExpr::VK_None) {
|
if (Sym.isVariable() && SRE->getKind() == MCSymbolRefExpr::VK_None) {
|
||||||
bool Ret = Sym.getVariableValue()->EvaluateAsRelocatableImpl(Res, Asm,
|
bool Ret = Sym.getVariableValue()->EvaluateAsRelocatableImpl(Res, Layout,
|
||||||
Layout,
|
Addrs, true);
|
||||||
Addrs,
|
|
||||||
true);
|
|
||||||
// If we failed to simplify this to a constant, let the target
|
// If we failed to simplify this to a constant, let the target
|
||||||
// handle it.
|
// handle it.
|
||||||
if (Ret && !Res.getSymA() && !Res.getSymB())
|
if (Ret && !Res.getSymA() && !Res.getSymB())
|
||||||
@ -422,7 +419,7 @@ bool MCExpr::EvaluateAsRelocatableImpl(MCValue &Res,
|
|||||||
const MCUnaryExpr *AUE = cast<MCUnaryExpr>(this);
|
const MCUnaryExpr *AUE = cast<MCUnaryExpr>(this);
|
||||||
MCValue Value;
|
MCValue Value;
|
||||||
|
|
||||||
if (!AUE->getSubExpr()->EvaluateAsRelocatableImpl(Value, Asm, Layout,
|
if (!AUE->getSubExpr()->EvaluateAsRelocatableImpl(Value, Layout,
|
||||||
Addrs, InSet))
|
Addrs, InSet))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -456,9 +453,9 @@ bool MCExpr::EvaluateAsRelocatableImpl(MCValue &Res,
|
|||||||
const MCBinaryExpr *ABE = cast<MCBinaryExpr>(this);
|
const MCBinaryExpr *ABE = cast<MCBinaryExpr>(this);
|
||||||
MCValue LHSValue, RHSValue;
|
MCValue LHSValue, RHSValue;
|
||||||
|
|
||||||
if (!ABE->getLHS()->EvaluateAsRelocatableImpl(LHSValue, Asm, Layout,
|
if (!ABE->getLHS()->EvaluateAsRelocatableImpl(LHSValue, Layout,
|
||||||
Addrs, InSet) ||
|
Addrs, InSet) ||
|
||||||
!ABE->getRHS()->EvaluateAsRelocatableImpl(RHSValue, Asm, Layout,
|
!ABE->getRHS()->EvaluateAsRelocatableImpl(RHSValue, Layout,
|
||||||
Addrs, InSet))
|
Addrs, InSet))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user