]> granicus.if.org Git - clang/commitdiff
Added some comments.
authorTed Kremenek <kremenek@apple.com>
Tue, 5 Feb 2008 18:24:17 +0000 (18:24 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 5 Feb 2008 18:24:17 +0000 (18:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46756 91177308-0d34-0410-b5e6-96231b3b80d8

Analysis/ValueState.h

index bd2bc7033959114618b556b2c3cda7062c118a24..57d80e90ccd70c4b52a672cbf4eddea2b416b4bb 100644 (file)
@@ -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: