aboutsummaryrefslogtreecommitdiff
path: root/Analysis/GRConstants.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-02-01 06:36:40 +0000
committerTed Kremenek <kremenek@apple.com>2008-02-01 06:36:40 +0000
commita6e4d21dc4fe87fe1b0bcd9c3c3ec43b391aa44b (patch)
treeee3dcb264d22403333814afea23267c973820a05 /Analysis/GRConstants.cpp
parent9415a0cc93117b69add4e1dc0f11146f3479ee1a (diff)
Implemented casts for ConcreteInt and ConcreteIntLValue.
Implemented '==' and '!=' for ConcreteIntLValue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Analysis/GRConstants.cpp')
-rw-r--r--Analysis/GRConstants.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/Analysis/GRConstants.cpp b/Analysis/GRConstants.cpp
index 2229e473ef..895f0e1025 100644
--- a/Analysis/GRConstants.cpp
+++ b/Analysis/GRConstants.cpp
@@ -778,7 +778,22 @@ void GRConstants::Visit(Stmt* S, GRConstants::NodeTy* Pred,
GRConstants::StateTy GRConstants::Assume(StateTy St, LValue Cond, bool Assumption,
bool& isFeasible) {
- return St;
+
+ switch (Cond.getSubKind()) {
+ default:
+ assert (false && "'Assume' not implemented for this NonLValue.");
+ return St;
+
+ case LValueDeclKind:
+ isFeasible = Assumption;
+ return St;
+
+ case ConcreteIntLValueKind: {
+ bool b = cast<ConcreteIntLValue>(Cond).getValue() != 0;
+ isFeasible = b ? Assumption : !Assumption;
+ return St;
+ }
+ }
}
GRConstants::StateTy GRConstants::Assume(StateTy St, NonLValue Cond, bool Assumption,