changes to handle multiple sends & receives
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 30 Jan 2002 04:36:55 +0000 (04:36 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 30 Jan 2002 04:36:55 +0000 (04:36 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1869 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCsymt.c
src/SDCCsymt.h

index a67aa47fb5b17cd335f148c5399fa5be208efe08..9ef1a688e2ba48ffef29e3acfe35be3b7a155509 100644 (file)
@@ -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:
index be2c19b9de189b7991c327d058b3add1c7f3a372..da96ada5c5d6ed6b1ed15fb56a846e6f920c3847 100644 (file)
@@ -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     )