aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-02-05 18:24:17 +0000
committerTed Kremenek <kremenek@apple.com>2008-02-05 18:24:17 +0000
commit6f886bd34b6da6e4a92246e573067f2fac048137 (patch)
tree0ed738fd95ba3ce9d96b520b671026b85b1038aa
parentb80cbfe31b14dc3df0a2df2b22f2463512761ac1 (diff)
Added some comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46756 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Analysis/ValueState.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/Analysis/ValueState.h b/Analysis/ValueState.h
index bd2bc70339..57d80e90cc 100644
--- a/Analysis/ValueState.h
+++ b/Analysis/ValueState.h
@@ -116,7 +116,11 @@ public:
namespace vstate {
typedef llvm::ImmutableMap<VarBindKey,RValue> VariableBindingsTy;
}
-
+
+/// ValueStateImpl - This class encapsulates the actual data values for
+/// for a "state" in our symbolic value tracking. It is intended to be
+/// used as a functional object; that is once it is created and made
+/// "persistent" in a FoldingSet its values will never change.
struct ValueStateImpl : public llvm::FoldingSetNode {
vstate::VariableBindingsTy VariableBindings;
@@ -124,7 +128,8 @@ struct ValueStateImpl : public llvm::FoldingSetNode {
: VariableBindings(VB) {}
ValueStateImpl(const ValueStateImpl& RHS)
- : llvm::FoldingSetNode(), VariableBindings(RHS.VariableBindings) {}
+ : llvm::FoldingSetNode(),
+ VariableBindings(RHS.VariableBindings) {}
static void Profile(llvm::FoldingSetNodeID& ID, const ValueStateImpl& V) {
@@ -137,6 +142,13 @@ struct ValueStateImpl : public llvm::FoldingSetNode {
};
+/// ValueState - This class represents a "state" in our symbolic value
+/// tracking. It is really just a "smart pointer", wrapping a pointer
+/// to ValueStateImpl object. Making this class a smart pointer means that its
+/// size is always the size of a pointer, which allows easy conversion to
+/// void* when being handled by GREngine. It also forces us to unique states;
+/// consequently, a ValueStateImpl* with a specific address will always refer
+/// to the unique state with those values.
class ValueState : public llvm::FoldingSetNode {
ValueStateImpl* Data;
public: