Created ValueStateManager, a full-blown class to manage the states
created for GRConstants. Moved instances of ValueManager and SymbolManager
inside this class. The goal is to gradually separate more of the state
management from the state transformation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46721 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/ValueState.h b/Analysis/ValueState.h
index ef9f89a..2af3585 100644
--- a/Analysis/ValueState.h
+++ b/Analysis/ValueState.h
@@ -125,6 +125,42 @@
}
};
+
+class ValueStateManager {
+public:
+ typedef ValueState StateTy;
+
+private:
+ typedef ValueState::Factory FactoryTy;
+ FactoryTy Factory;
+
+ /// ValueMgr - Object that manages the data for all created RValues.
+ ValueManager ValMgr;
+
+ /// SymMgr - Object that manages the symbol information.
+ SymbolManager SymMgr;
+
+public:
+ ValueStateManager(ASTContext& Ctx) : ValMgr(Ctx) {}
+
+ StateTy getInitialState() {
+ return Factory.GetEmptyMap();
+ }
+
+ ValueManager& getValueManager() { return ValMgr; }
+ SymbolManager& getSymbolManager() { return SymMgr; }
+
+ StateTy SetValue(StateTy St, Stmt* S, bool isBlkExpr, const RValue& V);
+ StateTy SetValue(StateTy St, const LValue& LV, const RValue& V);
+
+ RValue GetValue(const StateTy& St, Stmt* S);
+ RValue GetValue(const StateTy& St, const LValue& LV);
+ LValue GetLValue(const StateTy& St, Stmt* S);
+
+ StateTy Remove(StateTy St, ValueKey K);
+
+};
+
} // end clang namespace
//==------------------------------------------------------------------------==//