bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] benchmarks: do not activate %debug by default.


From: Joel E. Denny
Subject: Re: [PATCH] benchmarks: do not activate %debug by default.
Date: Sun, 4 Oct 2009 14:57:55 -0400 (EDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Wed, 16 Sep 2009, Akim Demaille wrote:

> > I'd like to push this patch to master, branch-2.5, and maybe even
> > branch-2.4.2 in case it might be around a little longer.  Any objections?
> > 
> > * etc/bench.pl.in (generate_grammar_triangular): Here.  It can
> > affect the timings even if yydebug=0.
> 
> Perfect with me.

Thanks.

I pushed the following instead.  It also makes the calc grammar work the 
same way.  I realize now that only master takes %debug on the 
command-line, so I only pushed there.

>From 37318e2fe9a8d468088ddb782539f88b3a4c2bb8 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Sun, 4 Oct 2009 14:33:28 -0400
Subject: [PATCH] benchmarks: use %debug consistently among grammars.

* etc/bench.pl.in (generate_grammar_triangular): Do not activate
%debug by default.  It can affect the timings even if yydebug=0.
(generate_grammar_calc): For consistency with other grammars,
use YYDEBUG environment variable to set yydebug.
---
 ChangeLog       |    8 ++++++++
 etc/bench.pl.in |    7 ++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1ea72b2..a813d69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-04  Joel E. Denny  <address@hidden>
+
+       benchmarks: use %debug consistently among grammars.
+       * etc/bench.pl.in (generate_grammar_triangular): Do not activate
+       %debug by default.  It can affect the timings even if yydebug=0.
+       (generate_grammar_calc): For consistency with other grammars,
+       use YYDEBUG environment variable to set yydebug.
+
 2009-10-03  Joel E. Denny  <address@hidden>
 
        Remove dead code.
diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index 2290fd2..cfa055d 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -246,7 +246,6 @@ sub generate_grammar_triangular ($$@)
     or die;
   print $out <<EOF;
 %error-verbose
-%debug
 %{
 #include <stdio.h>
 #include <stdlib.h>
@@ -318,7 +317,9 @@ yyerror (const char *msg)
 int
 main (void)
 {
+#if YYDEBUG
   yydebug = !!getenv ("YYDEBUG");
+#endif
   return yyparse ();
 }
 EOF
@@ -543,6 +544,10 @@ main (int argc, const char **argv)
   int count = 0;
   int status;
 
+#if YYDEBUG
+  yydebug = !!getenv ("YYDEBUG");
+#endif
+
   input = fopen ("calc.input", "r");
   if (!input)
     {
-- 
1.5.4.3





reply via email to

[Prev in Thread] Current Thread [Next in Thread]