diff options
Diffstat (limited to 'lib/MC')
| -rw-r--r-- | lib/MC/MCContext.cpp | 17 | ||||
| -rw-r--r-- | lib/MC/MCExpr.cpp | 7 |
2 files changed, 3 insertions, 21 deletions
diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index f36564a..db59f7f 100644 --- a/lib/MC/MCContext.cpp +++ b/lib/MC/MCContext.cpp @@ -52,20 +52,3 @@ MCSymbol *MCContext::CreateTemporarySymbol(const StringRef &Name) { MCSymbol *MCContext::LookupSymbol(const StringRef &Name) const { return Symbols.lookup(Name); } - -void MCContext::ClearSymbolValue(const MCSymbol *Sym) { - SymbolValues.erase(Sym); -} - -void MCContext::SetSymbolValue(const MCSymbol *Sym, const MCValue &Value) { - SymbolValues[Sym] = Value; -} - -const MCValue *MCContext::GetSymbolValue(const MCSymbol *Sym) const { - DenseMap<const MCSymbol*, MCValue>::iterator it = SymbolValues.find(Sym); - - if (it == SymbolValues.end()) - return 0; - - return &it->second; -} diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp index 0f3e053..4c92bbb 100644 --- a/lib/MC/MCExpr.cpp +++ b/lib/MC/MCExpr.cpp @@ -181,10 +181,9 @@ bool MCExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const { case SymbolRef: { const MCSymbol &Sym = cast<MCSymbolRefExpr>(this)->getSymbol(); - if (const MCValue *Value = Ctx.GetSymbolValue(&Sym)) - Res = *Value; - else - Res = MCValue::get(&Sym, 0, 0); + if (const MCExpr *Value = Ctx.GetSymbolValue(&Sym)) + return Value->EvaluateAsRelocatable(Ctx, Res); + Res = MCValue::get(&Sym, 0, 0); return true; } |
