| author | |
| committer | |
| log | 0a6863a267d88e73ec62aca2c157654020682b00 |
| tree | 282697ef070d592623474502e02696c9b7d4011f |
| parent | ae161863db544e2db20ba7705bf0ada7d3ce5c94 |
This isn't a stable, defined calling convention, so it shouldn't be
grouped in with the others.
Closes https://github.com/ziglang/zig/issues/65565 files changed, 12 insertions(+), 26 deletions(-)
lib/std/builtin.zig-1| ... | @@ -151,7 +151,6 @@ pub const Mode = enum { | ... | @@ -151,7 +151,6 @@ pub const Mode = enum { |
| 151 | pub const CallingConvention = enum { | 151 | pub const CallingConvention = enum { |
| 152 | Unspecified, | 152 | Unspecified, |
| 153 | C, | 153 | C, |
| 154 | Cold, | ||
| 155 | Naked, | 154 | Naked, |
| 156 | Async, | 155 | Async, |
| 157 | Interrupt, | 156 | Interrupt, |
src/stage1/all_types.hpp-1| ... | @@ -72,7 +72,6 @@ enum PtrLen { | ... | @@ -72,7 +72,6 @@ enum PtrLen { |
| 72 | enum CallingConvention { | 72 | enum CallingConvention { |
| 73 | CallingConventionUnspecified, | 73 | CallingConventionUnspecified, |
| 74 | CallingConventionC, | 74 | CallingConventionC, |
| 75 | CallingConventionCold, | ||
| 76 | CallingConventionNaked, | 75 | CallingConventionNaked, |
| 77 | CallingConventionAsync, | 76 | CallingConventionAsync, |
| 78 | CallingConventionInterrupt, | 77 | CallingConventionInterrupt, |
src/stage1/analyze.cpp-3| ... | @@ -949,7 +949,6 @@ const char *calling_convention_name(CallingConvention cc) { | ... | @@ -949,7 +949,6 @@ const char *calling_convention_name(CallingConvention cc) { |
| 949 | switch (cc) { | 949 | switch (cc) { |
| 950 | case CallingConventionUnspecified: return "Unspecified"; | 950 | case CallingConventionUnspecified: return "Unspecified"; |
| 951 | case CallingConventionC: return "C"; | 951 | case CallingConventionC: return "C"; |
| 952 | case CallingConventionCold: return "Cold"; | ||
| 953 | case CallingConventionNaked: return "Naked"; | 952 | case CallingConventionNaked: return "Naked"; |
| 954 | case CallingConventionAsync: return "Async"; | 953 | case CallingConventionAsync: return "Async"; |
| 955 | case CallingConventionInterrupt: return "Interrupt"; | 954 | case CallingConventionInterrupt: return "Interrupt"; |
| ... | @@ -971,7 +970,6 @@ bool calling_convention_allows_zig_types(CallingConvention cc) { | ... | @@ -971,7 +970,6 @@ bool calling_convention_allows_zig_types(CallingConvention cc) { |
| 971 | case CallingConventionAsync: | 970 | case CallingConventionAsync: |
| 972 | return true; | 971 | return true; |
| 973 | case CallingConventionC: | 972 | case CallingConventionC: |
| 974 | case CallingConventionCold: | ||
| 975 | case CallingConventionNaked: | 973 | case CallingConventionNaked: |
| 976 | case CallingConventionInterrupt: | 974 | case CallingConventionInterrupt: |
| 977 | case CallingConventionSignal: | 975 | case CallingConventionSignal: |
| ... | @@ -3603,7 +3601,6 @@ static void resolve_decl_fn(CodeGen *g, TldFn *tld_fn) { | ... | @@ -3603,7 +3601,6 @@ static void resolve_decl_fn(CodeGen *g, TldFn *tld_fn) { |
| 3603 | tld_fn->base.resolution = TldResolutionInvalid; | 3601 | tld_fn->base.resolution = TldResolutionInvalid; |
| 3604 | return; | 3602 | return; |
| 3605 | case CallingConventionC: | 3603 | case CallingConventionC: |
| 3606 | case CallingConventionCold: | ||
| 3607 | case CallingConventionNaked: | 3604 | case CallingConventionNaked: |
| 3608 | case CallingConventionInterrupt: | 3605 | case CallingConventionInterrupt: |
| 3609 | case CallingConventionSignal: | 3606 | case CallingConventionSignal: |
src/stage1/codegen.cpp+12-20| ... | @@ -160,12 +160,6 @@ static ZigLLVM_CallingConv get_llvm_cc(CodeGen *g, CallingConvention cc) { | ... | @@ -160,12 +160,6 @@ static ZigLLVM_CallingConv get_llvm_cc(CodeGen *g, CallingConvention cc) { |
| 160 | return ZigLLVM_Fast; | 160 | return ZigLLVM_Fast; |
| 161 | case CallingConventionC: | 161 | case CallingConventionC: |
| 162 | return ZigLLVM_C; | 162 | return ZigLLVM_C; |
| 163 | case CallingConventionCold: | ||
| 164 | if ((g->zig_target->arch == ZigLLVM_x86 || | ||
| 165 | g->zig_target->arch == ZigLLVM_x86_64) && | ||
| 166 | g->zig_target->os != OsWindows) | ||
| 167 | return ZigLLVM_Cold; | ||
| 168 | return ZigLLVM_C; | ||
| 169 | case CallingConventionNaked: | 163 | case CallingConventionNaked: |
| 170 | zig_unreachable(); | 164 | zig_unreachable(); |
| 171 | case CallingConventionStdcall: | 165 | case CallingConventionStdcall: |
| ... | @@ -339,7 +333,6 @@ static bool cc_want_sret_attr(CallingConvention cc) { | ... | @@ -339,7 +333,6 @@ static bool cc_want_sret_attr(CallingConvention cc) { |
| 339 | case CallingConventionNaked: | 333 | case CallingConventionNaked: |
| 340 | zig_unreachable(); | 334 | zig_unreachable(); |
| 341 | case CallingConventionC: | 335 | case CallingConventionC: |
| 342 | case CallingConventionCold: | ||
| 343 | case CallingConventionInterrupt: | 336 | case CallingConventionInterrupt: |
| 344 | case CallingConventionSignal: | 337 | case CallingConventionSignal: |
| 345 | case CallingConventionStdcall: | 338 | case CallingConventionStdcall: |
| ... | @@ -448,7 +441,7 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) { | ... | @@ -448,7 +441,7 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) { |
| 448 | ZigLLVMFunctionSetCallingConv(llvm_fn, get_llvm_cc(g, cc)); | 441 | ZigLLVMFunctionSetCallingConv(llvm_fn, get_llvm_cc(g, cc)); |
| 449 | } | 442 | } |
| 450 | 443 | ||
| 451 | bool want_cold = fn->is_cold || cc == CallingConventionCold; | 444 | bool want_cold = fn->is_cold; |
| 452 | if (want_cold) { | 445 | if (want_cold) { |
| 453 | ZigLLVMAddFunctionAttrCold(llvm_fn); | 446 | ZigLLVMAddFunctionAttrCold(llvm_fn); |
| 454 | } | 447 | } |
| ... | @@ -8818,18 +8811,17 @@ Buf *codegen_generate_builtin_source(CodeGen *g) { | ... | @@ -8818,18 +8811,17 @@ Buf *codegen_generate_builtin_source(CodeGen *g) { |
| 8818 | 8811 | ||
| 8819 | static_assert(CallingConventionUnspecified == 0, ""); | 8812 | static_assert(CallingConventionUnspecified == 0, ""); |
| 8820 | static_assert(CallingConventionC == 1, ""); | 8813 | static_assert(CallingConventionC == 1, ""); |
| 8821 | static_assert(CallingConventionCold == 2, ""); | 8814 | static_assert(CallingConventionNaked == 2, ""); |
| 8822 | static_assert(CallingConventionNaked == 3, ""); | 8815 | static_assert(CallingConventionAsync == 3, ""); |
| 8823 | static_assert(CallingConventionAsync == 4, ""); | 8816 | static_assert(CallingConventionInterrupt == 4, ""); |
| 8824 | static_assert(CallingConventionInterrupt == 5, ""); | 8817 | static_assert(CallingConventionSignal == 5, ""); |
| 8825 | static_assert(CallingConventionSignal == 6, ""); | 8818 | static_assert(CallingConventionStdcall == 6, ""); |
| 8826 | static_assert(CallingConventionStdcall == 7, ""); | 8819 | static_assert(CallingConventionFastcall == 7, ""); |
| 8827 | static_assert(CallingConventionFastcall == 8, ""); | 8820 | static_assert(CallingConventionVectorcall == 8, ""); |
| 8828 | static_assert(CallingConventionVectorcall == 9, ""); | 8821 | static_assert(CallingConventionThiscall == 9, ""); |
| 8829 | static_assert(CallingConventionThiscall == 10, ""); | 8822 | static_assert(CallingConventionAPCS == 10, ""); |
| 8830 | static_assert(CallingConventionAPCS == 11, ""); | 8823 | static_assert(CallingConventionAAPCS == 11, ""); |
| 8831 | static_assert(CallingConventionAAPCS == 12, ""); | 8824 | static_assert(CallingConventionAAPCSVFP == 12, ""); |
| 8832 | static_assert(CallingConventionAAPCSVFP == 13, ""); | ||
| 8833 | 8825 | ||
| 8834 | static_assert(FnInlineAuto == 0, ""); | 8826 | static_assert(FnInlineAuto == 0, ""); |
| 8835 | static_assert(FnInlineAlways == 1, ""); | 8827 | static_assert(FnInlineAlways == 1, ""); |
src/stage1/ir.cpp-1| ... | @@ -18916,7 +18916,6 @@ static IrInstGen *ir_analyze_instruction_export(IrAnalyze *ira, IrInstSrcExport | ... | @@ -18916,7 +18916,6 @@ static IrInstGen *ir_analyze_instruction_export(IrAnalyze *ira, IrInstSrcExport |
| 18916 | add_error_note(ira->codegen, msg, fn_entry->proto_node, buf_sprintf("declared here")); | 18916 | add_error_note(ira->codegen, msg, fn_entry->proto_node, buf_sprintf("declared here")); |
| 18917 | } break; | 18917 | } break; |
| 18918 | case CallingConventionC: | 18918 | case CallingConventionC: |
| 18919 | case CallingConventionCold: | ||
| 18920 | case CallingConventionNaked: | 18919 | case CallingConventionNaked: |
| 18921 | case CallingConventionInterrupt: | 18920 | case CallingConventionInterrupt: |
| 18922 | case CallingConventionSignal: | 18921 | case CallingConventionSignal: |