if (DCL_ELEM(p)) {
return DCL_ELEM (p) * getSize (p->next);
} else {
- werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
- "can not tell the size of an array[]");
+ // werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
+ // "can not tell the size of an array[]");
return 0;
}
case IPOINTER:
sum += getSize (loop->type);
}
-#if 0 // jwk: this is done now in addDecl()
- /* if function then do the arguments for it */
- if (funcInChain (loop->type)) {
- processFuncArgs (loop);
- }
-#endif
-
loop = loop->next;
/* if this is not a bitfield but the */
/* 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->cdef))
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))
switch (DCL_TYPE (type))
{
case FUNCTION:
- fprintf (of, "function %s", (IFFUNC_ISBUILTIN(type) ? "__builtin__" : " "));
+ fprintf (of, "function %s %s",
+ (IFFUNC_ISBUILTIN(type) ? "__builtin__" : " "),
+ (IFFUNC_ISJAVANATIVE(type) ? "_JavaNative" : " "));
break;
case GPOINTER:
if (DCL_PTR_CONST (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;