aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-09-30 20:20:51 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-09-30 20:20:51 -0400
commit6db589fff5be05e3e782a34443a1133ebc6ef17d (patch)
tree4d8d2b4468a6f822514e7de1205496ad5986f56f /src/codegen.cpp
parent08708ea4dc3885fba8843142e0e0804f65bf0d76 (diff)
downloadzig-6db589fff5be05e3e782a34443a1133ebc6ef17d.tar.gz
zig-6db589fff5be05e3e782a34443a1133ebc6ef17d.zip
don't try to use cold calling convention on windows
it just causes a segfault
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 2d7b5bb1d4..623f946307 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -337,7 +337,12 @@ static LLVMCallConv get_llvm_cc(CodeGen *g, CallingConvention cc) {
if (g->zig_target.arch.arch == ZigLLVM_x86 ||
g->zig_target.arch.arch == ZigLLVM_x86_64)
{
- return LLVMColdCallConv;
+ // cold calling convention is not supported on windows
+ if (g->zig_target.os == ZigLLVM_Win32) {
+ return LLVMCCallConv;
+ } else {
+ return LLVMColdCallConv;
+ }
} else {
return LLVMCCallConv;
}