From e7c72b072bd42904736f1e5a6d3f5dec64d45b68 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Thu, 27 Sep 2012 23:53:04 +0200 Subject: [PATCH] Default to C-style variadics for all calling conventions. Fixes DMD testcase 'callingconv'. --- gen/functions.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gen/functions.cpp b/gen/functions.cpp index 438a167d..8b5754ce 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -116,14 +116,11 @@ llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nesttype, lidx++; } } - else if (f->linkage == LINKc) - { - fty.c_vararg = true; - } else { - type->error(0, "invalid linkage for variadic function"); - fatal(); + // Default to C-style varargs for non-extern(D) variadic functions. + // This seems to be what DMD does. + fty.c_vararg = true; } }