aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 03efbc9ad5..01a5514d6e 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -797,12 +797,13 @@ EmitExtVectorElementExpr(const ExtVectorElementExpr *E) {
LValue Base;
// ExtVectorElementExpr's base can either be a vector or pointer to vector.
- if (const PointerType *PT = E->getBase()->getType()->getAsPointerType()) {
- llvm::Value *Ptr = EmitScalarExpr(E->getBase());
- Base = LValue::MakeAddr(Ptr, PT->getPointeeType().getCVRQualifiers());
- } else {
+ if (!E->isArrow()) {
assert(E->getBase()->getType()->isVectorType());
Base = EmitLValue(E->getBase());
+ } else {
+ const PointerType *PT = E->getBase()->getType()->getAsPointerType();
+ llvm::Value *Ptr = EmitScalarExpr(E->getBase());
+ Base = LValue::MakeAddr(Ptr, PT->getPointeeType().getCVRQualifiers());
}
// Encode the element access list into a vector of unsigned indices.