Mercurial > projects > ldc
comparison dmd/expression.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 | 0b9b286b67b6 |
children | d8dd47ef3973 |
comparison
equal
deleted
inserted
replaced
56:3a784f7790d6 | 57:a9d29e9f1fed |
---|---|
578 arguments->data[i] = (void *) arg; | 578 arguments->data[i] = (void *) arg; |
579 if (done) | 579 if (done) |
580 break; | 580 break; |
581 } | 581 } |
582 | 582 |
583 #if !IN_LLVM | |
583 // If D linkage and variadic, add _arguments[] as first argument | 584 // If D linkage and variadic, add _arguments[] as first argument |
584 if (tf->linkage == LINKd && tf->varargs == 1) | 585 if (tf->linkage == LINKd && tf->varargs == 1) |
585 { | 586 { |
586 Expression *e; | 587 Expression *e; |
587 | 588 |
588 e = createTypeInfoArray(sc, (Expression **)&arguments->data[nparams], | 589 e = createTypeInfoArray(sc, (Expression **)&arguments->data[nparams], |
589 arguments->dim - nparams); | 590 arguments->dim - nparams); |
590 arguments->insert(0, e); | 591 arguments->insert(0, e); |
591 } | 592 } |
593 #endif | |
592 } | 594 } |
593 | 595 |
594 /************************************************** | 596 /************************************************** |
595 * Write expression out to buf, but wrap it | 597 * Write expression out to buf, but wrap it |
596 * in ( ) if its precedence is less than pr. | 598 * in ( ) if its precedence is less than pr. |