mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +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:
@@ -82,7 +82,7 @@ uint64_t MachObjectWriter::getSymbolAddress(const MCSymbolData* SD,
|
||||
|
||||
|
||||
MCValue Target;
|
||||
if (!S.getVariableValue()->EvaluateAsRelocatable(Target, Layout))
|
||||
if (!S.getVariableValue()->EvaluateAsRelocatable(Target, &Layout))
|
||||
report_fatal_error("unable to evaluate offset for variable '" +
|
||||
S.getName() + "'");
|
||||
|
||||
@@ -631,7 +631,7 @@ void MachObjectWriter::markAbsoluteVariableSymbols(MCAssembler &Asm,
|
||||
// and neither symbol is external, mark the variable as absolute.
|
||||
const MCExpr *Expr = SD.getSymbol().getVariableValue();
|
||||
MCValue Value;
|
||||
if (Expr->EvaluateAsRelocatable(Value, Layout)) {
|
||||
if (Expr->EvaluateAsRelocatable(Value, &Layout)) {
|
||||
if (Value.getSymA() && Value.getSymB())
|
||||
const_cast<MCSymbol*>(&SD.getSymbol())->setAbsolute();
|
||||
}
|
||||
|
Reference in New Issue
Block a user