git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1869
4a8a32a2-be11-0410-ad9d-
d568d2c75423
SPEC_BSTR (dest) |= SPEC_BSTR (src);
SPEC_TYPEDEF (dest) |= SPEC_TYPEDEF (src);
SPEC_ENUM (dest) |= SPEC_ENUM (src);
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);
if (IS_STRUCT (dest) && SPEC_STRUCT (dest) == NULL)
SPEC_STRUCT (dest) = SPEC_STRUCT (src);
/* change it to pointer to the same type */
while (val)
{
/* change it to pointer to the same type */
while (val)
{
/* mark it as a register parameter if
the function does not have VA_ARG
and as port dictates */
if (!IFFUNC_HASVARARGS(funcType) &&
/* 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_REGPARM (val->etype) = 1;
+ SPEC_ARGREG(val->etype) = argreg;
} else if (IFFUNC_ISREENT(funcType)) {
FUNC_HASSTACKPARM(funcType) = 1;
}
} else if (IFFUNC_ISREENT(funcType)) {
FUNC_HASSTACKPARM(funcType) = 1;
}
fprintf (of, "unsigned ");
if (SPEC_CONST (type))
fprintf (of, "const ");
fprintf (of, "unsigned ");
if (SPEC_CONST (type))
fprintf (of, "const ");
switch (SPEC_NOUN (type))
{
case V_INT:
switch (SPEC_NOUN (type))
{
case V_INT:
unsigned _stack; /* stack offset for stacked v */
unsigned _bitStart; /* bit start position */
int _bitLength; /* bit length */
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 */
union
{ /* Values if constant or enum */
short int v_int; /* int and char values */
ACCUSE_A and ACCUSE_HL as the idea
is quite similar.
*/
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 */
int allocreq ; /* allocation is required for this variable */
int stack; /* offset on stack */
int xstack; /* offset on xternal stack */
#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_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 )
/* type check macros */
#define IS_DECL(x) ( x && x->class == DECLARATOR )