diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-13 19:53:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-13 19:53:14 +0000 |
commit | 5a6c6d98d561df671350a56c8031a3611f1c46fa (patch) | |
tree | 4076efc5d9c778e9d0c6c82b808171d21c910bd4 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 39ce11b97bd1d75ee1d48d6210955e2a71bc8cc7 (diff) |
Don't forget the existing root.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19531 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 8f0a916d68..6a81975292 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -878,10 +878,8 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB, ConstantsOut.clear(); // Turn all of the unordered chains into one factored node. - switch (UnorderedChains.size()) { - case 0: break; - case 1: DAG.setRoot(UnorderedChains[0]); break; - default: + if (!UnorderedChains.empty()) { + UnorderedChains.push_back(DAG.getRoot()); DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, UnorderedChains)); } |