]> granicus.if.org Git - clang/commit
Correctly emit certain implicit references to 'self' even within
authorJohn McCall <rjmccall@apple.com>
Fri, 3 May 2013 07:33:41 +0000 (07:33 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 3 May 2013 07:33:41 +0000 (07:33 +0000)
commitf5ebf9bf1df10ac15ba32a4b24dfe171b7848c58
treeb992749c6b861c9c330b77a12113bda06f3b6908
parent2faee99ab67105e834d11df7db80a78a3e3ed37b
Correctly emit certain implicit references to 'self' even within
a lambda.

Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation
functions.  Fix that by generally improving getNonClosureContext
to look through lambdas and captured statements but only report
code contexts, which is generally what's wanted.  Audit uses of
CurFuncDecl and getNonClosureAncestor for correctness.

Bug #2 is that lambdas weren't specially mapping 'self' when inside
an ObjC method.  Fix that by removing the requirement for that
and using the normal EmitDeclRefLValue path in LoadObjCSelf.

rdar://13800041

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181000 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/AST/DeclBase.h
lib/AST/DeclBase.cpp
lib/CodeGen/CGBlocks.cpp
lib/CodeGen/CGCall.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGObjC.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h
lib/Sema/SemaExprObjC.cpp
test/CodeGenObjC/debug-info-block-captured-self.m
test/CodeGenObjC/debug-info-blocks.m
test/CodeGenObjCXX/lambda-expressions.mm