summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-10-16 01:57:52 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-10-16 01:57:52 +0000
commite00b011e6a2597fcc3da88da91a8ffda6eebfcda (patch)
tree7d4771339ae5e1606e0695f761fb7017f0b5c5c0 /lib
parent75773ff00da79ecf65e8578cf6f013295a2069cf (diff)
downloadllvm-e00b011e6a2597fcc3da88da91a8ffda6eebfcda.tar.gz
llvm-e00b011e6a2597fcc3da88da91a8ffda6eebfcda.tar.bz2
llvm-e00b011e6a2597fcc3da88da91a8ffda6eebfcda.tar.xz
MC: Remove unneeded context argument to MCExpr::Evaluate*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84233 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/MC/MCExpr.cpp14
-rw-r--r--lib/MC/MCMachOStreamer.cpp3
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp
index d6e545fa78..c950ff2ff5 100644
--- a/lib/MC/MCExpr.cpp
+++ b/lib/MC/MCExpr.cpp
@@ -141,10 +141,10 @@ const MCSymbolRefExpr *MCSymbolRefExpr::Create(const StringRef &Name,
/* *** */
-bool MCExpr::EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const {
+bool MCExpr::EvaluateAsAbsolute(int64_t &Res) const {
MCValue Value;
- if (!EvaluateAsRelocatable(Ctx, Value) || !Value.isAbsolute())
+ if (!EvaluateAsRelocatable(Value) || !Value.isAbsolute())
return false;
Res = Value.getConstant();
@@ -173,7 +173,7 @@ static bool EvaluateSymbolicAdd(const MCValue &LHS, const MCSymbol *RHS_A,
return true;
}
-bool MCExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const {
+bool MCExpr::EvaluateAsRelocatable(MCValue &Res) const {
switch (getKind()) {
case Constant:
Res = MCValue::get(cast<MCConstantExpr>(this)->getValue());
@@ -184,7 +184,7 @@ bool MCExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const {
// Evaluate recursively if this is a variable.
if (Sym.isVariable())
- return Sym.getValue()->EvaluateAsRelocatable(Ctx, Res);
+ return Sym.getValue()->EvaluateAsRelocatable(Res);
Res = MCValue::get(&Sym, 0, 0);
return true;
@@ -194,7 +194,7 @@ bool MCExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const {
const MCUnaryExpr *AUE = cast<MCUnaryExpr>(this);
MCValue Value;
- if (!AUE->getSubExpr()->EvaluateAsRelocatable(Ctx, Value))
+ if (!AUE->getSubExpr()->EvaluateAsRelocatable(Value))
return false;
switch (AUE->getOpcode()) {
@@ -227,8 +227,8 @@ bool MCExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const {
const MCBinaryExpr *ABE = cast<MCBinaryExpr>(this);
MCValue LHSValue, RHSValue;
- if (!ABE->getLHS()->EvaluateAsRelocatable(Ctx, LHSValue) ||
- !ABE->getRHS()->EvaluateAsRelocatable(Ctx, RHSValue))
+ if (!ABE->getLHS()->EvaluateAsRelocatable(LHSValue) ||
+ !ABE->getRHS()->EvaluateAsRelocatable(RHSValue))
return false;
// We only support a few operations on non-constant expressions, handle
diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp
index e04bd1fd1c..b592391c51 100644
--- a/lib/MC/MCMachOStreamer.cpp
+++ b/lib/MC/MCMachOStreamer.cpp
@@ -346,8 +346,7 @@ void MCMachOStreamer::EmitValueToOffset(const MCExpr *Offset,
unsigned char Value) {
MCValue RelocOffset;
- if (!AddValueSymbols(Offset)->EvaluateAsRelocatable(getContext(),
- RelocOffset))
+ if (!AddValueSymbols(Offset)->EvaluateAsRelocatable(RelocOffset))
return llvm_report_error("expected relocatable expression");
new MCOrgFragment(RelocOffset, Value, CurSectionData);