forked from OSchip/llvm-project
Add r122359 back now that the bug in MCDwarfLineAddrFragment fragment has been
fixed. llvm-svn: 122448
This commit is contained in:
parent
0bbdaf5723
commit
4124ab1255
|
@ -269,27 +269,13 @@ bool MCExpr::EvaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
|
||||||
// FIXME: The use if InSet = Addrs is a hack. Setting InSet causes us
|
// FIXME: The use if InSet = Addrs is a hack. Setting InSet causes us
|
||||||
// absolutize differences across sections and that is what the MachO writer
|
// absolutize differences across sections and that is what the MachO writer
|
||||||
// uses Addrs for.
|
// uses Addrs for.
|
||||||
if (!EvaluateAsRelocatableImpl(Value, Asm, Layout, Addrs, /*InSet*/ Addrs) ||
|
bool IsRelocatable =
|
||||||
!Value.isAbsolute()) {
|
EvaluateAsRelocatableImpl(Value, Asm, Layout, Addrs, /*InSet*/ Addrs);
|
||||||
// EvaluateAsAbsolute is defined to return the "current value" of
|
|
||||||
// the expression if we are given a Layout object, even in cases
|
|
||||||
// when the value is not fixed.
|
|
||||||
if (Layout) {
|
|
||||||
Res = Value.getConstant();
|
|
||||||
if (Value.getSymA()) {
|
|
||||||
Res += Layout->getSymbolOffset(
|
|
||||||
&Layout->getAssembler().getSymbolData(Value.getSymA()->getSymbol()));
|
|
||||||
}
|
|
||||||
if (Value.getSymB()) {
|
|
||||||
Res -= Layout->getSymbolOffset(
|
|
||||||
&Layout->getAssembler().getSymbolData(Value.getSymB()->getSymbol()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Record the current value.
|
||||||
Res = Value.getConstant();
|
Res = Value.getConstant();
|
||||||
return true;
|
|
||||||
|
return IsRelocatable && Value.isAbsolute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Helper method for \see EvaluateSymbolAdd().
|
/// \brief Helper method for \see EvaluateSymbolAdd().
|
||||||
|
|
Loading…
Reference in New Issue