summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-01-06 22:09:28 +0000
committerTed Kremenek <kremenek@apple.com>2012-01-06 22:09:28 +0000
commit632e3b7ee23f75016795e7ee43422aeda42ba1a8 (patch)
treecfe8a7819b6405424cb03d02fd1a4257f62d1e37 /clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
parent5407920f82618114a66e92bf5dad280f42a4075c (diff)
downloadbcm5719-llvm-632e3b7ee23f75016795e7ee43422aeda42ba1a8.tar.gz
bcm5719-llvm-632e3b7ee23f75016795e7ee43422aeda42ba1a8.zip
[analyzer] Make the entries in 'Environment' context-sensitive by making entries map from
(Stmt*,LocationContext*) pairs to SVals instead of Stmt* to SVals. This is needed to support basic IPA via inlining. Without this, we cannot tell if a Stmt* binding is part of the current analysis scope (StackFrameContext) or part of a parent context. This change introduces an uglification of the use of getSVal(), and thus takes two steps forward and one step back. There are also potential performance implications of enlarging the Environment. Both can be addressed going forward by refactoring the APIs and optimizing the internal representation of Environment. This patch mainly introduces the functionality upon when we want to build upon (and clean up). llvm-svn: 147688
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CheckerContext.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CheckerContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp b/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
index 5552a991d15..3737ca54672 100644
--- a/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
@@ -19,7 +19,7 @@ using namespace ento;
const FunctionDecl *CheckerContext::getCalleeDecl(const CallExpr *CE) const {
const ProgramState *State = getState();
const Expr *Callee = CE->getCallee();
- SVal L = State->getSVal(Callee);
+ SVal L = State->getSVal(Callee, Pred->getLocationContext());
return L.getAsFunctionDecl();
}
OpenPOWER on IntegriCloud