aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2018-01-06 21:53:14 +0100
committertomsmeding <tom.smeding@gmail.com>2018-01-06 21:53:14 +0100
commit88548f1a9796b1bc02d6d81552450401c0015f28 (patch)
tree91c74b0321d211fa08124bb05c8af5552e06fc3f
parent39f07ae70eb9be2791b9362eaab0c29265d2eab6 (diff)
Less debug output
-rw-r--r--c.l2
-rw-r--r--main.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/c.l b/c.l
index 376ed4c..77381fb 100644
--- a/c.l
+++ b/c.l
@@ -7,7 +7,7 @@
#include "type.h"
#include "y.tab.h"
-#define DEBUG
+#undef DEBUG
int yylex(void);
diff --git a/main.c b/main.c
index 020fa83..94d155e 100644
--- a/main.c
+++ b/main.c
@@ -7,6 +7,8 @@
#include "regalloc.h"
#include "to_assembly.h"
+#undef DEBUG
+
extern FILE *yyin;
extern int yyparse(void);
@@ -29,18 +31,25 @@ int main(int argc, char **argv) {
assert(false);
}
+#ifdef DEBUG
node_print(root_node, stdout, 0);
printf("\n");
+#endif
struct ir *ir = compile(root_node);
+#ifdef DEBUG
ir_print(ir, stdout); printf("\n");
+#endif
struct allocation *alloc = regalloc(ir);
to_assembly(ir, alloc);
allocation_delete(alloc);
+#ifdef DEBUG
ir_print(ir, stdout); printf("\n");
+#endif
+
assemble(ir, stdout);
return result;