/* if this function has variable argument list */
/* then make the function a reentrant one */
- if (IFFUNC_HASVARARGS(funcType))
+ if (IFFUNC_HASVARARGS(funcType) || options.stackAuto)
FUNC_ISREENT(funcType)=1;
/* check if this function is defined as calleeSaves
(*port->reg_parm) (val->type))
{
SPEC_REGPARM (val->etype) = 1;
+ } else if (IFFUNC_ISREENT(funcType)) {
+ FUNC_HASSTACKPARM(funcType) = 1;
}
if (IS_AGGREGATE (val->type))
/* 'x' - xdata */
/* 'p' - code */
/* 'd' - data */
+/* 'F' - function */
/* examples : "ig*" - generic int * */
/* "cx*" - char xdata * */
/* "ui" - unsigned int */
case 'x':
case 'p':
case 'd':
+ case 'F':
assert(*(s+1)=='*');
nr = newLink();
nr->next = r;
case 'd':
DCL_TYPE(r) = POINTER;
break;
+ case 'F':
+ DCL_TYPE(r) = FUNCTION;
+ nr = newLink();
+ nr->next = r;
+ r = nr;
+ r->class = DECLARATOR ;
+ DCL_TYPE(r) = CPOINTER;
+ break;
}
s++;
break;
unsigned builtin; /* is a builtin function */
unsigned javaNative; /* is a JavaNative Function (TININative ONLY) */
unsigned overlay; /* force parameters & locals into overlay segment */
+ unsigned hasStackParms; /* function has parameters on stack */
} funcAttrs;
struct sym_link *next; /* next element on the chain */
#define IFFUNC_RBANK(x) (IS_FUNC(x) && FUNC_RBANK(x))
#define FUNC_INTNO(x) (x->funcAttrs.intno)
#define FUNC_REGBANK(x) (x->funcAttrs.regbank)
+#define FUNC_HASSTACKPARM(x) (x->funcAttrs.hasStackParms)
#define FUNC_ISREENT(x) (x->funcAttrs.reent)
#define IFFUNC_ISREENT(x) (IS_FUNC(x) && FUNC_ISREENT(x))
#define FUNC_ISOVERLAY(x) (x->funcAttrs.overlay)
#define IFFUNC_ISOVERLAY(x) (IS_FUNC(x) && FUNC_ISOVERLAY(x))
+
// jwk: I am not sure about this
#define IFFUNC_ISBANKEDCALL(x) (!IFFUNC_NONBANKED(x) && \
(options.model == MODEL_LARGE || \