- static Constant *get(ArrayRef<uint8_t> Elts, LLVMContext &Context);
- static Constant *get(ArrayRef<uint16_t> Elts, LLVMContext &Context);
- static Constant *get(ArrayRef<uint32_t> Elts, LLVMContext &Context);
- static Constant *get(ArrayRef<uint64_t> Elts, LLVMContext &Context);
- static Constant *get(ArrayRef<float> Elts, LLVMContext &Context);
- static Constant *get(ArrayRef<double> Elts, LLVMContext &Context);
-
+ static Constant *get(LLVMContext &Context, ArrayRef<uint8_t> Elts);
+ static Constant *get(LLVMContext &Context, ArrayRef<uint16_t> Elts);
+ static Constant *get(LLVMContext &Context, ArrayRef<uint32_t> Elts);
+ static Constant *get(LLVMContext &Context, ArrayRef<uint64_t> Elts);
+ static Constant *get(LLVMContext &Context, ArrayRef<float> Elts);
+ static Constant *get(LLVMContext &Context, ArrayRef<double> Elts);
+
+ /// getSplat - Return a ConstantVector with the specified constant in each
+ /// element. The specified constant has to be a of a compatible type (i8/i16/
+ /// i32/i64/float/double) and must be a ConstantFP or ConstantInt.
+ static Constant *getSplat(unsigned NumElts, Constant *Elt);
+
+ /// getSplatValue - If this is a splat constant, meaning that all of the
+ /// elements have the same value, return that value. Otherwise return NULL.
+ Constant *getSplatValue() const;
+