diff options
author | Craig Topper <craig.topper@gmail.com> | 2016-05-29 02:39:20 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2016-05-29 02:39:20 +0000 |
commit | 6cbd7a23a31be86f9f6f62c9cc9ee19468fe13d6 (patch) | |
tree | cc0cf6416dcbd97f51813eaf47db8cd9b5742bf2 /llvm/lib/IR/Constants.cpp | |
parent | ab3e10a7a0ed91f251a3dbc4df3ecfa58cb8bef5 (diff) | |
download | llvm-6cbd7a23a31be86f9f6f62c9cc9ee19468fe13d6.zip llvm-6cbd7a23a31be86f9f6f62c9cc9ee19468fe13d6.tar.gz llvm-6cbd7a23a31be86f9f6f62c9cc9ee19468fe13d6.tar.bz2 |
[IR] Teach the ArrayRef<int> form of IRBuilder::CreateShuffleVector to use ConstantDataVector.
This will be used in a follow up commit to simplify code in clang that creates a ConstantDataVector and calls the other form.
llvm-svn: 271164
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r-- | llvm/lib/IR/Constants.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index 35233ae..37cffe3 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -2500,6 +2500,11 @@ Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint32_t> Elts) const char *Data = reinterpret_cast<const char *>(Elts.data()); return getImpl(StringRef(const_cast<char *>(Data), Elts.size()*4), Ty); } +Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<int32_t> Elts){ + Type *Ty = VectorType::get(Type::getInt32Ty(Context), Elts.size()); + const char *Data = reinterpret_cast<const char *>(Elts.data()); + return getImpl(StringRef(const_cast<char *>(Data), Elts.size()*4), Ty); +} Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint64_t> Elts){ Type *Ty = VectorType::get(Type::getInt64Ty(Context), Elts.size()); const char *Data = reinterpret_cast<const char *>(Elts.data()); |