aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2019-12-24 11:28:10 +0100
committerLemonBoy <thatlemon@gmail.com>2020-01-02 18:53:20 +0100
commit271fc6a2479a1c5f2f914c1c40a848bf1b9d70d8 (patch)
treec0e748428933f8755639b1cb4addf40d027348f3 /src/codegen.cpp
parent563d9ebfe597b313b265a5a30296c081fe35d87a (diff)
downloadzig-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.cpp11
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;