diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-09-24 16:04:02 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-09-24 16:04:02 +0000 |
commit | 007a3e7fc7cc91acab5158927a2ea9c7289ff9c0 (patch) | |
tree | 2263a58ddb2581c8e7271e71693339b778732d7a /usr.bin | |
parent | d72e08cc19fd8622db35472601107347aeeecd80 (diff) |
pull from ragge's repo: -v flag and reg class check
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/pcc/cc/cc/cc.c | 10 | ||||
-rw-r--r-- | usr.bin/pcc/cc/ccom/main.c | 7 | ||||
-rw-r--r-- | usr.bin/pcc/cc/cpp/cpp.c | 9 | ||||
-rw-r--r-- | usr.bin/pcc/mip/mkext.c | 7 |
4 files changed, 26 insertions, 7 deletions
diff --git a/usr.bin/pcc/cc/cc/cc.c b/usr.bin/pcc/cc/cc/cc.c index f48277265a3..58e4b8019da 100644 --- a/usr.bin/pcc/cc/cc/cc.c +++ b/usr.bin/pcc/cc/cc/cc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cc.c,v 1.11 2007/09/23 18:36:30 otto Exp $ */ +/* $OpenBSD: cc.c,v 1.12 2007/09/24 16:04:01 otto Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * @@ -402,6 +402,8 @@ main(int argc, char *argv[]) tmp4 = setsuf(clist[i], 'i'); na = 0; av[na++] = "cpp"; + if (vflag) + av[na++] = "-v"; av[na++] = "-D__PCC__=" MKS(PCC_MAJOR); av[na++] = "-D__PCC_MINOR__=" MKS(PCC_MINOR); av[na++] = "-D__PCC_MINORMINOR__=" MKS(PCC_MINORMINOR); @@ -445,6 +447,8 @@ main(int argc, char *argv[]) com: na = 0; av[na++]= "ccom"; + if (vflag) + av[na++] = "-v"; if (gflag) av[na++] = "-g"; if (kflag) @@ -489,6 +493,8 @@ main(int argc, char *argv[]) assemble: na = 0; av[na++] = "as"; + if (vflag) + av[na++] = "-v"; if (kflag) av[na++] = "-k"; av[na++] = "-o"; @@ -519,6 +525,8 @@ nocom: if (cflag==0 && nl!=0) { j = 0; av[j++] = "ld"; + if (vflag) + av[j++] = "-v"; av[j++] = "-X"; av[j++] = "-d"; av[j++] = "-e"; diff --git a/usr.bin/pcc/cc/ccom/main.c b/usr.bin/pcc/cc/ccom/main.c index 31b1f559c26..a61eecc0bda 100644 --- a/usr.bin/pcc/cc/ccom/main.c +++ b/usr.bin/pcc/cc/ccom/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.2 2007/09/15 22:04:38 ray Exp $ */ +/* $OpenBSD: main.c,v 1.3 2007/09/24 16:04:01 otto Exp $ */ /* * Copyright (c) 2002 Anders Magnusson. All rights reserved. @@ -110,7 +110,7 @@ main(int argc, char *argv[]) prgname = argv[0]; - while ((ch = getopt(argc, argv, "VlwX:Z:W:sOT:gx:k")) != -1) + while ((ch = getopt(argc, argv, "VlwX:Z:W:sOT:gx:kv")) != -1) switch (ch) { #if !defined(MULTIPASS) || defined(PASS1) case 'X': @@ -219,6 +219,9 @@ main(int argc, char *argv[]) else usage(); break; + case 'v': + printf("ccom: %s\n", VERSSTR); + break; case '?': default: diff --git a/usr.bin/pcc/cc/cpp/cpp.c b/usr.bin/pcc/cc/cpp/cpp.c index bf1c4e9926c..1f201d981eb 100644 --- a/usr.bin/pcc/cc/cpp/cpp.c +++ b/usr.bin/pcc/cc/cpp/cpp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpp.c,v 1.8 2007/09/21 08:15:36 gilles Exp $ */ +/* $OpenBSD: cpp.c,v 1.9 2007/09/24 16:04:01 otto Exp $ */ /* * Copyright (c) 2004 Anders Magnusson (ragge@ludd.luth.se). @@ -176,7 +176,7 @@ main(int argc, char **argv) struct symtab *nl; register int ch; - while ((ch = getopt(argc, argv, "CD:I:MS:U:d:i:tv")) != -1) + while ((ch = getopt(argc, argv, "CD:I:MS:U:d:i:tvV")) != -1) switch (ch) { case 'C': /* Do not discard comments */ Cflag++; @@ -213,10 +213,13 @@ main(int argc, char **argv) break; #ifdef CPP_DEBUG - case 'v': + case 'V': dflag++; break; #endif + case 'v': + printf("cpp: %s\n", VERSSTR); + break; case 'd': if (optarg[0] == 'M') { dMflag = 1; diff --git a/usr.bin/pcc/mip/mkext.c b/usr.bin/pcc/mip/mkext.c index b209708f711..555e3ba7551 100644 --- a/usr.bin/pcc/mip/mkext.c +++ b/usr.bin/pcc/mip/mkext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkext.c,v 1.3 2007/09/20 13:40:32 otto Exp $ */ +/* $OpenBSD: mkext.c,v 1.4 2007/09/24 16:04:01 otto Exp $ */ /* * Generate defines for the needed hardops. */ @@ -221,6 +221,11 @@ main(int argc, char *argv[]) if (breg > mx) mx = breg; if (creg > mx) mx = creg; if (dreg > mx) mx = dreg; + if (mx > (sizeof(int)*8)-1) { + printf("too many regs in a class, use two classes instead\n"); + printf("%d > %zu\n", mx, (sizeof(int)*8)-1); + rval++; + } fprintf(fc, "static int rmap[NUMCLASS][%d] = {\n", mx); for (j = 0; j < NUMCLASS; j++) { int cl = (1 << (j+1)); |