diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-10-20 09:58:01 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-10-20 09:58:01 +0000 |
commit | 37e9c6566685d49ea05d3a52174f820450d5e06b (patch) | |
tree | 08485b5b0f320fa8a85e26a6a1702a76de614fb5 | |
parent | 048eb9c886bddbf730bd790d929e242b218b1bfd (diff) |
Pull from master repo; commit by gmcgarry
>Fix -Xp (prototype debug) which was interpretting structs/unions/enums
>as arrays. Fix compile with TARGET_STDARGS.
-rw-r--r-- | usr.bin/pcc/ccom/pftn.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.bin/pcc/ccom/pftn.c b/usr.bin/pcc/ccom/pftn.c index baab75fcdbf..88ae5dac63e 100644 --- a/usr.bin/pcc/ccom/pftn.c +++ b/usr.bin/pcc/ccom/pftn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pftn.c,v 1.4 2007/10/18 17:02:11 otto Exp $ */ +/* $OpenBSD: pftn.c,v 1.5 2007/10/20 09:58:00 otto Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -1890,8 +1890,10 @@ arglist(NODE *n) if (k > num) cerror("arglist: k%d > num%d", k, num); tfree(n); +#ifdef PCC_DEBUG if (pdebug) alprint(al, 0); +#endif return al; } @@ -2110,10 +2112,12 @@ static struct bitable { NODE *(*fun)(NODE *f, NODE *a); } bitable[] = { { "__builtin_alloca", builtin_alloca }, +#ifndef TARGET_STDARGS { "__builtin_stdarg_start", builtin_stdarg_start }, { "__builtin_va_arg", builtin_va_arg }, { "__builtin_va_end", builtin_va_end }, { "__builtin_va_copy", builtin_va_copy }, +#endif #ifdef TARGET_BUILTINS TARGET_BUILTINS #endif @@ -2134,16 +2138,18 @@ alprint(union arglist *al, int in) printf(" "); printf("arg %d: ", i++); tprint(stdout, al->type, 0); - if (BTYPE(al->type) == STRTY || + if (ISARY(al->type)) { + printf(" dim %d\n", al->df->ddim); + } else if (BTYPE(al->type) == STRTY || BTYPE(al->type) == UNIONTY || BTYPE(al->type) == ENUMTY) { al++; - printf("dim %d\n", al->df->ddim); - } - printf("\n"); - if (ISFTN(DECREF(al->type))) { + printf(" (size %d align %d)", al->sue->suesize, + al->sue->suealign); + } else if (ISFTN(DECREF(al->type))) { al++; alprint(al->df->dfun, in+1); } + printf("\n"); } if (in == 0) printf("end arglist\n"); |