summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-12-01 05:57:37 +0000
committerAnna Zaks <ganna@apple.com>2011-12-01 05:57:37 +0000
commitc6aa531a8f89d5b671aea57576f40b205784b530 (patch)
tree54dc487bfe8c2bc259c7bcfe5f4283c7cb2d12a2 /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parent24fc93a9400253253587dda239a287197ee47365 (diff)
downloadbcm5719-llvm-c6aa531a8f89d5b671aea57576f40b205784b530.tar.gz
bcm5719-llvm-c6aa531a8f89d5b671aea57576f40b205784b530.zip
[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. llvm-svn: 145576
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index f217df9309d..dd919e3a9b0 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -128,11 +128,7 @@ namespace ento {
}
bool MallocChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
- const ProgramState *state = C.getState();
- const Expr *Callee = CE->getCallee();
- SVal L = state->getSVal(Callee);
-
- const FunctionDecl *FD = L.getAsFunctionDecl();
+ const FunctionDecl *FD = C.getCalleeDecl(CE);
if (!FD)
return false;
OpenPOWER on IntegriCloud