[llvm-commits] [llvm] r84233 - in /llvm/trunk: include/llvm/MC/MCExpr.h lib/MC/MCExpr.cpp lib/MC/MCMachOStreamer.cpp tools/llvm-mc/AsmParser.cpp

Daniel Dunbar daniel at zuster.org
Thu Oct 15 18:57:53 PDT 2009


Author: ddunbar
Date: Thu Oct 15 20:57:52 2009
New Revision: 84233

URL: http://llvm.org/viewvc/llvm-project?rev=84233&view=rev
Log:
MC: Remove unneeded context argument to MCExpr::Evaluate*.

Modified:
    llvm/trunk/include/llvm/MC/MCExpr.h
    llvm/trunk/lib/MC/MCExpr.cpp
    llvm/trunk/lib/MC/MCMachOStreamer.cpp
    llvm/trunk/tools/llvm-mc/AsmParser.cpp

Modified: llvm/trunk/include/llvm/MC/MCExpr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=84233&r1=84232&r2=84233&view=diff

==============================================================================
--- llvm/trunk/include/llvm/MC/MCExpr.h (original)
+++ llvm/trunk/include/llvm/MC/MCExpr.h Thu Oct 15 20:57:52 2009
@@ -62,14 +62,14 @@
   ///
   /// @param Res - The absolute value, if evaluation succeeds.
   /// @result - True on success.
-  bool EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const;
+  bool EvaluateAsAbsolute(int64_t &Res) const;
 
   /// EvaluateAsRelocatable - Try to evaluate the expression to a relocatable
   /// value, i.e. an expression of the fixed form (a - b + constant).
   ///
   /// @param Res - The relocatable value, if evaluation succeeds.
   /// @result - True on success.
-  bool EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const;
+  bool EvaluateAsRelocatable(MCValue &Res) const;
 
   /// @}
 

Modified: llvm/trunk/lib/MC/MCExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=84233&r1=84232&r2=84233&view=diff

==============================================================================
--- llvm/trunk/lib/MC/MCExpr.cpp (original)
+++ llvm/trunk/lib/MC/MCExpr.cpp Thu Oct 15 20:57:52 2009
@@ -141,10 +141,10 @@
 
 /* *** */
 
-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 @@
   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 @@
 
     // 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 @@
     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 @@
     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

Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=84233&r1=84232&r2=84233&view=diff

==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Thu Oct 15 20:57:52 2009
@@ -346,8 +346,7 @@
                                         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);

Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.cpp?rev=84233&r1=84232&r2=84233&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.cpp (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.cpp Thu Oct 15 20:57:52 2009
@@ -292,7 +292,7 @@
   if (ParseExpression(Expr))
     return true;
 
-  if (!Expr->EvaluateAsAbsolute(Ctx, Res))
+  if (!Expr->EvaluateAsAbsolute(Res))
     return Error(StartLoc, "expected absolute expression");
 
   return false;





More information about the llvm-commits mailing list