summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-11-03 02:54:16 +0000
committerAnna Zaks <ganna@apple.com>2012-11-03 02:54:16 +0000
commit44dc91b4df5d6e0264e9fd799ac8b473b25d0f32 (patch)
treee573bac6c856bcc414582611ea7f5b95196c4224 /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
parent2510608e81f3a316e49c80b89b53e66d455d7d43 (diff)
downloadbcm5719-llvm-44dc91b4df5d6e0264e9fd799ac8b473b25d0f32.tar.gz
bcm5719-llvm-44dc91b4df5d6e0264e9fd799ac8b473b25d0f32.zip
[analyzer] add LocationContext::inTopFrame() helper.
llvm-svn: 167351
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
index cc5cf635310..304051c1394 100644
--- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
@@ -3190,12 +3190,6 @@ bool RetainCountChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
// Handle return statements.
//===----------------------------------------------------------------------===//
-// Return true if the current LocationContext has no caller context.
-static bool inTopFrame(CheckerContext &C) {
- const LocationContext *LC = C.getLocationContext();
- return LC->getParent() == 0;
-}
-
void RetainCountChecker::checkPreStmt(const ReturnStmt *S,
CheckerContext &C) const {
@@ -3204,7 +3198,7 @@ void RetainCountChecker::checkPreStmt(const ReturnStmt *S,
// better checking even for inlined calls, and see if they match
// with their expected semantics (e.g., the method should return a retained
// object, etc.).
- if (!inTopFrame(C))
+ if (!C.inTopFrame())
return;
const Expr *RetE = S->getRetValue();
OpenPOWER on IntegriCloud