[llvm-commits] CVS: llvm/include/llvm/Analysis/DSNode.h

Chris Lattner lattner at cs.uiuc.edu
Fri Nov 1 18:12:01 PST 2002


Changes in directory llvm/include/llvm/Analysis:

DSNode.h updated: 1.2 -> 1.3

---
Log message:

* Eliminate Scalar node type (renumber other node types)
* Allow DSNodeHandle::mergeWith to work if a node handle isn't pointing to a node yet


---
Diffs of the changes:

Index: llvm/include/llvm/Analysis/DSNode.h
diff -u llvm/include/llvm/Analysis/DSNode.h:1.2 llvm/include/llvm/Analysis/DSNode.h:1.3
--- llvm/include/llvm/Analysis/DSNode.h:1.2	Thu Oct 31 15:24:10 2002
+++ llvm/include/llvm/Analysis/DSNode.h	Fri Nov  1 18:11:12 2002
@@ -62,13 +62,12 @@
 public:
   enum NodeTy {
     ShadowNode = 0,        // Nothing is known about this node...
-    ScalarNode = 1 << 0,   // Scalar of the current function contains this value
-    AllocaNode = 1 << 1,   // This node was allocated with alloca
-    NewNode    = 1 << 2,   // This node was allocated with malloc
-    GlobalNode = 1 << 3,   // This node was allocated by a global var decl
-    Incomplete = 1 << 4,   // This node may not be complete
-    Modified   = 1 << 5,   // This node is modified in this context
-    Read       = 1 << 6,   // This node is read in this context
+    AllocaNode = 1 << 0,   // This node was allocated with alloca
+    NewNode    = 1 << 1,   // This node was allocated with malloc
+    GlobalNode = 1 << 2,   // This node was allocated by a global var decl
+    Incomplete = 1 << 3,   // This node may not be complete
+    Modified   = 1 << 4,   // This node is modified in this context
+    Read       = 1 << 5,   // This node is read in this context
   };
   
   /// NodeType - A union of the above bits.  "Shadow" nodes do not add any flags
@@ -294,8 +293,11 @@
 /// pointed to by 'N'.
 ///
 inline void DSNodeHandle::mergeWith(const DSNodeHandle &Node) {
-  assert(N && "DSNodeHandle does not point to a node yet!");
-  N->mergeWith(Node, Offset);
+  if (N != 0)
+    N->mergeWith(Node, Offset);
+  else {   // No node to merge with, so just point to Node
+    *this = Node;
+  }
 }
 
 #endif





More information about the llvm-commits mailing list