2011-06-01 David Li * tree-dump.c: New dump flags. * tree-pass.h: New dump flags. * passes.c (execute_one_pass): Handle dump_before flag. Index: tree-dump.c =================================================================== --- tree-dump.c (revision 174446) +++ tree-dump.c (working copy) @@ -808,6 +808,7 @@ struct dump_option_value_info in tree.h */ static const struct dump_option_value_info dump_options[] = { + {"before", TDF_BEFORE}, {"address", TDF_ADDRESS}, {"asmname", TDF_ASMNAME}, {"slim", TDF_SLIM}, Index: tree-pass.h =================================================================== --- tree-pass.h (revision 174446) +++ tree-pass.h (working copy) @@ -83,6 +83,7 @@ enum tree_dump_index #define TDF_ALIAS (1 << 21) /* display alias information */ #define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */ #define TDF_CSELIB (1 << 23) /* Dump cselib details. */ +#define TDF_BEFORE (1 << 24) /* Dump IR before pass. */ /* In tree-dump.c */ Index: passes.c =================================================================== --- passes.c (revision 174446) +++ passes.c (working copy) @@ -1563,6 +1563,13 @@ execute_one_pass (struct opt_pass *pass) initializing_dump = pass_init_dump_file (pass); + /* Override dump TODOs. */ + if (dump_file && (pass->todo_flags_finish & TODO_dump_func) + && (dump_flags & TDF_BEFORE)) + { + pass->todo_flags_finish &= ~TODO_dump_func; + pass->todo_flags_start |= TODO_dump_func; + } /* Run pre-pass verification. */ execute_todo (pass->todo_flags_start);