Allow targets to custom legalize leaf nodes like GlobalAddress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24387 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-11-17 06:41:44 +00:00
parent 2823b3e70e
commit 0c8fbe33a4

View File

@ -532,7 +532,19 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
case ISD::CONDCODE:
case ISD::VALUETYPE:
case ISD::SRCVALUE:
assert(isTypeLegal(Node->getValueType(0)) && "This must be legal!");
switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
default: assert(0 && "This action is not supported yet!");
case TargetLowering::Custom: {
SDOperand Tmp = TLI.LowerOperation(Op, DAG);
if (Tmp.Val) {
Result = LegalizeOp(Tmp);
break;
}
} // FALLTHROUGH if the target doesn't want to lower this op after all.
case TargetLowering::Legal:
assert(isTypeLegal(Node->getValueType(0)) && "This must be legal!");
break;
}
break;
case ISD::AssertSext:
case ISD::AssertZext: