op->key,
OP_LIVEFROM (op), OP_LIVETO (op),
OP_SYMBOL (op)->stack,
- op->isaddr, OP_SYMBOL (op)->isreqv, OP_SYMBOL (op)->remat,OP_SYMBOL(op)->noSpilLoc,
+ op->isaddr, OP_SYMBOL (op)->isreqv,
+ OP_SYMBOL (op)->remat,OP_SYMBOL(op)->noSpilLoc,
OP_SYMBOL(op)->ruonly
);
{
return (IN_DIRSPACE (SPEC_OCLS (etype)) ? TRUE : FALSE);
}
-/*-----------------------------------------------------------------*/
-/* isOperandOnStack - will return true if operand is on stack */
-/*-----------------------------------------------------------------*/
-#if 0
+/*--------------------------------------------------------------------*/
+/* isOperandInCodeSpace - will return true if operand is in codeSpace */
+/*--------------------------------------------------------------------*/
bool
-isOperandOnStack (operand * op)
+isOperandInCodeSpace (operand * op)
{
sym_link *etype;
if (!IS_SYMOP (op))
return FALSE;
- etype = getSpec (operandType (op));
-
- return ((IN_STACK (etype)) ? TRUE : FALSE);
+ if (!IS_TRUE_SYMOP (op))
+ {
+ if (SPIL_LOC (op))
+ etype = SPIL_LOC (op)->etype;
+ else
+ return FALSE;
+ }
+ else
+ {
+ etype = getSpec (operandType (op));
+ }
+ return (IN_CODESPACE (SPEC_OCLS (etype)) ? TRUE : FALSE);
}
-#else
+
+/*-----------------------------------------------------------------*/
+/* isOperandOnStack - will return true if operand is on stack */
+/*-----------------------------------------------------------------*/
bool
isOperandOnStack (operand * op)
{
return FALSE;
}
-#endif
/*-----------------------------------------------------------------*/
/* operandLitValue - literal value of an operand */
if (IS_PTR(type)) { // to a pointer
if (!IS_PTR(optype) && !IS_FUNC(optype) && !IS_AGGREGATE(optype)) { // from a non pointer
if (IS_INTEGRAL(optype)) {
- // maybe this is NULL, than it's ok.
+ // maybe this is NULL, than it's ok.
if (!(IS_LITERAL(optype) && (SPEC_CVAL(optype).v_ulong ==0))) {
if (!TARGET_IS_Z80 && !TARGET_IS_GBZ80 && IS_GENPTR(type)) {
// no way to set the storage
/* geniCodeAdd - generates iCode for addition */
/*-----------------------------------------------------------------*/
operand *
-geniCodeAdd (operand * left, operand * right,int lvl)
+geniCodeAdd (operand * left, operand * right, int lvl)
{
iCode *ic;
sym_link *resType;
if (IS_LITERAL (letype) && left->isLiteral && !floatFromVal (valFromType (letype)))
return right;
- /* if left is an array or pointer then size */
+ /* if left is a pointer then size */
if (IS_PTR (ltype))
{
isarray = left->isaddr;
resType = copyLinkChain (ltype);
}
else
- { /* make them the same size */
+ { // make them the same size
resType = usualBinaryConversions (&left, &right);
}
{
left = geniCodeRValue (left, FALSE);
}
- return geniCodeDerefPtr (geniCodeAdd (left, right,lvl),lvl);
+ return geniCodeDerefPtr (geniCodeAdd (left, right, lvl), lvl);
}
right = geniCodeMultiply (right,
geniCodeParms (parms, NULL, &stack, getSpec (operandType (left)), OP_SYMBOL (left),lvl);
/* now call : if symbol then pcall */
- if (IS_OP_POINTER (left) || IS_ITEMP(left))
+ if (IS_OP_POINTER (left) || IS_ITEMP(left)) {
ic = newiCode (PCALL, left, NULL);
- else
+ } else {
ic = newiCode (CALL, left, NULL);
+ }
type = copyLinkChain (operandType (left)->next);
etype = getSpec (type);