mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Try harder to evaluate expressions when printing assembly.
When printing assembly we don't have a Layout object, but we can still try to fold some constants. Testcase by Ulrich Weigand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203677 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -122,7 +122,7 @@ uint64_t MCAsmLayout::getSymbolOffset(const MCSymbolData *SD) const {
|
||||
// If this is a variable, then recursively evaluate now.
|
||||
if (S.isVariable()) {
|
||||
MCValue Target;
|
||||
if (!S.getVariableValue()->EvaluateAsRelocatable(Target, *this))
|
||||
if (!S.getVariableValue()->EvaluateAsRelocatable(Target, this))
|
||||
report_fatal_error("unable to evaluate offset for variable '" +
|
||||
S.getName() + "'");
|
||||
|
||||
@@ -357,7 +357,7 @@ bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
|
||||
MCValue &Target, uint64_t &Value) const {
|
||||
++stats::evaluateFixup;
|
||||
|
||||
if (!Fixup.getValue()->EvaluateAsRelocatable(Target, Layout))
|
||||
if (!Fixup.getValue()->EvaluateAsRelocatable(Target, &Layout))
|
||||
getContext().FatalError(Fixup.getLoc(), "expected relocatable expression");
|
||||
|
||||
bool IsPCRel = Backend.getFixupKindInfo(
|
||||
|
Reference in New Issue
Block a user