return FALSE;
}
+/*-----------------------------------------------------------------*/
+/* notUsed - Check, if value in register is not read again */
+/*-----------------------------------------------------------------*/
+FBYNAME (notUsed)
+{
+ const char *what;
+
+ if(cmdLine[0] != '\'')
+ what = hTabItemWithKey (vars, 1);
+ else
+ {
+ cmdLine[strlen(cmdLine) - 1] = 0;
+ what = cmdLine + 1;
+ }
+
+ if (port->peep.notUsed)
+ return port->peep.notUsed (what, endPl, head);
+
+ fprintf (stderr, "Function notUsed not initialized in port structure\n");
+ return FALSE;
+}
+
/*-----------------------------------------------------------------*/
/* operandsNotSame - check if %1 & %2 are the same */
/*-----------------------------------------------------------------*/
},
{
"useAcallAjmp", useAcallAjmp
+ },
+ {
+ "notUsed", notUsed
}
};
/*-----------------------------------------------------------------*/
#include "main.h"
#include "ralloc.h"
#include "gen.h"
+#include "peep.h"
#include "dbuf_string.h"
#include "../SDCCutil.h"
MODEL_SMALL | MODEL_MEDIUM | MODEL_LARGE,
MODEL_SMALL
},
- {
+ { /* Assembler */
_asmCmd,
NULL,
"-plosgffc", /* Options with debug */
".asm",
NULL /* no do_assemble function */
},
- {
+ { /* Linker */
_linkCmd,
NULL,
NULL,
".rel",
1
},
- {
+ { /* Peephole optimizer */
_defaultRules,
getInstructionSize,
getRegsRead,
getRegsWritten,
- mcs51DeadMove
+ mcs51DeadMove,
+ 0
},
{
/* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
#include "SDCCargs.h"
#include "SDCCpeeph.h"
#include "dbuf.h"
-#include "mcs51/peep.h"
#define TARGET_ID_MCS51 1
#define TARGET_ID_GBZ80 2
bitVect * (*getRegsRead)(lineNode *line);
bitVect * (*getRegsWritten)(lineNode *line);
bool (*deadMove) (const char *reg, lineNode *currPl, lineNode *head);
+ bool (*notUsed) (const char *reg, lineNode *currPl, lineNode *head);
}
peep;