diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-02-05 00:26:40 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-02-05 00:26:40 +0000 |
commit | f233d48cfc513b045e2c2cfca5c175220fbd0a82 (patch) | |
tree | 5467ff1a18f8ea61ee6923aa60efa49504043632 /Analysis/ValueState.cpp | |
parent | f66ea2cd833253f5c79b68eea1c9f283a91979b5 (diff) |
Implemented initial transfer function support for '&&', '||', '?', and
__builtin_choose.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Analysis/ValueState.cpp')
-rw-r--r-- | Analysis/ValueState.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Analysis/ValueState.cpp b/Analysis/ValueState.cpp index de286ae8cb..f323fd4f90 100644 --- a/Analysis/ValueState.cpp +++ b/Analysis/ValueState.cpp @@ -16,7 +16,7 @@ RValue ValueStateManager::GetValue(const StateTy& St, const LValue& LV) { return InvalidValue(); } -RValue ValueStateManager::GetValue(const StateTy& St, Stmt* S) { +RValue ValueStateManager::GetValue(const StateTy& St, Stmt* S, bool* hasVal) { for (;;) { switch (S->getStmtClass()) { @@ -73,7 +73,14 @@ RValue ValueStateManager::GetValue(const StateTy& St, Stmt* S) { StateTy::TreeTy* T = St.SlimFind(S); - return T ? T->getValue().second : InvalidValue(); + if (T) { + if (hasVal) *hasVal = true; + return T->getValue().second; + } + else { + if (hasVal) *hasVal = false; + return InvalidValue(); + } } LValue ValueStateManager::GetLValue(const StateTy& St, Stmt* S) { |