{IFX, "if", picIfx, NULL},
{INLINEASM, "", picInline, NULL},
{RECEIVE, "recv", picReceive, NULL},
- {SEND, "send", picGenericOne, NULL}
+ {SEND, "send", picGenericOne, NULL},
+ {ARRAYINIT, "arrayInit", picGenericOne, NULL},
};
{
iCode *ic;
+ if (IS_VOID(OP_SYMBOL(condition)->type)) {
+ werror(E_VOID_VALUE_USED);
+ }
+
ic = newiCode (IFX, NULL, NULL);
IC_COND (ic) = condition;
IC_TRUE (ic) = trueLabel;
IC_INLINE (nic) = IC_INLINE (ic);
break;
+ case ARRAYINIT:
+ IC_ARRAYILIST(nic) = IC_ARRAYILIST(ic);
+ break;
+
default:
IC_RESULT (nic) = operandFromOperand (IC_RESULT (ic));
IC_LEFT (nic) = operandFromOperand (IC_LEFT (ic));
/* under the following conditions create a
register equivalent for a local symbol */
if (sym->level && sym->etype && SPEC_OCLS (sym->etype) &&
- (IN_FARSPACE (SPEC_OCLS (sym->etype)) && (!TARGET_IS_DS390)) &&
+ (IN_FARSPACE (SPEC_OCLS (sym->etype)) &&
+ /* (!TARGET_IS_DS390)) && */
+ (!(options.model == MODEL_FLAT24)) ) &&
options.stackAuto == 0)
ok = 0;
if (IS_SPEC (type) &&
IS_TRUE_SYMOP (op) &&
- (!IN_FARSPACE (SPEC_OCLS (etype)) || TARGET_IS_DS390))
+ (!IN_FARSPACE (SPEC_OCLS (etype)) ||
+ /* TARGET_IS_DS390)) */
+ (options.model == MODEL_FLAT24) ))
{
op = operandFromOperand (op);
op->isaddr = 0;
(DCL_TYPE (optype) != DCL_TYPE (type)) &&
!IS_GENPTR (type))
{
- werror (E_INCOMPAT_CAST);
+ werror (W_INCOMPAT_CAST);
fprintf (stderr, "from type '");
printTypeChain (optype, stderr);
fprintf (stderr, "' to type '");
/* if this is not an address we have trouble */
if (!op->isaddr)
{
- werror (E_LVALUE_REQUIRED, "++");
+ werror (E_LVALUE_REQUIRED, "--");
return op;
}
if (!op->isaddr)
{
- werror (E_LVALUE_REQUIRED, "++");
+ werror (E_LVALUE_REQUIRED, "--");
return op;
}
/* left is integral type and right is literal then
check if the literal value is within bounds */
- if (IS_INTEGRAL (ltype) && IS_LITERAL (rtype))
+ if (IS_INTEGRAL (ltype) && IS_VALOP (right) && IS_LITERAL (rtype))
{
int nbits = bitsForType (ltype);
long v = (long) operandLitValue (right);
sym_link *type, *etype;
int stack = 0;
+ if (!IS_FUNC(OP_SYMBOL(left)->type) &&
+ !IS_CODEPTR(OP_SYMBOL(left)->type)) {
+ werror (E_FUNCTION_EXPECTED);
+ return NULL;
+ }
+
/* take care of parameters with side-effecting
function calls in them, this is required to take care
of overlaying function parameters */
if (IN_FARSPACE (SPEC_OCLS (sym->etype)) &&
options.stackAuto == 0 &&
- !TARGET_IS_DS390)
+ /* !TARGET_IS_DS390) */
+ (!(options.model == MODEL_FLAT24)) )
{
}
else
ADDTOCHAIN (ic);
}
+/*-----------------------------------------------------------------*/
+/* geniCodeArrayInit - intermediate code for array initializer */
+/*-----------------------------------------------------------------*/
+static void
+geniCodeArrayInit (ast * tree, operand *array)
+{
+ iCode *ic;
+
+ if (!getenv("TRY_THE_NEW_INITIALIZER")) {
+ ic = newiCode (ARRAYINIT, array, NULL);
+ IC_ARRAYILIST (ic) = tree->values.constlist;
+ } else {
+ operand *left=newOperand(), *right=newOperand();
+ left->type=right->type=SYMBOL;
+ OP_SYMBOL(left)=AST_SYMBOL(tree->left);
+ OP_SYMBOL(right)=AST_SYMBOL(tree->right);
+ ic = newiCode (ARRAYINIT, left, right);
+ }
+ ADDTOCHAIN (ic);
+}
+
/*-----------------------------------------------------------------*/
/* Stuff used in ast2iCode to modify geniCodeDerefPtr in some */
/* particular case. Ie : assigning or dereferencing array or ptr */
case INLINEASM:
geniCodeInline (tree);
return NULL;
+
+ case ARRAYINIT:
+ geniCodeArrayInit(tree, ast2iCode (tree->left,lvl+1));
+ return NULL;
}
return NULL;