Allow targets to legalize operations (with illegal operands) that produces multiple values. For example, a load with an illegal operand (a load produces two values, a value and chain).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62663 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index b134b23..d0023a0 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -5568,6 +5568,15 @@
   return std::make_pair(Res, Chain);
 }
 
+void TargetLowering::LowerOperationWrapper(SDValue Op, 
+                                          SmallVectorImpl<SDValue> &Results,
+                                          SelectionDAG &DAG) {
+  SDValue Res;
+  Res = LowerOperation(Op, DAG);
+  if (Res.getNode())
+    Results.push_back(Res);
+}
+
 SDValue TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) {
   assert(0 && "LowerOperation not implemented for this target!");
   abort();