Rename MCValue::getCst to getConstant and add MCValue::isConstant.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 29 Jun 2009 19:51:00 +0000 (19:51 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 29 Jun 2009 19:51:00 +0000 (19:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74440 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCValue.h
lib/MC/MCAsmStreamer.cpp

index 7df12dadd0ea2805a536bc7f4a18b88c209be0d8..811d331eddacd1c53e67a42e0fa89da0bdd0a1d7 100644 (file)
@@ -30,10 +30,11 @@ class MCValue {
   int64_t Cst;
 public:
 
-  int64_t getCst() const { return Cst; }
+  int64_t getConstant() const { return Cst; }
   MCSymbol *getSymA() const { return SymA; }
   MCSymbol *getSymB() const { return SymB; }
-  
+
+  bool isConstant() const { return !SymA && !SymB; }
   
   static MCValue get(MCSymbol *SymA, MCSymbol *SymB = 0, int64_t Val = 0) {
     MCValue R;
index e38f2b3d8bcae4f8c472705564b67c65f1eab320..eebb58c936515972c09e1f8a4a8b3804cb5ec54c 100644 (file)
@@ -66,11 +66,11 @@ static inline raw_ostream &operator<<(raw_ostream &os, const MCValue &Value) {
     os << Value.getSymA()->getName();
     if (Value.getSymB())
       os << " - " << Value.getSymB()->getName();
-    if (Value.getCst())
-      os << " + " << Value.getCst();
+    if (Value.getConstant())
+      os << " + " << Value.getConstant();
   } else {
     assert(!Value.getSymB() && "Invalid machine code value!");
-    os << Value.getCst();
+    os << Value.getConstant();
   }
 
   return os;
@@ -83,7 +83,7 @@ static inline int64_t truncateToSize(int64_t Value, unsigned Bytes) {
 
 static inline MCValue truncateToSize(const MCValue &Value, unsigned Bytes) {
   return MCValue::get(Value.getSymA(), Value.getSymB(), 
-                      truncateToSize(Value.getCst(), Bytes));
+                      truncateToSize(Value.getConstant(), Bytes));
 }
 
 void MCAsmStreamer::SwitchSection(MCSection *Section) {