projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* as/mcs51/asdata.c: changed ctype['['] to BINOP
[fw/sdcc]
/
src
/
SDCCast.c
diff --git
a/src/SDCCast.c
b/src/SDCCast.c
index f9183db053285e7fc89127d9bf8fe2e55fa438b2..1d65bc7d783ce2766d4a6901c8f3eedd28854fcb 100644
(file)
--- a/
src/SDCCast.c
+++ b/
src/SDCCast.c
@@
-573,7
+573,7
@@
funcOfType (char *name, sym_link * type, sym_link * argType,
}
/* save it */
}
/* save it */
- addSymChain (sym);
+ addSymChain (
&
sym);
sym->cdef = 1;
allocVariables (sym);
return sym;
sym->cdef = 1;
allocVariables (sym);
return sym;
@@
-613,7
+613,7
@@
funcOfTypeVarg (char *name, char * rtype, int nArgs , char **atypes)
}
/* save it */
}
/* save it */
- addSymChain (sym);
+ addSymChain (
&
sym);
sym->cdef = 1;
allocVariables (sym);
return sym;
sym->cdef = 1;
allocVariables (sym);
return sym;
@@
-1283,7
+1283,7
@@
stringToSymbol (value * val)
if (noAlloc == 0)
{
/* allocate it */
if (noAlloc == 0)
{
/* allocate it */
- addSymChain (sym);
+ addSymChain (
&
sym);
allocVariables (sym);
}
sym->ival = NULL;
allocVariables (sym);
}
sym->ival = NULL;
@@
-2098,7
+2098,8
@@
addCast (ast *tree, RESULT_TYPE resultType, bool upcast)
break;
case RESULT_TYPE_CHAR:
if (IS_CHAR (tree->etype) ||
break;
case RESULT_TYPE_CHAR:
if (IS_CHAR (tree->etype) ||
- IS_FLOAT(tree->etype))
+ IS_FLOAT(tree->etype) ||
+ IS_FIXED(tree->etype))
return tree;
newLink = newCharLink();
break;
return tree;
newLink = newCharLink();
break;
@@
-2147,6
+2148,9
@@
resultTypePropagate (ast *tree, RESULT_TYPE resultType)
{
switch (tree->opval.op)
{
{
switch (tree->opval.op)
{
+ case AND_OP:
+ case OR_OP:
+ return resultType;
case '=':
case '?':
case ':':
case '=':
case '?':
case ':':
@@
-3401,7
+3405,7
@@
decorateType (ast * tree, RESULT_TYPE resultType)
return tree;
}
LRVAL (tree) = 1;
return tree;
}
LRVAL (tree) = 1;
- TTYPE (tree) = TETYPE (tree) =
newCharLink
();
+ TTYPE (tree) = TETYPE (tree) =
(resultTypeProp == RESULT_TYPE_BIT) ? newBoolLink() :newCharLink
();
return tree;
/*------------------------------------------------------------------*/
return tree;
/*------------------------------------------------------------------*/
@@
-3416,7
+3420,7
@@
decorateType (ast * tree, RESULT_TYPE resultType)
return tree;
case GETHBIT:
return tree;
case GETHBIT:
- TTYPE (tree) = TETYPE (tree) =
newCharLink
();
+ TTYPE (tree) = TETYPE (tree) =
(resultTypeProp == RESULT_TYPE_BIT) ? newBoolLink() :newCharLink
();
return tree;
case LEFT_OP:
return tree;
case LEFT_OP:
@@
-3581,10
+3585,8
@@
decorateType (ast * tree, RESULT_TYPE resultType)
gptype = GPTYPE_FAR;
break;
case S_DATA:
gptype = GPTYPE_FAR;
break;
case S_DATA:
- gptype = GPTYPE_NEAR;
- break;
case S_IDATA:
case S_IDATA:
- gptype = GPTYPE_
IDATA
;
+ gptype = GPTYPE_
NEAR
;
break;
case S_PDATA:
gptype = GPTYPE_XSTACK;
break;
case S_PDATA:
gptype = GPTYPE_XSTACK;
@@
-3736,7
+3738,7
@@
decorateType (ast * tree, RESULT_TYPE resultType)
return tree;
}
LRVAL (tree) = RRVAL (tree) = 1;
return tree;
}
LRVAL (tree) = RRVAL (tree) = 1;
- TTYPE (tree) = TETYPE (tree) =
newCharLink
();
+ TTYPE (tree) = TETYPE (tree) =
(resultTypeProp == RESULT_TYPE_BIT) ? newBoolLink() :newCharLink
();
return tree;
/*------------------------------------------------------------------*/
return tree;
/*------------------------------------------------------------------*/
@@
-3879,6
+3881,9
@@
decorateType (ast * tree, RESULT_TYPE resultType)
case V_FLOAT:
typeofv = TYPEOF_FLOAT;
break;
case V_FLOAT:
typeofv = TYPEOF_FLOAT;
break;
+ case V_FIXED16X16:
+ typeofv = TYPEOF_FIXED16X16;
+ break;
case V_CHAR:
typeofv = TYPEOF_CHAR;
break;
case V_CHAR:
typeofv = TYPEOF_CHAR;
break;
@@
-4180,8
+4185,7
@@
decorateType (ast * tree, RESULT_TYPE resultType)
}
/* require a function or pointer to function */
}
/* require a function or pointer to function */
- if (!IS_FUNC (LTYPE (tree))
- && !(IS_CODEPTR (LTYPE (tree)) && IS_FUNC (LTYPE (tree)->next)))
+ if (!IS_FUNC (LTYPE (tree)) && !IS_FUNCPTR (LTYPE (tree)))
{
werrorfl (tree->filename, tree->lineno, E_FUNCTION_EXPECTED);
goto errorTreeReturn;
{
werrorfl (tree->filename, tree->lineno, E_FUNCTION_EXPECTED);
goto errorTreeReturn;
@@
-4195,7
+4199,7
@@
decorateType (ast * tree, RESULT_TYPE resultType)
sym_link *functype;
parmNumber = 1;
sym_link *functype;
parmNumber = 1;
- if (IS_
CODEPTR(LTYPE
(tree)))
+ if (IS_
FUNCPTR (LTYPE
(tree)))
functype = LTYPE (tree)->next;
else
functype = LTYPE (tree);
functype = LTYPE (tree)->next;
else
functype = LTYPE (tree);
@@
-5343,7
+5347,7
@@
createFunction (symbol * name, ast * body)
}
else
{
}
else
{
- addSymChain (name);
+ addSymChain (
&
name);
allocVariables (name);
}
name->lastLine = mylineno;
allocVariables (name);
}
name->lastLine = mylineno;
@@
-5351,7
+5355,7
@@
createFunction (symbol * name, ast * body)
/* set the stack pointer */
stackPtr = -port->stack.direction * port->stack.call_overhead;
/* set the stack pointer */
stackPtr = -port->stack.direction * port->stack.call_overhead;
- xstackPtr =
-port->stack.direction * port->stack.call_overhead
;
+ xstackPtr =
0
;
if (IFFUNC_ISISR (name->type))
stackPtr -= port->stack.direction * port->stack.isr_overhead;
if (IFFUNC_ISISR (name->type))
stackPtr -= port->stack.direction * port->stack.isr_overhead;