diff options
author | Anna Zaks <ganna@apple.com> | 2012-08-14 00:36:20 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-08-14 00:36:20 +0000 |
commit | c739406d37b9b1dc95bc3a3d899024e5ce31e5d5 (patch) | |
tree | 8370bae29350df3100cfa3f00d1c13341621743b /lib/Analysis/LiveVariables.cpp | |
parent | c95bb76e85ff9a37de23821f713d947dcbc98f35 (diff) |
[analyzer] Teach live variable analyzes that super uses self pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | lib/Analysis/LiveVariables.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 584d81284e..38f8199bff 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -284,6 +284,14 @@ void TransferFunctions::Visit(Stmt *S) { } break; } + case Stmt::ObjCMessageExprClass: { + // In calls to super, include the implicit "self" pointer as being live. + ObjCMessageExpr *CE = cast<ObjCMessageExpr>(S); + if (CE->getReceiverKind() == ObjCMessageExpr::SuperInstance) + val.liveDecls = LV.DSetFact.add(val.liveDecls, + LV.analysisContext.getSelfDecl()); + break; + } case Stmt::DeclStmtClass: { const DeclStmt *DS = cast<DeclStmt>(S); if (const VarDecl *VD = dyn_cast<VarDecl>(DS->getSingleDecl())) { |