From 2451684678ab9c59affd5f7a36885f8164a38573 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 13 Jan 2005 19:53:14 +0000 Subject: Don't forget the existing root. llvm-svn: 19531 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 8f0a916d68d..6a81975292c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/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)); } -- cgit v1.2.3