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 | 23665a1bcfd465626848f1b5cf9c8a6a86c913b7 (patch) | |
| tree | 68f9bec16359cedefa0dbb32dce1820a798232c7 /clang/lib | |
| parent | aa4acdfdeef14211714650c96dae28cdd3fc4bd6 (diff) | |
| download | bcm5719-llvm-23665a1bcfd465626848f1b5cf9c8a6a86c913b7.tar.gz bcm5719-llvm-23665a1bcfd465626848f1b5cf9c8a6a86c913b7.zip | |
[analyzer] Teach live variable analyzes that super uses self pointer.
llvm-svn: 161822
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Analysis/LiveVariables.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index 584d81284e9..38f8199bffc 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/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())) { |

