summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commitf0a9ba37d46144947c215482f033e110acca2c12 (patch)
treec62e1066b353fb3781aa4516adec5f8923f1d45e /clang/lib
parent4e1a323b85d5b0807e715ff3c2dd3c6e434975e8 (diff)
downloadbcm5719-llvm-f0a9ba37d46144947c215482f033e110acca2c12.tar.gz
bcm5719-llvm-f0a9ba37d46144947c215482f033e110acca2c12.zip
simplify my previous patch.
llvm-svn: 92057
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 6b54d969f8e..66831c293d6 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud