DCL_TYPE (ptr) = EEPPOINTER;
break;
default:
- DCL_TYPE (ptr) = GPOINTER;
+ DCL_TYPE (ptr) = port->unqualified_pointer;
break;
}
/* the storage class of type ends here */
while (ptr)
{
if (!IS_SPEC (ptr) && DCL_TYPE (ptr) == UPOINTER)
- DCL_TYPE (ptr) = GPOINTER;
+ DCL_TYPE (ptr) = port->unqualified_pointer;
ptr = ptr->next;
}
while (type)
{
if (!IS_SPEC (type) && DCL_TYPE (type) == UPOINTER)
- DCL_TYPE (type) = GPOINTER;
+ DCL_TYPE (type) = port->unqualified_pointer;
type = type->next;
}
FUNC_ISREENT(dest) |= FUNC_ISREENT(src);
FUNC_ISNAKED(dest) |= FUNC_ISNAKED(src);
FUNC_ISISR(dest) |= FUNC_ISISR(src);
+ FUNC_ISJAVANATIVE(dest) |= FUNC_ISJAVANATIVE(src);
+ FUNC_ISBUILTIN(dest) |= FUNC_ISBUILTIN(src);
+ FUNC_ISOVERLAY(dest) |= FUNC_ISOVERLAY(src);
FUNC_INTNO(dest) |= FUNC_INTNO(src);
FUNC_REGBANK(dest) |= FUNC_REGBANK(src);
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:
}
/* delete current entry */
deleteSym (SymbolTab, csym, csym->name);
+ deleteFromSeg(csym);
} else {
/* not extern */
werror (E_DUPLICATE, sym->name);
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 */
SPEC_VOLATILE (sym->etype) = 1;
/* global variables declared const put into code */
+ /* if no other storage class specified */
if (sym->level == 0 &&
- SPEC_CONST (sym->etype)) {
+ SPEC_CONST (sym->etype) &&
+ SPEC_SCLS(sym->etype) == S_FIXED) {
SPEC_SCLS (sym->etype) = S_CODE;
}
for (p = sym->type; p; p = p->next)
{
if (!IS_SPEC (p) && DCL_TYPE (p) == UPOINTER)
- DCL_TYPE (p) = GPOINTER;
+ DCL_TYPE (p) = port->unqualified_pointer;
if (IS_PTR (p) && IS_FUNC (p->next))
DCL_TYPE (p) = CPOINTER;
}
} else {
#if 1
// this happens for (external) function parameters
- DCL_TYPE (val->type) = GPOINTER;
+ DCL_TYPE (val->type) = port->unqualified_pointer;
#else
if (TARGET_IS_DS390) {
/* The AUTO and REGISTER classes should probably
* also become generic pointers, but I haven't yet
* devised a test case for that.
*/
- DCL_TYPE (val->type) = GPOINTER;
+ DCL_TYPE (val->type) = port->unqualified_pointer;
break;
}
if (options.model==MODEL_LARGE) {
DCL_TYPE (val->type) = EEPPOINTER;
break;
default:
- DCL_TYPE (val->type) = GPOINTER;
+ DCL_TYPE (val->type) = port->unqualified_pointer;
}
/* is there is a symbol associated then */
/* replace with this defition */
sym->cdef = csym->cdef;
deleteSym (SymbolTab, csym, csym->name);
+ deleteFromSeg(csym);
addSym (SymbolTab, sym, sym->name, sym->level, sym->block, 1);
if (IS_EXTERN (csym->etype) && !
IS_EXTERN (sym->etype))
/* 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 */
SPEC_NOUN(r) = V_VOID;
break;
case '*':
- DCL_TYPE(r) = GPOINTER;
+ DCL_TYPE(r) = port->unqualified_pointer;
break;
case 'g':
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;
sym = funcOfTypeVarg(port->builtintable[i].name,port->builtintable[i].rtype,
port->builtintable[i].nParms,port->builtintable[i].parm_types);
FUNC_ISBUILTIN(sym->type) = 1;
+ FUNC_ISREENT(sym->type) = 0; /* can never be reentrant */
}
}