diff options
author | Anna Zaks <ganna@apple.com> | 2011-12-01 05:57:37 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-12-01 05:57:37 +0000 |
commit | b805c8ff133ef0c62df032fa711d6b13c5afd7f4 (patch) | |
tree | 79e10913c825cdf113d9267320edc29decaaf4aa /lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp | |
parent | a078ecf3484d62b01d9f8c01e0fecffd65c583e1 (diff) |
[analyzer] Refactor checkers to use helper function for getting callee Decl and name.
We are getting name of the called function or it's declaration in a few checkers. Refactor them to use the helper function in the CheckerContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp index bc6e8f303f..1f627297ec 100644 --- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -249,11 +249,8 @@ static const char* GetCFNumberTypeStr(uint64_t i) { void CFNumberCreateChecker::checkPreStmt(const CallExpr *CE, CheckerContext &C) const { - const Expr *Callee = CE->getCallee(); const ProgramState *state = C.getState(); - SVal CallV = state->getSVal(Callee); - const FunctionDecl *FD = CallV.getAsFunctionDecl(); - + const FunctionDecl *FD = C.getCalleeDecl(CE); if (!FD) return; @@ -363,11 +360,8 @@ void CFRetainReleaseChecker::checkPreStmt(const CallExpr *CE, if (CE->getNumArgs() != 1) return; - // Get the function declaration of the callee. const ProgramState *state = C.getState(); - SVal X = state->getSVal(CE->getCallee()); - const FunctionDecl *FD = X.getAsFunctionDecl(); - + const FunctionDecl *FD = C.getCalleeDecl(CE); if (!FD) return; |