diff options
author | Gabor Horvath <xazax.hun@gmail.com> | 2016-08-18 07:54:50 +0000 |
---|---|---|
committer | Gabor Horvath <xazax.hun@gmail.com> | 2016-08-18 07:54:50 +0000 |
commit | 6ee4f905dce7c4fde389f8e06c89b463fcbf68ac (patch) | |
tree | b1338c89d08bc8615c2e4aa710cd1a9196bc1e77 /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | |
parent | 3f675e38bdf31ed63859dbab6cd1a8ca342c31dc (diff) | |
download | bcm5719-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.cpp | 7 |
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 = |