diff options
author | Duncan Sands <baldrick@free.fr> | 2008-12-01 11:39:25 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-12-01 11:39:25 +0000 |
commit | 6ed40141f7e3ea38589b67fd15ac48b93c1c8fa1 (patch) | |
tree | 7f90bca20dd394c87578655b48dd1ec8040fe7f6 /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
parent | 47f733e4ea52340b781db2af19e3ed695c5f27b0 (diff) | |
download | bcm5719-llvm-6ed40141f7e3ea38589b67fd15ac48b93c1c8fa1.tar.gz bcm5719-llvm-6ed40141f7e3ea38589b67fd15ac48b93c1c8fa1.zip |
Change the interface to the type legalization method
ReplaceNodeResults: rather than returning a node which
must have the same number of results as the original
node (which means mucking around with MERGE_VALUES,
and which is also easy to get wrong since SelectionDAG
folding may mean you don't get the node you expect),
return the results in a vector.
llvm-svn: 60348
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 3ff6645fb3e..5b230fb655a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -6083,8 +6083,10 @@ SDValue SelectionDAGLegalize::PromoteLegalFP_TO_INT(SDValue LegalOp, // the target lowering hooks to expand it. Just keep the low part of the // expanded operation, we know that we're truncating anyway. if (getTypeAction(NewOutTy) == Expand) { - Operation = SDValue(TLI.ReplaceNodeResults(Operation.getNode(), DAG), 0); - assert(Operation.getNode() && "Didn't return anything"); + SmallVector<SDValue, 2> Results; + TLI.ReplaceNodeResults(Operation.getNode(), Results, DAG); + assert(Results.size() == 1 && "Incorrect FP_TO_XINT lowering!"); + Operation = Results[0]; } // Truncate the result of the extended FP_TO_*INT operation to the desired |