summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-12-01 11:39:25 +0000
committerDuncan Sands <baldrick@free.fr>2008-12-01 11:39:25 +0000
commit1607f05cb7d77d01ce521a30232faa389dbed4e2 (patch)
treeaa158f63740a3b308cc75229bd80c57c21e269f1 /include
parentd54d86038d1486e29969385a2cbd4fce1cd97202 (diff)
downloadllvm-1607f05cb7d77d01ce521a30232faa389dbed4e2.tar.gz
llvm-1607f05cb7d77d01ce521a30232faa389dbed4e2.tar.bz2
llvm-1607f05cb7d77d01ce521a30232faa389dbed4e2.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 4350484207..6b7d42ecc4 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -1130,17 +1130,18 @@ public:
/// implement this. The default implementation of this aborts.
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG);
- /// ReplaceNodeResults - This callback is invoked for operations that are
- /// unsupported by the target, which are registered to use 'custom' lowering,
- /// and whose result type is illegal. This must return a node whose results
- /// precisely match the results of the input node. This typically involves a
- /// MERGE_VALUES node and/or BUILD_PAIR.
+ /// ReplaceNodeResults - This callback is invoked when a node result type is
+ /// illegal for the target, and the operation was registered to use 'custom'
+ /// lowering for that result type. The target places new result values for
+ /// the node in Results (their number and types must exactly match those of
+ /// the original return values of the node), or leaves Results empty, which
+ /// indicates that the node is not to be custom lowered after all.
///
/// If the target has no operations that require custom lowering, it need not
/// implement this. The default implementation aborts.
- virtual SDNode *ReplaceNodeResults(SDNode *N, SelectionDAG &DAG) {
+ virtual void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
+ SelectionDAG &DAG) {
assert(0 && "ReplaceNodeResults not implemented for this target!");
- return 0;
}
/// IsEligibleForTailCallOptimization - Check whether the call is eligible for