summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
diff options
context:
space:
mode:
authorGabor Horvath <xazax.hun@gmail.com>2016-08-18 07:54:50 +0000
committerGabor Horvath <xazax.hun@gmail.com>2016-08-18 07:54:50 +0000
commit6ee4f905dce7c4fde389f8e06c89b463fcbf68ac (patch)
treeb1338c89d08bc8615c2e4aa710cd1a9196bc1e77 /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
parent3f675e38bdf31ed63859dbab6cd1a8ca342c31dc (diff)
downloadbcm5719-llvm-6ee4f905dce7c4fde389f8e06c89b463fcbf68ac.tar.gz
bcm5719-llvm-6ee4f905dce7c4fde389f8e06c89b463fcbf68ac.zip
[analyzer] Small cleanups when checkers retrieving statements from exploded
nodes. Differential Revision: https://reviews.llvm.org/D23550 llvm-svn: 279037
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
index 6bb072710f8..d445e91b0d6 100644
--- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
@@ -2418,12 +2418,7 @@ CFRefLeakReport::CFRefLeakReport(CFRefBug &D, const LangOptions &LOpts,
// FIXME: This will crash the analyzer if an allocation comes from an
// implicit call (ex: a destructor call).
// (Currently there are no such allocations in Cocoa, though.)
- const Stmt *AllocStmt = nullptr;
- ProgramPoint P = AllocNode->getLocation();
- if (Optional<CallExitEnd> Exit = P.getAs<CallExitEnd>())
- AllocStmt = Exit->getCalleeContext()->getCallSite();
- else
- AllocStmt = P.castAs<PostStmt>().getStmt();
+ const Stmt *AllocStmt = PathDiagnosticLocation::getStmt(AllocNode);
assert(AllocStmt && "Cannot find allocation statement");
PathDiagnosticLocation AllocLocation =
OpenPOWER on IntegriCloud