* src/SDCC.lex (check_type),
[fw/sdcc] / src / SDCCpeeph.c
index 7a1f3f258f5531de16371a58fd1f0e28f986a412..075cad2abc12af5ba428411386de4a84553bac5b 100644 (file)
@@ -402,6 +402,28 @@ FBYNAME (deadMove)
   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                 */
 /*-----------------------------------------------------------------*/
@@ -1200,6 +1222,9 @@ ftab[] =                                // sorted on the number of times used
   },
   {
     "useAcallAjmp", useAcallAjmp
+  },
+  {
+    "notUsed", notUsed
   }
 };
 /*-----------------------------------------------------------------*/