diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-10-26 21:58:25 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-10-26 21:58:25 +0000 |
commit | 52f08bcbb81c750ed62b53ed0b34aff16143b877 (patch) | |
tree | 7815f4eb19076c42b4ccbdc111c3d2351a222dc0 /lib/CodeGen/CGExpr.cpp | |
parent | 06bc9bcc705e5fee714d4b00c3c3c9f01715c195 (diff) |
Add Code gen support for '->*' operator which fell
through the crack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index ca0d4b7c60..cf2a88903b 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1378,7 +1378,8 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { return EmitLValue(E->getRHS()); } - if (E->getOpcode() == BinaryOperator::PtrMemD) + if (E->getOpcode() == BinaryOperator::PtrMemD || + E->getOpcode() == BinaryOperator::PtrMemI) return EmitPointerToDataMemberBinaryExpr(E); // Can only get l-value for binary operator expressions which are a @@ -1567,6 +1568,8 @@ RValue CodeGenFunction::EmitCall(llvm::Value *Callee, QualType CalleeType, LValue CodeGenFunction::EmitPointerToDataMemberBinaryExpr( const BinaryOperator *E) { llvm::Value *BaseV = EmitLValue(E->getLHS()).getAddress(); + if (E->getOpcode() == BinaryOperator::PtrMemI) + BaseV = Builder.CreateLoad(BaseV, "indir.ptr"); const llvm::Type *i8Ty = llvm::Type::getInt8PtrTy(getLLVMContext()); BaseV = Builder.CreateBitCast(BaseV, i8Ty); LValue RHSLV = EmitLValue(E->getRHS()); |