ldc-developers/ldc — pull request #768 by kinke (2014-10-26 15:40:15+00:00)
Title: Experimental varargs fix

As the title says, this is an **experimental** fix for the varargs horror (see https://github.com/ldc-developers/ldc/issues/702, https://github.com/ldc-developers/ldc/issues/172 and https://github.com/ldc-developers/druntime/pull/14).
It seems to be working fine on Win64 in combination with the ```core.vararg``` and ```core.stdc.stdarg``` patches from https://github.com/ldc-developers/druntime/pull/14. These 2 files will definitely need to be reworked for other platforms too (core.vararg simply forwarding to core.stdc.stdarg and the latter completely reworked/simplified, especially for non-Windows x86_64!). That shouldn't be too tricky and will probably yield something similar to my patch for Win64, possibly using the LLVM va_arg intrinsic for the va_arg() functions (I haven't experimented with that one yet). So @klickverbot @redstar etc.: please test on Linux, OSX etc.
All non-Windows ABIs will also need to implement ```rewriteArgument()``` to fix https://github.com/ldc-developers/ldc/issues/702, ideally in combination with some refactoring, especially for the System V AMD64 ABI implementation.