From: sandeep Date: Wed, 30 Jan 2002 04:36:55 +0000 (+0000) Subject: changes to handle multiple sends & receives X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c3bf2d8fd69b69dcf7564d3e24cd045d2bcc385c;p=fw%2Fsdcc changes to handle multiple sends & receives git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1869 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index a67aa47f..9ef1a688 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -622,7 +622,9 @@ mergeSpec (sym_link * dest, sym_link * src, char *name) SPEC_BSTR (dest) |= SPEC_BSTR (src); SPEC_TYPEDEF (dest) |= SPEC_TYPEDEF (src); SPEC_ENUM (dest) |= SPEC_ENUM (src); - + if (SPEC_ARGREG(src) && !SPEC_ARGREG(dest)) + SPEC_ARGREG(dest) = SPEC_ARGREG(src); + if (IS_STRUCT (dest) && SPEC_STRUCT (dest) == NULL) SPEC_STRUCT (dest) = SPEC_STRUCT (src); @@ -1842,13 +1844,15 @@ processFuncArgs (symbol * func) /* change it to pointer to the same type */ while (val) { + int argreg = 0; /* mark it as a register parameter if the function does not have VA_ARG and as port dictates */ if (!IFFUNC_HASVARARGS(funcType) && - (*port->reg_parm) (val->type)) + (argreg = (*port->reg_parm) (val->type))) { SPEC_REGPARM (val->etype) = 1; + SPEC_ARGREG(val->etype) = argreg; } else if (IFFUNC_ISREENT(funcType)) { FUNC_HASSTACKPARM(funcType) = 1; } @@ -2047,7 +2051,6 @@ printTypeChain (sym_link * start, FILE * of) fprintf (of, "unsigned "); if (SPEC_CONST (type)) fprintf (of, "const "); - switch (SPEC_NOUN (type)) { case V_INT: diff --git a/src/SDCCsymt.h b/src/SDCCsymt.h index be2c19b9..da96ada5 100644 --- a/src/SDCCsymt.h +++ b/src/SDCCsymt.h @@ -132,7 +132,7 @@ typedef struct specifier unsigned _stack; /* stack offset for stacked v */ unsigned _bitStart; /* bit start position */ int _bitLength; /* bit length */ - + int argreg; /* reg no for regparm */ union { /* Values if constant or enum */ short int v_int; /* int and char values */ @@ -264,7 +264,9 @@ typedef struct symbol ACCUSE_A and ACCUSE_HL as the idea is quite similar. */ - + unsigned dptr; /* 8051 variants with multiple DPTRS + currently implemented in DS390 only + */ int allocreq ; /* allocation is required for this variable */ int stack; /* offset on stack */ int xstack; /* offset on xternal stack */ @@ -380,6 +382,7 @@ symbol; #define SPEC_STRUCT(x) x->select.s.v_struct #define SPEC_TYPEDEF(x) x->select.s._typedef #define SPEC_REGPARM(x) x->select.s._isregparm +#define SPEC_ARGREG(x) x->select.s.argreg /* type check macros */ #define IS_DECL(x) ( x && x->class == DECLARATOR )