[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h

Chris Lattner lattner at cs.uiuc.edu
Tue Aug 16 18:54:12 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGNodes.h updated: 1.52 -> 1.53
---
Log message:

make sure to remove a node from the use list of its operands when we replace
it.


---
Diffs of the changes:  (+8 -1)

 SelectionDAGNodes.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.52 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.53
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.52	Tue Aug 16 19:33:30 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Tue Aug 16 20:54:00 2005
@@ -614,7 +614,14 @@
   void MorphNodeTo(unsigned Opc) {
     NodeType = Opc;
     Values.clear();
-    Operands.clear();
+    
+    // Clear the operands list, updating used nodes to remove this from their
+    // use list.
+    while (!Operands.empty()) {
+      SDNode *O = Operands.back().Val;
+      Operands.pop_back();
+      O->removeUser(this);
+    }
   }
   
   void setValueTypes(MVT::ValueType VT) {






More information about the llvm-commits mailing list