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

Chris Lattner lattner at cs.uiuc.edu
Thu Mar 11 23:52:00 PST 2004


Changes in directory llvm/include/llvm:

Constants.h updated: 1.43 -> 1.44

---
Log message:

Add support for select constant exprs


---
Diffs of the changes:  (+11 -0)

Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.43 llvm/include/llvm/Constants.h:1.44
--- llvm/include/llvm/Constants.h:1.43	Sat Feb 14 23:52:14 2004
+++ llvm/include/llvm/Constants.h	Thu Mar 11 23:50:39 2004
@@ -518,6 +518,8 @@
   ConstantExpr(unsigned Opcode, Constant *C, const Type *Ty);
   // Binary/Shift instruction creation ctor
   ConstantExpr(unsigned Opcode, Constant *C1, Constant *C2);
+  // Select instruction creation ctor
+  ConstantExpr(Constant *C, Constant *V1, Constant *V2);
   // GEP instruction creation ctor
   ConstantExpr(Constant *C, const std::vector<Constant*> &IdxList,
                const Type *DestTy);
@@ -528,6 +530,8 @@
                          Constant *C1, Constant *C2);
   static Constant *getShiftTy(const Type *Ty,
                               unsigned Opcode, Constant *C1, Constant *C2);
+  static Constant *getSelectTy(const Type *Ty,
+                               Constant *C1, Constant *C2, Constant *C3);
   static Constant *getGetElementPtrTy(const Type *Ty, Constant *C,
                                       const std::vector<Constant*> &IdxList);
   
@@ -540,6 +544,13 @@
   /// Cast constant expr
   ///
   static Constant *getCast(Constant *C, const Type *Ty);
+
+  /// Select constant expr
+  ///
+  static Constant *getSelect(Constant *C, Constant *V1, Constant *V2) {
+    return getSelectTy(V1->getType(), C, V1, V2);
+  }
+
 
   /// ConstantExpr::get - Return a binary or shift operator constant expression,
   /// folding if possible.





More information about the llvm-commits mailing list