bucket *LabelTab [256] ; /* the Label table */
bucket *enumTab [256] ; /* enumerated table */
-extern struct set *publics;
-
/*------------------------------------------------------------------*/
/* initSymt () - initialises symbol table related stuff */
/*------------------------------------------------------------------*/
/*-----------------------------------------------------------------*/
/* hashKey - computes the hashkey given a symbol name */
/*-----------------------------------------------------------------*/
-int hashKey (char *s)
+int hashKey (const char *s)
{
unsigned long key = 0;
/*-----------------------------------------------------------------*/
/* findSym - finds a symbol in a table */
/*-----------------------------------------------------------------*/
-void *findSym ( bucket **stab, void *sym, char *sname)
+void *findSym ( bucket **stab, void *sym, const char *sname)
{
bucket *bp ;
SPEC_BLEN(dest) |= SPEC_BLEN(src);
SPEC_BSTR(dest) |= SPEC_BSTR(src);
SPEC_TYPEDEF(dest) |= SPEC_TYPEDEF(src);
+ SPEC_NONBANKED(dest) |= SPEC_NONBANKED(src);
if ( IS_STRUCT(dest) && SPEC_STRUCT(dest) == NULL )
SPEC_STRUCT(dest) = SPEC_STRUCT(src);
/* the storage class to reflect where the var will go */
if ( sym->level && SPEC_SCLS(sym->etype) == S_FIXED) {
if ( options.stackAuto || (currFunc && IS_RENT(currFunc->etype)))
+ {
SPEC_SCLS(sym->etype) = (options.useXstack ?
S_XSTACK : S_STACK ) ;
+ }
else
- SPEC_SCLS(sym->etype) = (options.useXstack ?
- S_XDATA :S_DATA ) ;
+ {
+ /* hack-o-matic! I see no reason why the useXstack option should ever
+ * control this allcoation, but the code was originally that way, and
+ * changing it for non-390 ports breaks the compiler badly.
+ */
+ bool useXdata = IS_DS390_PORT ? options.model : options.useXstack;
+ SPEC_SCLS(sym->etype) = (useXdata ?
+ S_XDATA : S_FIXED ) ;
+ }
}
}
deleteSym (SymbolTab,csym,csym->name);
addSym (SymbolTab,sym,sym->name,sym->level,sym->block);
if (IS_EXTERN(csym->etype) && !
- IS_EXTERN(sym->etype))
+ IS_EXTERN(sym->etype)) {
addSet(&publics,sym);
+ }
return 1 ;
}
/* if any of the arguments is an aggregate */
/* 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
not inhibited by command line option or #pragma */
if (!func->hasVargs &&
!options.noregparms &&
+ !IS_RENT(func->etype) &&
(*port->reg_parm)(val->type)) {
-
SPEC_REGPARM(val->etype) = 1;
}
sprintf(val->name,"_%s_PARM_%d",func->name,pNum++);
val->sym = newSymbol(val->name,1);
- SPEC_OCLS(val->etype) = (options.model ? xdata : data);
+ SPEC_OCLS(val->etype) = port->mem.default_local_map;
val->sym->type = copyLinkChain (val->type);
val->sym->etype = getSpec (val->sym->type);
val->sym->_isparm = 1;
int i ;
bucket **table = StructTab;
bucket *chain;
-
+ wassert(of);
+
/* go thru the entire table */
for ( i = 0 ; i < 256; i++ ) {
for ( chain = table[i]; chain ; chain = chain->next ) {
link *floatType;
+static void _makeRegParam(symbol *sym)
+{
+ value *val ;
+
+ val = sym->args; /* loop thru all the arguments */
+
+ /* reset regparm for the port */
+ (*port->reset_regparms)();
+ while (val) {
+ SPEC_REGPARM(val->etype) = 1;
+ sym->argStack -= getSize(val->type);
+ val = val->next ;
+ }
+}
+
/*-----------------------------------------------------------------*/
/* initCSupport - create functions for C support routines */
/*-----------------------------------------------------------------*/
ssu[su],
sbwd[bwd]);
__muldiv[muldivmod][bwd][su] = funcOfType(buffer, __multypes[bwd][su], __multypes[bwd][su], 2, options.intlong_rent);
+ SPEC_NONBANKED(__muldiv[muldivmod][bwd][su]->etype) = 1;
+ if (bwd < port->muldiv.force_reg_param_below)
+ _makeRegParam(__muldiv[muldivmod][bwd][su]);
}
}
}