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

Chris Lattner lattner at cs.uiuc.edu
Mon Oct 11 15:52:18 PDT 2004



Changes in directory llvm/include/llvm:

Constants.h updated: 1.57 -> 1.58
---
Log message:

Allow creation of GEP constantexprs with a vector of value* operands as
well as a vector of constant*'s.  It turns out that this is more efficient
and all of the clients want to do that, so we should cater to them.


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

Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.57 llvm/include/llvm/Constants.h:1.58
--- llvm/include/llvm/Constants.h:1.57	Wed Sep  1 17:55:34 2004
+++ llvm/include/llvm/Constants.h	Mon Oct 11 17:52:01 2004
@@ -533,7 +533,7 @@
   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);
+                                      const std::vector<Value*> &IdxList);
   
 public:
   // Static methods to construct a ConstantExpr of different kinds.  Note that
@@ -584,10 +584,13 @@
   static Constant *getUShr(Constant *C1, Constant *C2); // unsigned shr
   static Constant *getSShr(Constant *C1, Constant *C2); // signed shr
 
-  /// Getelementptr form...
+  /// Getelementptr form.  std::vector<Value*> is only accepted for convenience:
+  /// all elements must be Constant's.
   ///
   static Constant *getGetElementPtr(Constant *C,
                                     const std::vector<Constant*> &IdxList);
+  static Constant *getGetElementPtr(Constant *C,
+                                    const std::vector<Value*> &IdxList);
   
   /// isNullValue - Return true if this is the value that would be returned by
   /// getNullValue.






More information about the llvm-commits mailing list