diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-09-20 21:49:12 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-09-20 21:49:12 +0000 |
commit | c9c81ef3c667aaa14c498a5449ec6d134b4b66ff (patch) | |
tree | 0ac440db6513ee01deb5e5dc6142769d1e5b7b2d /gcc/toplev.c | |
parent | 12cdcb9d74f55c165366ca1b1eeec013a0ce72ef (diff) | |
parent | 891196d7325e4c55d92d5ac5cfe7161c4f36c0ce (diff) | |
download | gcc-fortran-dev.tar.gz |
Merge from trunk (r239915 to r240230)fortran-dev
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/fortran-dev@240290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 26079047219..66099ec7d23 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -76,6 +76,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-chkp.h" #include "omp-low.h" #include "hsa.h" +#include "edit-context.h" #if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO) #include "dbxout.h" @@ -1219,7 +1220,13 @@ process_options (void) no_backend = lang_hooks.post_options (&main_input_filename); /* Some machines may reject certain combinations of options. */ + location_t saved_location = input_location; + input_location = UNKNOWN_LOCATION; targetm.target_option.override (); + input_location = saved_location; + + if (flag_diagnostics_generate_patch) + global_dc->edit_context_ptr = new edit_context (); /* Avoid any informative notes in the second run of -fcompare-debug. */ if (flag_compare_debug) @@ -2147,6 +2154,16 @@ toplev::main (int argc, char **argv) emit some diagnostics here. */ invoke_plugin_callbacks (PLUGIN_FINISH, NULL); + if (flag_diagnostics_generate_patch) + { + gcc_assert (global_dc->edit_context_ptr); + + pretty_printer (pp); + pp_show_color (&pp) = pp_show_color (global_dc->printer); + global_dc->edit_context_ptr->print_diff (&pp, true); + pp_flush (&pp); + } + diagnostic_finish (global_dc); finalize_plugins (); |