summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-04-06 22:10:18 +0000
committerTed Kremenek <kremenek@apple.com>2012-04-06 22:10:18 +0000
commita85f38ba3a89ab2d3d3f6ebbe2bf14ee2618c45e (patch)
tree94525e6072584a8efef68a2eacb045694ed2a38c /clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
parentfeee554e3b4f4211ce608afbbadf7ca1860c9863 (diff)
downloadbcm5719-llvm-a85f38ba3a89ab2d3d3f6ebbe2bf14ee2618c45e.tar.gz
bcm5719-llvm-a85f38ba3a89ab2d3d3f6ebbe2bf14ee2618c45e.zip
Rework ExprEngine::evalLoad and clients (e.g. VisitBinaryOperator) so that when we generate a new ExplodedNode
we use the same Expr* as the one being currently visited. This is preparation for transitioning to having ProgramPoints refer to CFGStmts. This required a bit of trickery. We wish to keep the old Expr* bindings in the Environment intact, as plenty of logic relies on it and there is no reason to change it, but we sometimes want the Stmt* for the ProgramPoint to be different than the Expr* being used for bindings. This requires adding an extra argument for some functions (e.g., evalLocation). This looks a bit strange for some clients, but it will look a lot cleaner when were start using CFGStmt* in the appropriate places. As some fallout, the diagnostics arrows are a bit difference, since some of the node locations have changed. I have audited these, and they look reasonable. llvm-svn: 154214
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
index dc806c5463f..7b724d2be9b 100644
--- a/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
@@ -120,8 +120,8 @@ bool OSAtomicChecker::evalOSAtomicCompareAndSwap(const CallExpr *CE,
dyn_cast_or_null<TypedValueRegion>(location.getAsRegion())) {
LoadTy = TR->getValueType();
}
- Eng.evalLoad(Tmp, theValueExpr, Pred,
- state, location, &OSAtomicLoadTag, LoadTy);
+ Eng.evalLoad(Tmp, CE, theValueExpr, Pred,
+ state, location, &OSAtomicLoadTag, LoadTy);
if (Tmp.empty()) {
// If no nodes were generated, other checkers must have generated sinks.
@@ -172,8 +172,8 @@ bool OSAtomicChecker::evalOSAtomicCompareAndSwap(const CallExpr *CE,
val = svalBuilder.evalCast(val,R->getValueType(), newValueExpr->getType());
}
- Eng.evalStore(TmpStore, NULL, theValueExpr, N,
- stateEqual, location, val, &OSAtomicStoreTag);
+ Eng.evalStore(TmpStore, CE, theValueExpr, N,
+ stateEqual, location, val, &OSAtomicStoreTag);
if (TmpStore.empty()) {
// If no nodes were generated, other checkers must have generated sinks.
OpenPOWER on IntegriCloud