Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21797/algebra
Modified Files:
algopt.c
Log Message:
-- Allow to enable the optimization debugging info after compilation via
a environment variable (PF_DEBUG_OPTIMIZATIONS).
Index: algopt.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algopt.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- algopt.c 1 Nov 2007 00:18:19 -0000 1.25
+++ algopt.c 28 Nov 2007 17:03:48 -0000 1.26
@@ -35,6 +35,7 @@
#include "pathfinder.h"
#include <assert.h>
#include <stdio.h>
+#include <stdlib.h>
#include "algopt.h"
#include "map_names.h"
@@ -89,6 +90,7 @@
PFla_op_t *
PFalgopt (PFla_op_t *root, bool timing, PFguide_tree_t* guide_tree)
{
+ bool debug_opt = getenv("PF_DEBUG_OPTIMIZATIONS");
assert (PFstate.opt_alg);
long tm;
bool const_no_attach = false;
@@ -103,14 +105,13 @@
}
-#define DEBUG_OPT_STR 0
-#if DEBUG_OPT_STR
- fprintf (stderr, "-o");
-#endif
+ if (debug_opt)
+ fprintf (stderr, "-o");
+
while (*args) {
-#if DEBUG_OPT_STR
- fputc (*args, stderr);
-#endif
+ if (debug_opt)
+ fputc (*args, stderr);
+
switch (*args) {
case 'A': /* disabled */
/*
@@ -450,9 +451,8 @@
args++;
root = PFla_cse (root);
}
-#if DEBUG_OPT_STR
- fputc ('\n', stderr);
-#endif
+ if (debug_opt)
+ fputc ('\n', stderr);
if (unq_names)
PFinfo (OOPS_WARNING,
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins