diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-16 22:14:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-16 22:14:05 +0000 |
commit | 2140e904dbe53657339cb5b1cc13de563ca0d1fc (patch) | |
tree | 592612dec4e107f73a4a11ec4118f8a9695b1419 /lib/CodeGen/CGExpr.cpp | |
parent | 225dfd7d6b0ed14e6b7ad8dc121161b9f34ecfce (diff) |
introduce and use a new ExtVectorElementExpr::isArrow method, at Eli's suggestion
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 9 |
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. |