SDAG: Remove the transitional default Select() implementation
In r268693, we started requiring that SelectionDAGISel::Select return void, but provided a default implementation that did just that by calling into the old interface. Now that all targets have been updated, we'll just remove the default implementation. llvm-svn: 270454
This commit is contained in:
parent
a5ad4d691b
commit
45fe81fb64
|
@ -77,39 +77,7 @@ public:
|
|||
virtual void PostprocessISelDAG() {}
|
||||
|
||||
/// Main hook for targets to transform nodes into machine nodes.
|
||||
///
|
||||
/// All targets should implement this hook. The default implementation will be
|
||||
/// made abstract once all targets are migrated off of the legacy hook.
|
||||
virtual void Select(SDNode *N) {
|
||||
SDNode *New = SelectImpl(N);
|
||||
// TODO: Checking DELETED_NODE here is undefined behaviour, which will be
|
||||
// fixed by migrating backends to implement the void Select interface
|
||||
// instead or returning a node.
|
||||
if (New == N || N->getOpcode() == ISD::DELETED_NODE)
|
||||
// If we ask to replace the node with itself or if we deleted the original
|
||||
// node, just move on to the next one. This case will go away once
|
||||
// everyone migrates to stop implementing SelectImpl.
|
||||
return;
|
||||
if (New) {
|
||||
// Replace the node with the returned node. Originally, Select would
|
||||
// always return a node and the caller would replace it, but this doesn't
|
||||
// work for more complicated selection schemes.
|
||||
ReplaceUses(N, New);
|
||||
CurDAG->RemoveDeadNode(N);
|
||||
} else if (N->use_empty())
|
||||
// Clean up dangling nodes if the target didn't bother. These are
|
||||
// basically bugs in the targets, but we were lenient in the past and did
|
||||
// this for them.
|
||||
CurDAG->RemoveDeadNode(N);
|
||||
}
|
||||
|
||||
/// Legacy hook to support transitioning to the return-less Select().
|
||||
///
|
||||
/// This exposes the old style Select hook. New code should implement void
|
||||
/// Select() instead.
|
||||
virtual SDNode *SelectImpl(SDNode *N) {
|
||||
llvm_unreachable("Subclasses must implement one of Select or SelectImpl");
|
||||
}
|
||||
virtual void Select(SDNode *N) = 0;
|
||||
|
||||
/// SelectInlineAsmMemoryOperand - Select the specified address as a target
|
||||
/// addressing mode, according to the specified constraint. If this does
|
||||
|
|
Loading…
Reference in New Issue