diff options
author | Anders Magnusson <ragge@cvs.openbsd.org> | 2008-01-12 17:30:43 +0000 |
---|---|---|
committer | Anders Magnusson <ragge@cvs.openbsd.org> | 2008-01-12 17:30:43 +0000 |
commit | 2dce4761cf71c47669692689feb164e881aeb186 (patch) | |
tree | ff8bd5d5ad8659b35ec7a07db24581a2ef478f6c /usr.bin/pcc/vax | |
parent | a3ce712d93a1ce064326d5d7a5ea989f03a59ff0 (diff) |
Updates from master repo.
Diffstat (limited to 'usr.bin/pcc/vax')
-rw-r--r-- | usr.bin/pcc/vax/code.c | 8 | ||||
-rw-r--r-- | usr.bin/pcc/vax/local.c | 48 |
2 files changed, 44 insertions, 12 deletions
diff --git a/usr.bin/pcc/vax/code.c b/usr.bin/pcc/vax/code.c index 4ae4e525412..26950244a06 100644 --- a/usr.bin/pcc/vax/code.c +++ b/usr.bin/pcc/vax/code.c @@ -1,4 +1,4 @@ -/* $OpenBSD: code.c,v 1.5 2007/12/09 18:56:17 ragge Exp $ */ +/* $OpenBSD: code.c,v 1.6 2008/01/12 17:30:42 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * @@ -158,12 +158,12 @@ aoend(){ void defnam( p ) register struct symtab *p; { - /* define the current location as the name p->sname */ + /* define the current location as the name p->soname */ if( p->sclass == EXTDEF ){ - printf( " .globl %s\n", exname( p->sname ) ); + printf( " .globl %s\n", exname( p->soname ) ); } - printf( "%s:\n", exname( p->sname ) ); + printf( "%s:\n", exname( p->soname ) ); } diff --git a/usr.bin/pcc/vax/local.c b/usr.bin/pcc/vax/local.c index bd764b9867f..28749650e79 100644 --- a/usr.bin/pcc/vax/local.c +++ b/usr.bin/pcc/vax/local.c @@ -1,4 +1,4 @@ -/* $OpenBSD: local.c,v 1.4 2007/11/17 12:00:37 ragge Exp $ */ +/* $OpenBSD: local.c,v 1.5 2008/01/12 17:30:42 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * @@ -216,6 +216,26 @@ clocal(p) NODE *p; { void myp2tree(NODE *p) { + int o = p->n_op, i; + + if (o != FCON) + return; + + /* Write float constants to memory */ + /* Should be volontary per architecture */ + + setloc1(RDATA); + defalign(p->n_type == FLOAT ? ALFLOAT : p->n_type == DOUBLE ? + ALDOUBLE : ALLDOUBLE ); + deflab1(i = getlab()); + ninval(0, btdims[p->n_type].suesize, p); + p->n_op = NAME; + p->n_lval = 0; + p->n_sp = tmpalloc(sizeof(struct symtab_hdr)); + p->n_sp->sclass = ILABEL; + p->n_sp->soffset = i; + p->n_sp->sflags = 0; + } /* @@ -363,7 +383,7 @@ void commdec( struct symtab *q ){ /* make a common declaration for id, if reasonable */ OFFSZ off; - printf( " .comm %s,", exname( q->sname ) ); + printf( " .comm %s,", exname( q->soname ) ); off = tsize( q->stype, q->sdf, q->ssue ); printf( CONFMT, off/SZCHAR ); printf( "\n" ); @@ -378,11 +398,7 @@ lcommdec(struct symtab *q) off = tsize(q->stype, q->sdf, q->ssue); off = (off+(SZCHAR-1))/SZCHAR; if (q->slevel == 0) -#ifdef GCC_COMPAT - printf(" .lcomm %s,0%o\n", gcc_findname(q), off); -#else - printf(" .lcomm %s,0%o\n", exname(q->sname), off); -#endif + printf(" .lcomm %s,0%o\n", exname(q->soname), off); else printf(" .lcomm " LABFMT ",0%o\n", q->soffset, off); } @@ -437,7 +453,7 @@ ninval(CONSZ off, int fsz, NODE *p) q->sclass == ILABEL) { printf("+" LABFMT, q->soffset); } else - printf("+%s", exname(q->sname)); + printf("+%s", exname(q->soname)); } printf("\n"); break; @@ -471,3 +487,19 @@ ninval(CONSZ off, int fsz, NODE *p) } } +/* + * Give target the opportunity of handling pragmas. + */ +int +mypragma(char **ary) +{ + return 0; } + +/* + * Called when a identifier has been declared, to give target last word. + */ +void +fixdef(struct symtab *sp) +{ +} + |