diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-07-26 20:15:14 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-07-26 20:15:14 +0000 |
| commit | 345f7209692b116ca433a3196c1e3c998e0ffcde (patch) | |
| tree | 0509f68064a5a6d35c0168a4f85fc44a66ce2f30 /lib/CodeGen/CGExprScalar.cpp | |
| parent | 611b2eccaf3869f32de51ecc02985426d1c0aaef (diff) | |
| download | clang-345f7209692b116ca433a3196c1e3c998e0ffcde.tar.gz clang-345f7209692b116ca433a3196c1e3c998e0ffcde.tar.bz2 clang-345f7209692b116ca433a3196c1e3c998e0ffcde.tar.xz | |
minor tidying, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 154e2628f6..37579c6da1 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -1176,7 +1176,6 @@ Value *CodeGenFunction::EmitComplexToScalarConversion(ComplexPairTy Src, Value *CodeGenFunction::EmitShuffleVector(Value* V1, Value *V2, ...) { assert(V1->getType() == V2->getType() && "Vector operands must be of the same type"); - unsigned NumElements = cast<llvm::VectorType>(V1->getType())->getNumElements(); @@ -1184,13 +1183,10 @@ Value *CodeGenFunction::EmitShuffleVector(Value* V1, Value *V2, ...) { va_start(va, V2); llvm::SmallVector<llvm::Constant*, 16> Args; - for (unsigned i = 0; i < NumElements; i++) { int n = va_arg(va, int); - assert(n >= 0 && n < (int)NumElements * 2 && "Vector shuffle index out of bounds!"); - Args.push_back(llvm::ConstantInt::get(llvm::Type::Int32Ty, n)); } @@ -1203,12 +1199,11 @@ Value *CodeGenFunction::EmitShuffleVector(Value* V1, Value *V2, ...) { } llvm::Value *CodeGenFunction::EmitVector(llvm::Value * const *Vals, - unsigned NumVals, bool isSplat) -{ + unsigned NumVals, bool isSplat) { llvm::Value *Vec - = llvm::UndefValue::get(llvm::VectorType::get(Vals[0]->getType(), NumVals)); + = llvm::UndefValue::get(llvm::VectorType::get(Vals[0]->getType(), NumVals)); - for (unsigned i = 0, e = NumVals ; i != e; ++i) { + for (unsigned i = 0, e = NumVals; i != e; ++i) { llvm::Value *Val = isSplat ? Vals[0] : Vals[i]; llvm::Value *Idx = llvm::ConstantInt::get(llvm::Type::Int32Ty, i); Vec = Builder.CreateInsertElement(Vec, Val, Idx, "tmp"); |
