diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-11 02:29:48 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-11 02:29:48 +0000 |
commit | 3f5a85ad062e341ecf9a9ed459406e76390c032c (patch) | |
tree | 410368a06ff5b968c425c1b5a5505a3cc9ab21cc /clang/lib/Analysis/SimpleConstraintManager.cpp | |
parent | 44c12ef6151d285996e24afcb4e49decf38375ee (diff) | |
download | bcm5719-llvm-3f5a85ad062e341ecf9a9ed459406e76390c032c.tar.gz bcm5719-llvm-3f5a85ad062e341ecf9a9ed459406e76390c032c.zip |
SimpleConstraintManager doesn't reason about bitwise-constraints on symbolic
values. Indicating this in 'canReasonAbout' allows GRExprEngine to recover
path-sensitivity in some cases.
llvm-svn: 66628
Diffstat (limited to 'clang/lib/Analysis/SimpleConstraintManager.cpp')
-rw-r--r-- | clang/lib/Analysis/SimpleConstraintManager.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Analysis/SimpleConstraintManager.cpp b/clang/lib/Analysis/SimpleConstraintManager.cpp index 82cc0bb7bc2..a4d59bec887 100644 --- a/clang/lib/Analysis/SimpleConstraintManager.cpp +++ b/clang/lib/Analysis/SimpleConstraintManager.cpp @@ -21,6 +21,19 @@ namespace clang { SimpleConstraintManager::~SimpleConstraintManager() {} bool SimpleConstraintManager::canReasonAbout(SVal X) const { + if (nonloc::SymIntConstraintVal *Y = dyn_cast<nonloc::SymIntConstraintVal>(&X)) { + const SymIntConstraint& C = Y->getConstraint(); + switch (C.getOpcode()) { + // We don't reason yet about bitwise-constraints on symbolic values. + case BinaryOperator::And: + case BinaryOperator::Or: + case BinaryOperator::Xor: + return false; + default: + return true; + } + } + return true; } |