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

Chris Lattner lattner at cs.uiuc.edu
Wed Apr 16 17:41:01 PDT 2003


Changes in directory llvm/include/llvm:

Constants.h updated: 1.20 -> 1.21

---
Log message:

Change the interface to constant expressions to allow automatic folding


---
Diffs of the changes:

Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.20 llvm/include/llvm/Constants.h:1.21
--- llvm/include/llvm/Constants.h:1.20	Mon Mar 10 16:39:01 2003
+++ llvm/include/llvm/Constants.h	Wed Apr 16 17:40:43 2003
@@ -476,17 +476,19 @@
   ~ConstantExpr() {}
   
 public:
-  // Static methods to construct a ConstantExpr of different kinds.
+  // Static methods to construct a ConstantExpr of different kinds.  Note that
+  // these methods can return a constant of an arbitrary type, because they will
+  // attempt to fold the constant expression into something simple if they can.
   
   /// Cast constant expr
-  static ConstantExpr *getCast(Constant *C, const Type *Ty);
+  static Constant *getCast(Constant *C, const Type *Ty);
 
   /// Binary constant expr - Use with binary operators...
-  static ConstantExpr *get(unsigned Opcode, Constant *C1, Constant *C2);
+  static Constant *get(unsigned Opcode, Constant *C1, Constant *C2);
 
   /// Getelementptr form...
-  static ConstantExpr *getGetElementPtr(Constant *C,
-                                        const std::vector<Constant*> &IdxList);
+  static Constant *getGetElementPtr(Constant *C,
+                                    const std::vector<Constant*> &IdxList);
   
   /// isNullValue - Return true if this is the value that would be returned by
   /// getNullValue.





More information about the llvm-commits mailing list