diff options
| author | David Greene <greened@obbligato.org> | 2010-01-20 20:13:31 +0000 |
|---|---|---|
| committer | David Greene <greened@obbligato.org> | 2010-01-20 20:13:31 +0000 |
| commit | cf495bc2e505e52ad018da55bed11c7b8bc97db5 (patch) | |
| tree | 97821c12347ff9b2b4c0d15c562fb14eeac1c289 /include/llvm/CodeGen/SelectionDAG.h | |
| parent | 1bc76d48d476446f226f06f0aced7efb268f2536 (diff) | |
When XDEBUG is enabled, check for SelectionDAG cycles at some key
points. This will help us find future problems like the one
described in PR6019.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAG.h')
| -rw-r--r-- | include/llvm/CodeGen/SelectionDAG.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index d55dd7f295..33ebd00720 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -63,6 +63,10 @@ enum CombineLevel { NoIllegalOperations // Combine may only create legal operations and types. }; +class SelectionDAG; +void checkForCycles(const SDNode *N); +void checkForCycles(const SelectionDAG *DAG); + /// SelectionDAG class - This is used to represent a portion of an LLVM function /// in a low-level Data Dependence DAG representation suitable for instruction /// selection. This DAG is constructed as the first step of instruction @@ -204,7 +208,12 @@ public: const SDValue &setRoot(SDValue N) { assert((!N.getNode() || N.getValueType() == MVT::Other) && "DAG root value is not a chain!"); - return Root = N; + if (N.getNode()) + checkForCycles(N.getNode()); + Root = N; + if (N.getNode()) + checkForCycles(this); + return Root; } /// Combine - This iterates over the nodes in the SelectionDAG, folding |
