summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-17 01:54:00 +0000
committerChris Lattner <sabre@nondot.org>2005-08-17 01:54:00 +0000
commit40f909ad0428740fb0ea4b05945bcbbea44d0f4c (patch)
tree5c7d3c658267bd01dc8b8e7275000d32e05e0e9b /llvm
parent63f774ec6ed91ccd61c7b68678484f257c6af621 (diff)
downloadbcm5719-llvm-40f909ad0428740fb0ea4b05945bcbbea44d0f4c.tar.gz
bcm5719-llvm-40f909ad0428740fb0ea4b05945bcbbea44d0f4c.zip
make sure to remove a node from the use list of its operands when we replace
it. llvm-svn: 22820
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/SelectionDAGNodes.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
index 00b94037ad2..930a163848e 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -614,7 +614,14 @@ protected:
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) {
OpenPOWER on IntegriCloud