PRINTFUNC (picJumpTable);
PRINTFUNC (picInline);
PRINTFUNC (picReceive);
+PRINTFUNC (picDummyRead);
iCodeTable codeTable[] =
{
{RECEIVE, "recv", picReceive, NULL},
{SEND, "send", picGenericOne, NULL},
{ARRAYINIT, "arrayInit", picGenericOne, NULL},
+ {DUMMY_READ_VOLATILE, "dummy = (volatile)", picDummyRead, NULL}
};
/*-----------------------------------------------------------------*/
pedantic>1: "char c=200" is not allowed (evaluates to -56)
*/
-void checkConstantRange(sym_link *ltype, value *val, char *msg,
+void checkConstantRange(sym_link *ltype, value *val, char *msg,
int pedantic) {
double max;
int warnings=0;
fprintf (of, "\n");
}
+PRINTFUNC (picDummyRead)
+{
+ fprintf (of, "\t");
+ fprintf (of, "%s ", s);
+ printOperand (IC_RIGHT (ic), of);
+ fprintf (of, "\n");
+}
+
/*-----------------------------------------------------------------*/
/* piCode - prints one iCode */
/*-----------------------------------------------------------------*/
-int
+int
piCode (void *item, FILE * of)
{
iCode *ic = item;
/*-----------------------------------------------------------------*/
/* printiCChain - prints intermediate code for humans */
/*-----------------------------------------------------------------*/
-void
+void
printiCChain (iCode * icChain, FILE * of)
{
iCode *loop;
iCodeTable *
getTableEntry (int oper)
{
- int i;
+ unsigned i;
for (i = 0; i < (sizeof (codeTable) / sizeof (iCodeTable)); i++)
if (oper == codeTable[i].icode)
{
sym_link *let , *ret=NULL;
operand *retval = (operand *) 0;
-
+
assert (isOperandLiteral (left));
let = getSpec(operandType(left));
if (right) {
werror (E_DIVIDE_BY_ZERO);
retval = right;
}
- else
- retval = operandFromLit ((SPEC_USIGN(let) ?
+ else
+ retval = operandFromLit ((SPEC_USIGN(let) ?
(unsigned long) operandLitValue (left) :
(long) operandLitValue (left)) %
- (SPEC_USIGN(ret) ?
+ (SPEC_USIGN(ret) ?
(unsigned long) operandLitValue (right) :
(long) operandLitValue (right)));
break;
case LEFT_OP:
- retval = operandFromLit ((SPEC_USIGN(let) ?
+ retval = operandFromLit ((SPEC_USIGN(let) ?
(unsigned long) operandLitValue (left) :
(long) operandLitValue (left)) <<
- (SPEC_USIGN(ret) ?
+ (SPEC_USIGN(ret) ?
(unsigned long) operandLitValue (right) :
(long) operandLitValue (right)));
break;
case RIGHT_OP: {
double lval = operandLitValue(left), rval = operandLitValue(right);
double res=0;
- switch ((SPEC_USIGN(let) ? 2 : 0) + (SPEC_USIGN(ret) ? 1 : 0))
+ switch ((SPEC_USIGN(let) ? 2 : 0) + (SPEC_USIGN(ret) ? 1 : 0))
{
case 0: // left=unsigned right=unsigned
res=(unsigned long)lval >> (unsigned long)rval;