aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-23 21:33:41 +0000
committerChris Lattner <sabre@nondot.org>2009-12-23 21:33:41 +0000
commit0ad57fb93ae53ac94ebcd247201f60d87600188f (patch)
tree5c02d390baa904e706c7f95e3d5f20399ce4a34f /lib/CodeGen
parent998eab186790b7246a572a9950174f7f36442c06 (diff)
simplify my previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGExpr.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 6b54d969f8..66831c293d 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -1215,17 +1215,10 @@ EmitExtVectorElementExpr(const ExtVectorElementExpr *E) {
assert(VT && "Result must be a vector");
llvm::Value *Vec = EmitScalarExpr(E->getBase());
- // Store the vector to memory (because LValue wants an address) and use an
- // index list of 0,1,2,3 which is the full vector.
+ // Store the vector to memory (because LValue wants an address).
llvm::Value *VecMem =CreateTempAlloca(ConvertType(E->getBase()->getType()));
Builder.CreateStore(Vec, VecMem);
-
- llvm::SmallVector<llvm::Constant *, 4> CElts;
- for (unsigned i = 0, e = VT->getNumElements(); i != e; ++i)
- CElts.push_back(llvm::ConstantInt::get(Int32Ty, i));
-
- llvm::Constant *Elts = llvm::ConstantVector::get(&CElts[0], CElts.size());
- Base = LValue::MakeExtVectorElt(VecMem, Elts, 0);
+ Base = LValue::MakeAddr(VecMem, Qualifiers());
}
// Encode the element access list into a vector of unsigned indices.