summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-10-16 01:33:11 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-10-16 01:33:11 +0000
commit584a1b25ef4e146e8e6ea568946c73e0618a8393 (patch)
tree8d8010b864289130e20fc0d990e31882f89f9b7b /llvm/lib/MC
parent1faca9e0fbde2150205d6e0ebd44d2076876af46 (diff)
downloadbcm5719-llvm-584a1b25ef4e146e8e6ea568946c73e0618a8393.tar.gz
bcm5719-llvm-584a1b25ef4e146e8e6ea568946c73e0618a8393.zip
MC: Switch MCContext value table to storing MCExprs.
llvm-svn: 84228
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCContext.cpp17
-rw-r--r--llvm/lib/MC/MCExpr.cpp7
2 files changed, 3 insertions, 21 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index f36564a6afa..db59f7f505c 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/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/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index 0f3e053de8e..4c92bbb0a50 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud