diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-10 18:56:35 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-10 18:56:35 +0000 |
commit | 0339d72d7f853d90088a4d8639fb50810533e791 (patch) | |
tree | 33a70fca9b9a1ac74c474261f5e9033624d1bba7 /lib/CodeGen/CGExprCXX.cpp | |
parent | 3c0a78d2d028cdec935a7902728b0e2cf2b78eb5 (diff) |
IRGen fix for using property-dot syntax to pass
reference object to a c++ member function.
fixes radar 8409336.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGExprCXX.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index 9a98281771..acdbe06556 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -100,7 +100,15 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE, This = EmitScalarExpr(ME->getBase()); else { LValue BaseLV = EmitLValue(ME->getBase()); - This = BaseLV.getAddress(); + if (BaseLV.isPropertyRef() || BaseLV.isKVCRef()) { + QualType QT = ME->getBase()->getType(); + RValue RV = + BaseLV.isPropertyRef() ? EmitLoadOfPropertyRefLValue(BaseLV, QT) + : EmitLoadOfKVCRefLValue(BaseLV, QT); + This = RV.isScalar() ? RV.getScalarVal() : RV.getAggregateAddr(); + } + else + This = BaseLV.getAddress(); } if (MD->isTrivial()) { |