diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-17 01:54:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-17 01:54:00 +0000 |
commit | b467f8af4125471361468ab91dbedba2abf2e09a (patch) | |
tree | 002cd4e6ae85814ee78f431b992c3d372848a506 /include/llvm/CodeGen/SelectionDAGNodes.h | |
parent | 6d9aed4f8febdf24d60fde175747ca6df289dfd9 (diff) |
make sure to remove a node from the use list of its operands when we replace
it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 00b94037ad..930a163848 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/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) { |