static pBlock *pb_dead_pcodes = NULL;
/* Hardcoded flags to change the behavior of the PIC port */
-static int peepOptimizing = 0; /* run the peephole optimizer if nonzero */
+static int peepOptimizing = 1; /* run the peephole optimizer if nonzero */
static int functionInlining = 1; /* inline functions if nonzero */
int debug_verbose = 0; /* Set true to inundate .asm file */
if(matched) {
pCode *pcprev;
- pCode *pcr;
+ pCode *pcr, *pcout;
/* We matched a rule! Now we have to go through and remove the
/* Unlink the original code */
+ pcout = pc;
pcprev = pc->prev;
pcprev->next = pcin;
if(pcin)
} else if (pcr->type == PC_COMMENT) {
pCodeInsertAfter(pc, newpCodeCharP( ((pCodeComment *)(pcr))->comment));
}
-
-
+
pc = pc->next;
#ifdef PCODE_DEBUG
DFPRINTF((stderr," NEW Code:"));
}
+ /* Copy C code comments to new code. */
+ pc = pcprev->next;
+ if (pc) {
+ for (; pcout!=pcin; pcout=pcout->next) {
+ if (pcout->type==PC_OPCODE && PCI(pcout)->cline) {
+ while (pc->type!=PC_OPCODE || PCI(pc)->cline) {
+ pc = pc->next;
+ if (!pc)
+ break;
+ }
+ PCI(pc)->cline = PCI(pcout)->cline;
+ }
+ }
+ }
+
return 1;
- }
+ }
next_rule:
- peeprules = peeprules->next;
- }
- DFPRINTF((stderr," no rule matched\n"));
+ peeprules = peeprules->next;
+ }
+ DFPRINTF((stderr," no rule matched\n"));
- return 0;
+ return 0;
}