aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ValueState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/ValueState.cpp')
-rw-r--r--lib/Analysis/ValueState.cpp119
1 files changed, 0 insertions, 119 deletions
diff --git a/lib/Analysis/ValueState.cpp b/lib/Analysis/ValueState.cpp
index 23c93ae1d6..cc77edc826 100644
--- a/lib/Analysis/ValueState.cpp
+++ b/lib/Analysis/ValueState.cpp
@@ -258,125 +258,6 @@ ValueState* ValueStateManager::AddEQ(ValueState* St, SymbolID sym,
return getPersistentState(NewSt);
}
-// FIXME: This should all go into the environment.
-RVal ValueStateManager::GetRVal(ValueState* St, Expr* E) {
-
- for (;;) {
-
- switch (E->getStmtClass()) {
-
- case Stmt::AddrLabelExprClass:
- return LVal::MakeVal(cast<AddrLabelExpr>(E));
-
- // ParenExprs are no-ops.
-
- case Stmt::ParenExprClass:
- E = cast<ParenExpr>(E)->getSubExpr();
- continue;
-
- case Stmt::CharacterLiteralClass: {
- CharacterLiteral* C = cast<CharacterLiteral>(E);
- return NonLVal::MakeVal(BasicVals, C->getValue(), C->getType());
- }
-
- case Stmt::IntegerLiteralClass: {
- return NonLVal::MakeVal(BasicVals, cast<IntegerLiteral>(E));
- }
-
- case Stmt::StringLiteralClass:
- return LVal::MakeVal(cast<StringLiteral>(E));
-
- // Casts where the source and target type are the same
- // are no-ops. We blast through these to get the descendant
- // subexpression that has a value.
-
- case Stmt::ImplicitCastExprClass: {
- ImplicitCastExpr* C = cast<ImplicitCastExpr>(E);
- QualType CT = C->getType();
-
- if (CT->isVoidType())
- return UnknownVal();
-
- QualType ST = C->getSubExpr()->getType();
-
- break;
- }
-
- case Stmt::CastExprClass: {
- CastExpr* C = cast<CastExpr>(E);
- QualType CT = C->getType();
- QualType ST = C->getSubExpr()->getType();
-
- if (CT->isVoidType())
- return UnknownVal();
-
- break;
- }
-
- // Handle all other Expr* using a lookup.
-
- default:
- break;
- };
-
- break;
- }
-
- return St->LookupExpr(E);
-}
-
-RVal ValueStateManager::GetBlkExprRVal(ValueState* St, Expr* E) {
-
- E = E->IgnoreParens();
-
- switch (E->getStmtClass()) {
- case Stmt::CharacterLiteralClass: {
- CharacterLiteral* C = cast<CharacterLiteral>(E);
- return NonLVal::MakeVal(BasicVals, C->getValue(), C->getType());
- }
-
- case Stmt::IntegerLiteralClass: {
- return NonLVal::MakeVal(BasicVals, cast<IntegerLiteral>(E));
- }
-
- default:
- return St->getEnvironment().LookupBlkExpr(E);
- }
-}
-
-ValueState*
-ValueStateManager::SetRVal(ValueState* St, Expr* E, RVal V,
- bool isBlkExpr, bool Invalidate) {
-
- assert (E);
-
- if (V.isUnknown()) {
-
- if (Invalidate) {
-
- ValueState NewSt = *St;
-
- if (isBlkExpr)
- NewSt.Env = EnvMgr.RemoveBlkExpr(NewSt.Env, E);
- else
- NewSt.Env = EnvMgr.RemoveSubExpr(NewSt.Env, E);
-
- return getPersistentState(NewSt);
- }
-
- return St;
- }
-
- ValueState NewSt = *St;
-
- if (isBlkExpr)
- NewSt.Env = EnvMgr.AddBlkExpr(NewSt.Env, E, V);
- else
- NewSt.Env = EnvMgr.AddSubExpr(NewSt.Env, E, V);
-
- return getPersistentState(NewSt);
-}
-
ValueState* ValueStateManager::SetRVal(ValueState* St, LVal LV, RVal V) {