From 4f16e70faad0840357998059f7f296e5f5e412be Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 28 Jan 2006 03:37:03 +0000 Subject: [PATCH] add a new callback git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25727 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetLowering.h | 17 ++++++++++++----- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 7 +++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 7201079454e..7f82eb675f3 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -368,17 +368,24 @@ public: LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth, SelectionDAG &DAG); - /// LowerOperation - For operations that are unsupported by the target, and - /// which are registered to use 'custom' lowering, this callback is invoked. + /// LowerOperation - This callback is invoked for operations that are + /// unsupported by the target, which are registered to use 'custom' lowering, + /// and whose defined values are all legal. /// If the target has no operations that require custom lowering, it need not /// implement this. The default implementation of this aborts. virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG); - /// CustomPromoteOperation - For operations that are unsupported by the - /// target, are registered to use 'custom' lowering, and whose type needs to - /// be promoted, this callback is invoked. + /// CustomPromoteOperation - This callback is invoked for operations that are + /// unsupported by the target, are registered to use 'custom' lowering, and + /// whose type needs to be promoted. virtual SDOperand CustomPromoteOperation(SDOperand Op, SelectionDAG &DAG); + /// CustomExpandOperation - This callback is invoked for operations that are + /// unsupported by the target, are registered to use 'custom' lowering, and + /// whose type needs to be expanded. + virtual void CustomExpandOperation(SDOperand Op, SDOperand &Lo, SDOperand &Hi, + SelectionDAG &DAG); + /// getTargetNodeName() - This method returns the name of a target specific /// DAG node. virtual const char *getTargetNodeName(unsigned Opcode) const; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 78db4554dae..aa7659320d8 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1288,6 +1288,13 @@ SDOperand TargetLowering::CustomPromoteOperation(SDOperand Op, return SDOperand(); } +void TargetLowering::CustomExpandOperation(SDOperand Op, SDOperand &Lo, + SDOperand &Hi, SelectionDAG &DAG) { + assert(0 && "CustomExpandOperation not implemented for this target!"); + abort(); + return SDOperand(); +} + void SelectionDAGLowering::visitFrameReturnAddress(CallInst &I, bool isFrame) { unsigned Depth = (unsigned)cast(I.getOperand(1))->getValue(); std::pair Result = -- 2.34.1