[llvm-commits] CVS: llvm/include/llvm/Constant.h

Chris Lattner lattner at cs.uiuc.edu
Sun Jul 18 17:58:12 PDT 2004



Changes in directory llvm/include/llvm:

Constant.h updated: 1.14 -> 1.15

---
Log message:

eliminate isConstantExpr, changes to isa<Constant> implementation


---
Diffs of the changes:  (+4 -7)

Index: llvm/include/llvm/Constant.h
diff -u llvm/include/llvm/Constant.h:1.14 llvm/include/llvm/Constant.h:1.15
--- llvm/include/llvm/Constant.h:1.14	Sat Jul 17 18:26:12 2004
+++ llvm/include/llvm/Constant.h	Sun Jul 18 19:58:02 2004
@@ -20,7 +20,7 @@
 
 class Constant : public User {
 protected:
-  inline Constant(const Type *Ty, ValueTy vty = Value::ConstantVal, 
+  inline Constant(const Type *Ty, ValueTy vty = Value::SimpleConstantVal, 
 	          const std::string& Name = "" ) 
   : User(Ty, vty, Name) {}
   ~Constant() {}
@@ -40,11 +40,6 @@
 
   virtual void print(std::ostream &O) const;
 
-  /// isConstantExpr - Return true if this is a ConstantExpr
-  ///
-  virtual bool isConstantExpr() const { return false; }
-
-
   /// destroyConstant - Called if some element of this constant is no longer
   /// valid.  At this point only other constants may be on the use_list for this
   /// constant.  Any constants on our Use list must also be destroy'd.  The
@@ -59,7 +54,9 @@
   static inline bool classof(const Constant *) { return true; }
   static inline bool classof(const GlobalValue *) { return true; }
   static inline bool classof(const Value *V) {
-    return V->getValueType() == Value::ConstantVal ||
+    return V->getValueType() == Value::SimpleConstantVal ||
+           V->getValueType() == Value::ConstantExprVal ||
+           V->getValueType() == Value::ConstantAggregateZeroVal ||
 	   V->getValueType() == Value::FunctionVal ||
 	   V->getValueType() == Value::GlobalVariableVal;
   }





More information about the llvm-commits mailing list