Rename MCValue::isConstant to isAbsolute.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 1 Jul 2009 06:48:00 +0000 (06:48 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 1 Jul 2009 06:48:00 +0000 (06:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74596 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCValue.h
tools/llvm-mc/AsmExpr.cpp

index 174992ebe0ff7b8a8e8758b7892d81188a45bc52..d032f170c3f6f971d1b936e6b79c0d327efe886c 100644 (file)
@@ -40,7 +40,8 @@ public:
   MCSymbol *getSymA() const { return SymA; }
   MCSymbol *getSymB() const { return SymB; }
 
-  bool isConstant() const { return !SymA && !SymB; }
+  /// isAbsolute - Is this an absolute (as opposed to relocatable) value.
+  bool isAbsolute() const { return !SymA && !SymB; }
 
   /// getAssociatedSection - For relocatable values, return the section the
   /// value is associated with.
index 4b32b922935b260ba2d2d94ee5ed285c14535d44..c3362e4268c85c9ec38389e1d120538950a7255d 100644 (file)
@@ -19,7 +19,7 @@ AsmExpr::~AsmExpr() {
 bool AsmExpr::EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const {
   MCValue Value;
   
-  if (!EvaluateAsRelocatable(Ctx, Value) || !Value.isConstant())
+  if (!EvaluateAsRelocatable(Ctx, Value) || !Value.isAbsolute())
     return false;
 
   Res = Value.getConstant();
@@ -75,7 +75,7 @@ bool AsmExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const {
 
     switch (AUE->getOpcode()) {
     case AsmUnaryExpr::LNot:
-      if (!Value.isConstant())
+      if (!Value.isAbsolute())
         return false;
       Res = MCValue::get(!Value.getConstant());
       break;
@@ -87,7 +87,7 @@ bool AsmExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const {
                          -Value.getConstant()); 
       break;
     case AsmUnaryExpr::Not:
-      if (!Value.isConstant())
+      if (!Value.isAbsolute())
         return false;
       Res = MCValue::get(~Value.getConstant()); 
       break;
@@ -109,7 +109,7 @@ bool AsmExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const {
 
     // We only support a few operations on non-constant expressions, handle
     // those first.
-    if (!LHSValue.isConstant() || !RHSValue.isConstant()) {
+    if (!LHSValue.isAbsolute() || !RHSValue.isAbsolute()) {
       switch (ABE->getOpcode()) {
       default:
         return false;