diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-07-30 20:22:09 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-07-30 20:22:09 +0000 |
commit | d563d3fb73879df7147b8a5302c3bf0e1402ba18 (patch) | |
tree | 4fa18655c4f5cf2bb0cf16f16f97d16dad8fbcc3 /lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | |
parent | a989aebecde3d2fd374b894e894a950b0bd9cf67 (diff) |
[analyzer] Only allow CallEvents to be created by CallEventManager.
This ensures that it is valid to reference-count any CallEvents, and we
won't accidentally try to reclaim a CallEvent that lives on the stack.
It also hides an ugly switch statement for handling CallExprs!
There should be no functionality change here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160986 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 488549c343..53656cf6a0 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -1975,8 +1975,11 @@ PathDiagnosticPiece *CFRefReportVisitor::VisitNode(const ExplodedNode *N, } else { assert(isa<ObjCMessageExpr>(S)); - ObjCMethodCall Call(cast<ObjCMessageExpr>(S), CurrSt, LCtx); - switch (Call.getMessageKind()) { + CallEventManager &Mgr = CurrSt->getStateManager().getCallEventManager(); + CallEventRef<ObjCMethodCall> Call + = Mgr.getObjCMethodCall(cast<ObjCMessageExpr>(S), CurrSt, LCtx); + + switch (Call->getMessageKind()) { case OCM_Message: os << "Method"; break; |