[cfe-commits] r46756 - /cfe/trunk/Analysis/ValueState.h
Ted Kremenek
kremenek at apple.com
Tue Feb 5 10:24:17 PST 2008
Author: kremenek
Date: Tue Feb 5 12:24:17 2008
New Revision: 46756
URL: http://llvm.org/viewvc/llvm-project?rev=46756&view=rev
Log:
Added some comments.
Modified:
cfe/trunk/Analysis/ValueState.h
Modified: cfe/trunk/Analysis/ValueState.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/ValueState.h?rev=46756&r1=46755&r2=46756&view=diff
==============================================================================
--- cfe/trunk/Analysis/ValueState.h (original)
+++ cfe/trunk/Analysis/ValueState.h Tue Feb 5 12:24:17 2008
@@ -116,7 +116,11 @@
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 @@
: 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 @@
};
+/// 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:
More information about the cfe-commits
mailing list