summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-15 21:58:08 +0000
committerChris Lattner <sabre@nondot.org>2008-01-15 21:58:08 +0000
commitee8df1f4d372a32a1aacbf585e53ae2e3a4d0088 (patch)
treefbfd8ea68947bc3b24b33f2bb2fbac6bd82b26ed /llvm/lib
parentfe2714fab316bf07e7657f316c5ef246dee30c21 (diff)
downloadbcm5719-llvm-ee8df1f4d372a32a1aacbf585e53ae2e3a4d0088.tar.gz
bcm5719-llvm-ee8df1f4d372a32a1aacbf585e53ae2e3a4d0088.zip
Add support for targets that have a legal ISD::TRAP.
llvm-svn: 46014
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp13
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp3
2 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 8e9cd742339..68c3ced6e56 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -3734,24 +3734,29 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
break;
}
}
- case ISD::TRAP: {
+ case ISD::TRAP: {
MVT::ValueType VT = Node->getValueType(0);
switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
default: assert(0 && "This action not supported for this op yet!");
+ case TargetLowering::Legal:
+ Tmp1 = LegalizeOp(Node->getOperand(0));
+ Result = DAG.UpdateNodeOperands(Result, Tmp1);
+ break;
case TargetLowering::Custom:
Result = TLI.LowerOperation(Op, DAG);
if (Result.Val) break;
// Fall Thru
- case TargetLowering::Legal:
+ case TargetLowering::Expand:
// If this operation is not supported, lower it to 'abort()' call
- SDOperand Chain = LegalizeOp(Node->getOperand(0));
+ Tmp1 = LegalizeOp(Node->getOperand(0));
TargetLowering::ArgListTy Args;
std::pair<SDOperand,SDOperand> CallResult =
- TLI.LowerCallTo(Chain, Type::VoidTy, false, false, CallingConv::C, false,
+ TLI.LowerCallTo(Tmp1, Type::VoidTy, false, false, CallingConv::C, false,
DAG.getExternalSymbol("abort", MVT::Other), Args, DAG);
Result = CallResult.second;
break;
}
+ break;
}
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index ac2ce8a86b4..cb12b7c7329 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -175,6 +175,9 @@ TargetLowering::TargetLowering(TargetMachine &tm)
setOperationAction(ISD::FGETSIGN, (MVT::ValueType)VT, Expand);
}
+ // Default ISD::TRAP to expand (which turns it into abort).
+ setOperationAction(ISD::TRAP, MVT::Other, Expand);
+
IsLittleEndian = TD->isLittleEndian();
UsesGlobalOffsetTable = false;
ShiftAmountTy = SetCCResultTy = PointerTy = getValueType(TD->getIntPtrType());
OpenPOWER on IntegriCloud