* src/SDCCpeeph.c (initPeepHole): implemented RFE 1460196, when both
authormaartenbrock <maartenbrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 5 Apr 2006 09:42:42 +0000 (09:42 +0000)
committermaartenbrock <maartenbrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 5 Apr 2006 09:42:42 +0000 (09:42 +0000)
  --no-peep and --peep-file <file> are used don't use default rules but
  do use the <file>

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4079 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCpeeph.c

index 91ca8c2093d2d3f9ce812c73211f7aa54bb122ed..7b8d41070f5ab4bd935ff05810171ccca85edae5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-05 Maarten Brock <sourceforge.brock AT dse.nl>
+
+       * src/SDCCpeeph.c (initPeepHole): implemented RFE 1460196, when both
+         --no-peep and --peep-file <file> are used don't use default rules but
+         do use the <file>
+
 2006-04-05 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * src/mcs51/gen.c (genCall): fixed bug 1457608
index 478178c6675cd4148b36b14f5d80c539195a06d9..3a12a74cc57a7be26ffce2c21df4ec3309075703 100644 (file)
@@ -2279,13 +2279,18 @@ initPeepHole ()
   char *s;
 
   /* read in the default rules */
-  readRules (port->peep.default_rules);
+  if (!options.nopeep)
+    {
+      readRules (port->peep.default_rules);
+    }
 
   /* if we have any additional file read it too */
   if (options.peep_file)
     {
       readRules (s = readFileIntoBuffer (options.peep_file));
       setToNull ((void *) &s);
+      /* override nopeep setting, default rules have not been read */
+      options.nopeep = 0;
     }