diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-28 17:38:28 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-28 17:38:28 +0000 |
commit | 9e809e7da2448c08aa11f15be4680226754678ce (patch) | |
tree | 80da38d384657efa4f61e14563f8296541f7999d /lib/CodeGen/CGExpr.cpp | |
parent | 227aad58cc46c15dfc3fee2244d4a56d8c003d8f (diff) |
More work toward data member access ir-gen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 48f69e4ca4..b0e091bd0a 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -993,6 +993,16 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { if (PTy->getPointeeType()->isUnionType()) isUnion = true; CVRQualifiers = PTy->getPointeeType().getCVRQualifiers(); + if (CXXThisExpr *ThisExpr = dyn_cast<CXXThisExpr>(BaseExpr)) { + QualType ClassTy = ThisExpr->getType(); + ClassTy = ClassTy->getPointeeType(); + CXXRecordDecl *ClassDecl = + cast<CXXRecordDecl>(ClassTy->getAsRecordType()->getDecl()); + FieldDecl *Field = dyn_cast<FieldDecl>(E->getMemberDecl()); + CXXRecordDecl *BaseClassDecl = + cast<CXXRecordDecl>(Field->getDeclContext()); + BaseValue = AddressCXXOfBaseClass(BaseValue, ClassDecl, BaseClassDecl); + } } else if (isa<ObjCPropertyRefExpr>(BaseExpr) || isa<ObjCKVCRefExpr>(BaseExpr)) { RValue RV = EmitObjCPropertyGet(BaseExpr); |