summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-06-16 17:35:24 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-06-16 17:35:24 -0400
commite327fd94f3be22d9129b252102e73b5bfb3b3276 (patch)
tree4e2f178bd467fda1ffce236e40bb112db94dd133 /util.c
parent15e96a558baf007966f80d565f50f18cd2ecd75d (diff)
Remove redundant loads
Do breadth first of the entire program when marking variables used/unused Don't optimize away unused function parameters
Diffstat (limited to 'util.c')
-rw-r--r--util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/util.c b/util.c
index 270f2a3..38ed9b7 100644
--- a/util.c
+++ b/util.c
@@ -455,3 +455,15 @@ report_error (const char *fmt, ...)
return FALSE;
}
+
+void
+program_breadth_first (ast_program_t *program,
+ node_callback_t callback,
+ gpointer data)
+{
+ int i;
+
+ node_breadth_first (program->enter, callback, data);
+ for (i = 0; program->functions[i]; ++i)
+ node_breadth_first (program->functions[i]->enter, callback, data);
+}