From f02434cdaf29db5e2a658d1bc9b2a6e32584975b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 19 Oct 2007 03:31:45 +0000 Subject: [PATCH] add a new target hook. llvm-svn: 43165 --- include/llvm/Target/TargetLowering.h | 9 +++++++++ lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index e7e99a7f744..48f3d7c016c 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -885,6 +885,15 @@ public: /// implement this. The default implementation of this aborts. virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG); + /// ExpandOperation - This callback is invoked for operations that are + /// unsupported by the target, which are registered to use 'custom' lowering, + /// and whose result type needs to be expanded. + /// + /// If the target has no operations that require custom lowering, it need not + /// implement this. The default implementation of this aborts. + virtual std::pair + ExpandOperation(SDOperand Op, SelectionDAG &DAG); + /// IsEligibleForTailCallOptimization - Check whether the call is eligible for /// tail call optimization. Targets which want to do tail call optimization /// should override this function. diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e2276cd8292..a5b6300f6e3 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -4134,6 +4134,14 @@ SDOperand TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { return SDOperand(); } +std::pair +TargetLowering::ExpandOperation(SDOperand Op, SelectionDAG &DAG) { + assert(0 && "ExpandOperation not implemented for this target!"); + abort(); + return std::pair(); +} + + SDOperand TargetLowering::CustomPromoteOperation(SDOperand Op, SelectionDAG &DAG) { assert(0 && "CustomPromoteOperation not implemented for this target!");