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

Reid Spencer reid at x10sys.com
Sat Dec 2 21:48:35 PST 2006



Changes in directory llvm/include/llvm:

Constants.h updated: 1.96 -> 1.97
---
Log message:

Implement creation of ICmp and FCmp constant expressions.


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

 Constants.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.96 llvm/include/llvm/Constants.h:1.97
--- llvm/include/llvm/Constants.h:1.96	Fri Dec  1 13:20:02 2006
+++ llvm/include/llvm/Constants.h	Sat Dec  2 23:48:19 2006
@@ -547,7 +547,6 @@
   /// @brief Return true if this is a convert constant expression
   bool isCast() const;
 
-
   /// Select constant expr
   ///
   static Constant *getSelect(Constant *C, Constant *V1, Constant *V2) {
@@ -591,6 +590,8 @@
   static Constant *getSetGT(Constant *C1, Constant *C2);
   static Constant *getSetLE(Constant *C1, Constant *C2);
   static Constant *getSetGE(Constant *C1, Constant *C2);
+  static Constant* getICmp(unsigned short pred, Constant* LHS, Constant* RHS);
+  static Constant* getFCmp(unsigned short pred, Constant* LHS, Constant* RHS);
   static Constant *getShl(Constant *C1, Constant *C2);
   static Constant *getLShr(Constant *C1, Constant *C2);
   static Constant *getAShr(Constant *C1, Constant *C2);
@@ -606,7 +607,7 @@
   static Constant *getExtractElement(Constant *Vec, Constant *Idx);
   static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx);
   static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask);
-  
+
   /// isNullValue - Return true if this is the value that would be returned by
   /// getNullValue.
   virtual bool isNullValue() const { return false; }
@@ -614,6 +615,10 @@
   /// getOpcode - Return the opcode at the root of this constant expression
   unsigned getOpcode() const { return SubclassData; }
 
+  /// getPredicate - Return the ICMP or FCMP predicate value. Assert if this is
+  /// not an ICMP or FCMP constant expression.
+  unsigned getPredicate() const;
+
   /// getOpcodeName - Return a string representation for an opcode.
   const char *getOpcodeName() const;
 






More information about the llvm-commits mailing list