projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed Z80 port - crt0.o: cannot open.
[fw/sdcc]
/
src
/
SDCCast.c
diff --git
a/src/SDCCast.c
b/src/SDCCast.c
index fae7603b018357613382957213e2ce2a961a3baf..1399fbd8b2ffa2fbcafed208873de860c078ef59 100644
(file)
--- a/
src/SDCCast.c
+++ b/
src/SDCCast.c
@@
-78,7
+78,7
@@
newAst_ (unsigned type)
ex = Safe_alloc ( sizeof (ast));
ex->type = type;
ex = Safe_alloc ( sizeof (ast));
ex->type = type;
- ex->lineno = (noLineno ? oldLineno :
y
ylineno);
+ ex->lineno = (noLineno ? oldLineno :
m
ylineno);
ex->filename = currFname;
ex->level = NestLevel;
ex->block = currBlockno;
ex->filename = currFname;
ex->level = NestLevel;
ex->block = currBlockno;
@@
-110,14
+110,6
@@
newAst_LINK (sym_link * val)
return ex;
}
return ex;
}
-ast *
-newAst_STMNT (unsigned val)
-{
- ast *ex = newAst_ (EX_STMNT);
- ex->opval.stmnt = val;
- return ex;
-}
-
/*-----------------------------------------------------------------*/
/* newNode - creates a new node */
/*-----------------------------------------------------------------*/
/*-----------------------------------------------------------------*/
/* newNode - creates a new node */
/*-----------------------------------------------------------------*/
@@
-1287,6
+1279,8
@@
bool constExprTree (ast *cexpr) {
if (constExprTree(cexpr->left) && constExprTree(cexpr->right)) {
return TRUE;
}
if (constExprTree(cexpr->left) && constExprTree(cexpr->right)) {
return TRUE;
}
+ case EX_OPERAND:
+ return IS_CONSTANT(operandType(cexpr->opval.oprnd));
}
return FALSE;
}
}
return FALSE;
}
@@
-3232,7
+3226,6
@@
decorateType (ast * tree)
{
werror (E_TYPE_MISMATCH, "assignment", " ");
printFromToType(RTYPE(tree),LTYPE(tree));
{
werror (E_TYPE_MISMATCH, "assignment", " ");
printFromToType(RTYPE(tree),LTYPE(tree));
- //goto errorTreeReturn;
}
/* if the left side of the tree is of type void
}
/* if the left side of the tree is of type void
@@
-3283,12
+3276,15
@@
decorateType (ast * tree)
if ((options.stackAuto || IFFUNC_ISREENT (LTYPE (tree))) &&
!IFFUNC_ISBUILTIN(LTYPE(tree)))
{
if ((options.stackAuto || IFFUNC_ISREENT (LTYPE (tree))) &&
!IFFUNC_ISBUILTIN(LTYPE(tree)))
{
- //FUNC_ARGS(tree->left->ftype) =
- //reverseVal (FUNC_ARGS(tree->left->ftype));
reverseParms (tree->right);
}
reverseParms (tree->right);
}
- TETYPE (tree) = getSpec (TTYPE (tree) = LTYPE (tree)->next);
+ if (IS_CODEPTR(LTYPE(tree))) {
+ TTYPE(tree) = LTYPE(tree)->next->next;
+ } else {
+ TTYPE(tree) = LTYPE(tree)->next;
+ }
+ TETYPE (tree) = getSpec (TTYPE (tree));
return tree;
/*------------------------------------------------------------------*/
return tree;
/*------------------------------------------------------------------*/
@@
-3330,7
+3326,7
@@
decorateType (ast * tree)
if (!IS_VOID (currFunc->type->next) && tree->right == NULL)
{
if (!IS_VOID (currFunc->type->next) && tree->right == NULL)
{
- werror (
E
_VOID_FUNC, currFunc->name);
+ werror (
W
_VOID_FUNC, currFunc->name);
goto errorTreeReturn;
}
goto errorTreeReturn;
}
@@
-4318,7
+4314,7
@@
createFunction (symbol * name, ast * body)
addSymChain (name);
allocVariables (name);
}
addSymChain (name);
allocVariables (name);
}
- name->lastLine =
y
ylineno;
+ name->lastLine =
m
ylineno;
currFunc = name;
/* set the stack pointer */
currFunc = name;
/* set the stack pointer */