diff options
| author | LemonBoy <thatlemon@gmail.com> | 2019-12-24 11:28:10 +0100 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2020-01-02 18:53:20 +0100 |
| commit | 271fc6a2479a1c5f2f914c1c40a848bf1b9d70d8 (patch) | |
| tree | c0e748428933f8755639b1cb4addf40d027348f3 /src/codegen.cpp | |
| parent | 563d9ebfe597b313b265a5a30296c081fe35d87a (diff) | |
| download | zig-271fc6a2479a1c5f2f914c1c40a848bf1b9d70d8.tar.gz zig-271fc6a2479a1c5f2f914c1c40a848bf1b9d70d8.zip | |
Catch more errors during the type resolution phase
Returning the uninitialized/stale error condition made the compiler turn
a blind eye to some problems.
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index c5611f3e2c..b83767f9d6 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -290,10 +290,16 @@ static LLVMCallConv get_llvm_cc(CodeGen *g, CallingConvention cc) { case CallingConventionFastcall: if (g->zig_target->arch == ZigLLVM_x86) return LLVMX86FastcallCallConv; - return LLVMFastCallConv; + return LLVMCCallConv; case CallingConventionVectorcall: if (g->zig_target->arch == ZigLLVM_x86) return LLVMX86VectorCallCallConv; + // XXX Enable this when the C API exports this enum member too +#if 0 + if (target_is_arm(g->zig_target) && + target_arch_pointer_bit_width(g->zig_target->arch) == 64) + return LLVMAARCH64VectorCallCallConv; +#endif return LLVMCCallConv; case CallingConventionAsync: return LLVMFastCallConv; @@ -310,7 +316,8 @@ static LLVMCallConv get_llvm_cc(CodeGen *g, CallingConvention cc) { return LLVMARMAAPCSVFPCallConv; return LLVMCCallConv; case CallingConventionInterrupt: - if (g->zig_target->arch == ZigLLVM_x86 || g->zig_target->arch == ZigLLVM_x86_64) + if (g->zig_target->arch == ZigLLVM_x86 || + g->zig_target->arch == ZigLLVM_x86_64) return LLVMX86INTRCallConv; if (g->zig_target->arch == ZigLLVM_avr) return LLVMAVRINTRCallConv; |
