sym = Safe_alloc ( sizeof (symbol));
- strncpyz (sym->name, name, sizeof(sym->name)); /* copy the name */
- sym->level = scope; /* set the level */
+ strncpyz (sym->name, name, sizeof(sym->name)); /* copy the name */
+ sym->level = scope; /* set the level */
sym->block = currBlockno;
- sym->lineDef = lineno; /* set the line number */
- sym->fileDef = filename;
+ sym->lineDef = lexLineno; /* set the line number */
+ sym->fileDef = lexFilename;
return sym;
}
dest->select.s.b_signed|=src->select.s.b_signed;
SPEC_STAT (dest) |= SPEC_STAT (src);
SPEC_EXTR (dest) |= SPEC_EXTR (src);
+ SPEC_INLINE (dest) |= SPEC_INLINE (src);
SPEC_CONST(dest) |= SPEC_CONST (src);
SPEC_ABSA (dest) |= SPEC_ABSA (src);
SPEC_VOLATILE (dest) |= SPEC_VOLATILE (src);
FUNC_ISOVERLAY(dest) |= FUNC_ISOVERLAY(src);
FUNC_INTNO(dest) |= FUNC_INTNO(src);
FUNC_REGBANK(dest) |= FUNC_REGBANK(src);
+ FUNC_ISINLINE (dest) |= FUNC_ISINLINE (src);
return dest;
}
if (!sym->level && !(IS_SPEC(sym->etype) && IS_TYPEDEF(sym->etype)))
checkDecl (sym, 0);
+ else
+ {
+ /* if this is an array without any dimension
+ then update the dimension from the initial value */
+ if (IS_ARRAY (sym->type) && !DCL_ELEM (sym->type))
+ DCL_ELEM (sym->type) = getNelements (sym->type, sym->ival);
+ }
/* if already exists in the symbol table then check if
- one of them is an extern definition if yes then
- then check if the type match, if the types match then
- delete the current entry and add the new entry */
+ one of them is an extern definition;
+ if yes then then check if the type match;
+ if the types match then delete the current entry and
+ add the new entry */
if ((csym = findSymWithLevel (SymbolTab, sym)) &&
csym->level == sym->level)
{
/* automatic symbols cannot be given */
/* an absolute address ignore it */
- if (sym->level &&
+ if (sym->level && !IS_STATIC(sym->etype) &&
SPEC_ABSA (sym->etype) &&
(options.stackAuto || reentrant))
{
switch (resultType)
{
+ case RESULT_TYPE_IFX:
+ if (TARGET_IS_HC08)
+ break;
+ //fallthrough
+ case RESULT_TYPE_BIT:
+ if (op == ':')
+ {
+ SPEC_NOUN (reType) = V_BIT;
+ return rType;
+ }
+ break;
case RESULT_TYPE_CHAR:
if (IS_BITVAR (reType))
{
return compareType (dest->next, src->next);
}
- if (DCL_TYPE (src) == DCL_TYPE (dest)) {
- if (IS_FUNC(src)) {
- //checkFunction(src,dest);
+ if (DCL_TYPE (src) == DCL_TYPE (dest))
+ {
+ if (IS_FUNC(src))
+ {
+ //checkFunction(src,dest);
+ }
+ return compareType (dest->next, src->next);
+ }
+ if (IS_PTR (dest) && IS_GENPTR (src) && IS_VOID(src->next))
+ {
+ return -1;
}
- return compareType (dest->next, src->next);
- }
- if (IS_PTR (dest) && IS_GENPTR (src) && IS_VOID(src->next)) {
- return -1;
- }
if (IS_PTR (src) &&
(IS_GENPTR (dest) ||
((DCL_TYPE(src) == POINTER) && (DCL_TYPE(dest) == IPOINTER))
))
return -1;
- if (IS_PTR (dest) && IS_ARRAY (src)) {
- value *val=aggregateToPointer (valFromType(src));
- int res=compareType (dest, val->type);
- Safe_free(val->type);
- Safe_free(val);
- return res;
- }
+ if (IS_PTR (dest) && IS_ARRAY (src))
+ {
+ value *val=aggregateToPointer (valFromType(src));
+ int res=compareType (dest, val->type);
+ Safe_free(val->type);
+ Safe_free(val);
+ return res;
+ }
if (IS_PTR (dest) && IS_FUNC (dest->next) && IS_FUNC (src))
return compareType (dest->next, src);
return 0;
instead of the next two lines, but the regression tests fail with
them; I guess it's a problem with replaceCheaperOp */
getSize (dest) == getSize (src) &&
- !(!IS_BIT (dest) && IS_BIT (src)))
+ (IS_BIT (dest) == IS_BIT (src)))
return 1;
else if (IS_ARITHMETIC (dest) && IS_ARITHMETIC (src))
return -1;
}
/*-----------------------------------------------------------------*/
-/* aggregateToPointer: change an agggregate type function */
-/* argument to a pointer to that type. */
+/* aggregateToPointer: change an aggregate type function */
+/* argument to a pointer to that type. */
/*-----------------------------------------------------------------*/
value *
aggregateToPointer (value * val)
werror(E_SYNTAX_ERROR, sym->name);
return 0;
}
-
+
+ /* move inline specifier from return type to function attributes */
+ if (IS_INLINE (sym->etype))
+ {
+ SPEC_INLINE (sym->etype) = 0;
+ FUNC_ISINLINE (sym->type) = 1;
+ }
+
/* make sure the type is complete and sane */
checkTypeSanity(((symbol *)sym)->etype, ((symbol *)sym)->name);
werror (E_SHADOWREGS_NO_ISR, sym->name);
}
-
for (argCnt=1, acargs = FUNC_ARGS(sym->type);
acargs;
acargs=acargs->next, argCnt++) {
werror (E_PREV_DEF_CONFLICT, csym->name, "using");
}
+ /*JCF: Mark the register bank as used*/
+ RegBankUsed[FUNC_REGBANK (sym->type)] = 1;
+
if (IFFUNC_ISNAKED (csym->type) != IFFUNC_ISNAKED (sym->type))
{
werror (E_PREV_DEF_CONFLICT, csym->name, "_naked");
if (DCL_PTR_CONST (type)) {
dbuf_append_str (dbuf, "const-");
}
+ if (DCL_PTR_RESTRICT (type)) {
+ dbuf_append_str (dbuf, "restrict-");
+ }
}
switch (DCL_TYPE (type))
{
if (DCL_PTR_CONST (type)) {
fprintf (of, "const-");
}
+ if (DCL_PTR_RESTRICT (type)) {
+ fprintf (of, "restrict-");
+ }
}
switch (DCL_TYPE (type))
{
case FUNCTION:
+ if (IFFUNC_ISINLINE(type)) {
+ fprintf (of, "inline-");
+ }
fprintf (of, "function %s %s",
(IFFUNC_ISBUILTIN(type) ? "__builtin__" : " "),
(IFFUNC_ISJAVANATIVE(type) ? "_JavaNative" : " "));
/* Determine the range of the enumerated values */
sym = enumlist;
- min = max = (int) floatFromVal (valFromType (sym->type));
+ min = max = (int) ulFromVal (valFromType (sym->type));
for (sym = sym->next; sym; sym = sym->next)
{
- v = (int) floatFromVal (valFromType (sym->type));
+ v = (int) ulFromVal (valFromType (sym->type));
if (v<min)
min = v;
if (v>max)