llvm.org GIT mirror llvm / 378757f
Use report_fatal_error for unsupported calling conventions The calling convention can be specified by the user in IR. Failing to support a particular calling convention isn't a programming error, and so relying on llvm_unreachable to catch and report an unsupported calling convention is not appropriate. Differential Revision: https://reviews.llvm.org/D36830 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311435 91177308-0d34-0410-b5e6-96231b3b80d8 Alex Bradbury 3 years ago
7 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
26672667 bool IsVarArg) const {
26682668 switch (CC) {
26692669 default:
2670 llvm_unreachable("Unsupported calling convention.");
2670 report_fatal_error("Unsupported calling convention.");
26712671 case CallingConv::WebKit_JS:
26722672 return CC_AArch64_WebKit_JS;
26732673 case CallingConv::GHC:
18451845 bool isVarArg) {
18461846 switch (CC) {
18471847 default:
1848 llvm_unreachable("Unsupported calling convention");
1848 report_fatal_error("Unsupported calling convention");
18491849 case CallingConv::Fast:
18501850 if (Subtarget->hasVFP2() && !isVarArg) {
18511851 if (!Subtarget->isAAPCS_ABI())
18791879 return (Return ? RetCC_ARM_APCS: CC_ARM_APCS);
18801880 case CallingConv::GHC:
18811881 if (Return)
1882 llvm_unreachable("Can't return in GHC call convention");
1882 report_fatal_error("Can't return in GHC call convention");
18831883 else
18841884 return CC_ARM_APCS_GHC;
18851885 }
15611561 bool isVarArg) const {
15621562 switch (CC) {
15631563 default:
1564 llvm_unreachable("Unsupported calling convention");
1564 report_fatal-error("Unsupported calling convention");
15651565 case CallingConv::ARM_AAPCS:
15661566 case CallingConv::ARM_APCS:
15671567 case CallingConv::GHC:
16101610 bool isVarArg) const {
16111611 switch (getEffectiveCallingConv(CC, isVarArg)) {
16121612 default:
1613 llvm_unreachable("Unsupported calling convention");
1613 report_fatal_error("Unsupported calling convention");
16141614 case CallingConv::ARM_APCS:
16151615 return (Return ? RetCC_ARM_APCS : CC_ARM_APCS);
16161616 case CallingConv::ARM_AAPCS:
157157 SelectionDAG &DAG, SmallVectorImpl &InVals) const {
158158 switch (CallConv) {
159159 default:
160 llvm_unreachable("Unsupported calling convention");
160 report_fatal_error("Unsupported calling convention");
161161 case CallingConv::C:
162162 case CallingConv::Fast:
163163 break;
404404 case CallingConv::Fast:
405405 return LowerCCCArguments(Chain, CallConv, IsVarArg, Ins, DL, DAG, InVals);
406406 default:
407 llvm_unreachable("Unsupported calling convention");
407 report_fatal_error("Unsupported calling convention");
408408 }
409409 }
410410
430430 return LowerCCCCallTo(Chain, Callee, CallConv, IsVarArg, IsTailCall, Outs,
431431 OutVals, Ins, DL, DAG, InVals);
432432 default:
433 llvm_unreachable("Unsupported calling convention");
433 report_fatal_error("Unsupported calling convention");
434434 }
435435 }
436436
545545
546546 switch (CallConv) {
547547 default:
548 llvm_unreachable("Unsupported calling convention");
548 report_fatal_error("Unsupported calling convention");
549549 case CallingConv::C:
550550 case CallingConv::Fast:
551551 return LowerCCCArguments(Chain, CallConv, isVarArg, Ins, dl, DAG, InVals);
575575
576576 switch (CallConv) {
577577 default:
578 llvm_unreachable("Unsupported calling convention");
578 report_fatal_error("Unsupported calling convention");
579579 case CallingConv::MSP430_BUILTIN:
580580 case CallingConv::Fast:
581581 case CallingConv::C:
10451045 switch (CallConv)
10461046 {
10471047 default:
1048 llvm_unreachable("Unsupported calling convention");
1048 report_fatal_error("Unsupported calling convention");
10491049 case CallingConv::Fast:
10501050 case CallingConv::C:
10511051 return LowerCCCCallTo(Chain, Callee, CallConv, isVarArg, isTailCall,
12421242 switch (CallConv)
12431243 {
12441244 default:
1245 llvm_unreachable("Unsupported calling convention");
1245 report_fatal_error("Unsupported calling convention");
12461246 case CallingConv::C:
12471247 case CallingConv::Fast:
12481248 return LowerCCCArguments(Chain, CallConv, isVarArg,