Mercurial > projects > ldc
diff gen/toobj.c @ 57:a9d29e9f1fed trunk
[svn r61] Added support for D-style variadic functions :)
author | lindquist |
---|---|
date | Thu, 25 Oct 2007 02:39:53 +0200 |
parents | 0ccfae271c45 |
children | 2c3cd3596187 |
line wrap: on
line diff
--- a/gen/toobj.c Wed Oct 24 22:26:37 2007 +0200 +++ b/gen/toobj.c Thu Oct 25 02:39:53 2007 +0200 @@ -778,6 +778,14 @@ } } + // copy _argptr to a memory location + if (f->linkage == LINKd && f->varargs == 1) + { + llvm::Value* argptrmem = new llvm::AllocaInst(llvmArgPtr->getType(), "_argptrmem", gIR->topallocapoint()); + new llvm::StoreInst(llvmArgPtr, argptrmem, gIR->scopebb()); + llvmArgPtr = argptrmem; + } + // output function body fbody->toIR(gIR);