werror(I_CYCLOMATIC,currFunc->name,nEdges,nNodes, nEdges - nNodes + 2);
}
+#ifdef POST_2_2_1
+/* Turn this on when it's safe to destablize */
+/*-----------------------------------------------------------------*/
+/* discardDeadParamReceives - remove any RECEIVE opcodes which */
+/* refer to dead variables. */
+/*-----------------------------------------------------------------*/
+static void discardDeadParamReceives(eBBlock **ebbs, int count)
+{
+ int i;
+ iCode *ic;
+ iCode dummyIcode;
+
+ for (i = 0 ; i < count ; i++)
+ {
+ for ( ic = ebbs[i]->sch ; ic ; ic = ic->next )
+ {
+ if (ic->op == RECEIVE)
+ {
+ if (IC_RESULT(ic) && OP_SYMBOL(IC_RESULT(ic))
+ && !OP_SYMBOL(IC_RESULT(ic))->used)
+ {
+#if 0
+ fprintf(stderr, "discarding dead receive for %s\n",
+ OP_SYMBOL(IC_RESULT(ic))->name);
+#endif
+ dummyIcode.next = ic->next;
+ remiCodeFromeBBlock(ebbs[i], ic);
+ ic = &dummyIcode;
+ }
+ }
+ }
+ }
+}
+#endif
/*-----------------------------------------------------------------*/
/* eBBlockFromiCode - creates extended basic blocks from iCode */
if (options.dump_range)
dumpEbbsToFileExt(".dumprange",ebbs,count);
+#ifdef POST_2_2_1
+ /* Turn this on when it's safe to destablize */
+ /* Now that we have the live ranges, discard parameter
+ * receives for unused parameters.
+ */
+ discardDeadParamReceives(ebbs,count);
+#endif
+
/* allocate registers & generate code */
port->assignRegisters(ebbs,count);