MC: Move assembler variable values from MCContext to MCSymbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84229 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar
2009-10-16 01:33:57 +00:00
parent e579849652
commit 7c3600de94
3 changed files with 33 additions and 32 deletions

View File

@@ -181,8 +181,11 @@ bool MCExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const {
case SymbolRef: {
const MCSymbol &Sym = cast<MCSymbolRefExpr>(this)->getSymbol();
if (const MCExpr *Value = Ctx.GetSymbolValue(&Sym))
return Value->EvaluateAsRelocatable(Ctx, Res);
// Evaluate recursively if this is a variable.
if (Sym.isVariable())
return Sym.getValue()->EvaluateAsRelocatable(Ctx, Res);
Res = MCValue::get(&Sym, 0, 0);
return true;
}