diff gen/toir.cpp @ 443:44f08170f4ef

Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn. Reworked the LLVMDC specific pragmas.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Fri, 01 Aug 2008 00:32:06 +0200
parents d8dc221d3db7
children cc40db549aea
line wrap: on
line diff
--- a/gen/toir.cpp	Thu Jul 31 19:14:49 2008 +0200
+++ b/gen/toir.cpp	Fri Aug 01 00:32:06 2008 +0200
@@ -758,8 +758,11 @@
         FuncDeclaration* fndecl = dfnval->func;
         // va_start instruction
         if (fndecl->llvmInternal == LLVMva_start) {
-            // TODO
-            assert(0 && "va_start not yet implemented");
+            // llvm doesn't need the second param hence the override
+            Expression* exp = (Expression*)arguments->data[0];
+            DValue* expv = exp->toElem(p);
+            LLValue* arg = DtoBitCast(expv->getLVal(), getVoidPtrType());
+            return new DImValue(type, gIR->ir->CreateCall(GET_INTRINSIC_DECL(vastart), arg, ""));
         }
         // va_arg instruction
         else if (fndecl->llvmInternal == LLVMva_arg) {