Remove the concept of a critical shadow node
authorChris Lattner <sabre@nondot.org>
Tue, 16 Apr 2002 20:39:23 +0000 (20:39 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 16 Apr 2002 20:39:23 +0000 (20:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2265 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DataStructure.h
include/llvm/Analysis/DataStructure/DataStructure.h

index dd51909a2dac23131bfa1c11b72993796704b32c..e619f6b36038e077a5a947bf09571c6fa024a183 100644 (file)
@@ -118,7 +118,7 @@ class DSNode {
   void operator=(const DSNode &); // DO NOT IMPLEMENT
 public:
   enum NodeTy {
-    NewNode, CallNode, ShadowNode, ArgNode, GlobalNode
+    NewNode, CallNode, ShadowNode, GlobalNode
   } NodeType;
 
   DSNode(enum NodeTy NT, const Type *T);
@@ -254,6 +254,9 @@ class CallDSNode : public DSNode {
   std::vector<PointerValSet> ArgLinks;
 public:
   CallDSNode(CallInst *CI);
+  ~CallDSNode() {
+    ArgLinks.clear();
+  }
 
   CallInst *getCall() const { return CI; }
 
@@ -315,21 +318,13 @@ private:
 // to.  When functions are integrated into each other, shadow nodes are
 // resolved.
 //
-// Shadow nodes may be marked as "critical" nodes when they are created.  This
-// mark indicates that the node is the result of a function call, the value
-// pointed to by an incoming argument, or the value pointed to by a global
-// variable [fixme todo].  Since it is not possible to know what these nodes
-// point to, given just the current context, they are marked "Critical" to avoid
-// having the shadow node merger eliminate them.
-//
 class ShadowDSNode : public DSNode {
   friend class FunctionDSGraph;
   Module *Mod;
   ShadowDSNode *ShadowParent;   // Nonnull if this is a synthesized node...
   std::vector<std::pair<const Type *, ShadowDSNode *> > SynthNodes;
-  bool CriticalNode;
 public:
-  ShadowDSNode(const Type *Ty, Module *M, bool Critical = false);
+  ShadowDSNode(const Type *Ty, Module *M);
   virtual std::string getCaption() const;
 
   // synthesizeNode - Create a new shadow node that is to be linked into this
@@ -337,9 +332,6 @@ public:
   //
   ShadowDSNode *synthesizeNode(const Type *Ty, FunctionRepBuilder *Rep);
 
-  bool isCriticalNode() const { return CriticalNode; }
-  void resetCriticalMark() { CriticalNode = false; }
-
   // isEquivalentTo - Return true if the nodes should be merged...
   virtual bool isEquivalentTo(DSNode *Node) const;
 
@@ -356,7 +348,7 @@ protected:
     if (ShadowParent)
       return new ShadowDSNode(getType(), Mod, ShadowParent);
     else
-      return new ShadowDSNode(getType(), Mod, CriticalNode);
+      return new ShadowDSNode(getType(), Mod);
   }
 };
 
index dd51909a2dac23131bfa1c11b72993796704b32c..e619f6b36038e077a5a947bf09571c6fa024a183 100644 (file)
@@ -118,7 +118,7 @@ class DSNode {
   void operator=(const DSNode &); // DO NOT IMPLEMENT
 public:
   enum NodeTy {
-    NewNode, CallNode, ShadowNode, ArgNode, GlobalNode
+    NewNode, CallNode, ShadowNode, GlobalNode
   } NodeType;
 
   DSNode(enum NodeTy NT, const Type *T);
@@ -254,6 +254,9 @@ class CallDSNode : public DSNode {
   std::vector<PointerValSet> ArgLinks;
 public:
   CallDSNode(CallInst *CI);
+  ~CallDSNode() {
+    ArgLinks.clear();
+  }
 
   CallInst *getCall() const { return CI; }
 
@@ -315,21 +318,13 @@ private:
 // to.  When functions are integrated into each other, shadow nodes are
 // resolved.
 //
-// Shadow nodes may be marked as "critical" nodes when they are created.  This
-// mark indicates that the node is the result of a function call, the value
-// pointed to by an incoming argument, or the value pointed to by a global
-// variable [fixme todo].  Since it is not possible to know what these nodes
-// point to, given just the current context, they are marked "Critical" to avoid
-// having the shadow node merger eliminate them.
-//
 class ShadowDSNode : public DSNode {
   friend class FunctionDSGraph;
   Module *Mod;
   ShadowDSNode *ShadowParent;   // Nonnull if this is a synthesized node...
   std::vector<std::pair<const Type *, ShadowDSNode *> > SynthNodes;
-  bool CriticalNode;
 public:
-  ShadowDSNode(const Type *Ty, Module *M, bool Critical = false);
+  ShadowDSNode(const Type *Ty, Module *M);
   virtual std::string getCaption() const;
 
   // synthesizeNode - Create a new shadow node that is to be linked into this
@@ -337,9 +332,6 @@ public:
   //
   ShadowDSNode *synthesizeNode(const Type *Ty, FunctionRepBuilder *Rep);
 
-  bool isCriticalNode() const { return CriticalNode; }
-  void resetCriticalMark() { CriticalNode = false; }
-
   // isEquivalentTo - Return true if the nodes should be merged...
   virtual bool isEquivalentTo(DSNode *Node) const;
 
@@ -356,7 +348,7 @@ protected:
     if (ShadowParent)
       return new ShadowDSNode(getType(), Mod, ShadowParent);
     else
-      return new ShadowDSNode(getType(), Mod, CriticalNode);
+      return new ShadowDSNode(getType(), Mod);
   }
 };