diff options
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 47b4c79..46cdb62 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see #include "backtrace.h" #include "diagnostic.h" #include "diagnostic-color.h" +#include "edit-context.h" #include "selftest.h" #ifdef HAVE_TERMIOS_H @@ -174,6 +175,7 @@ diagnostic_initialize (diagnostic_context *context, int n_opts) context->colorize_source_p = false; context->show_ruler_p = false; context->parseable_fixits_p = false; + context->edit_context_ptr = NULL; } /* Maybe initialize the color support. We require clients to do this @@ -235,6 +237,12 @@ diagnostic_finish (diagnostic_context *context) context->printer->~pretty_printer (); XDELETE (context->printer); context->printer = NULL; + + if (context->edit_context_ptr) + { + delete context->edit_context_ptr; + context->edit_context_ptr = NULL; + } } /* Initialize DIAGNOSTIC, where the message MSG has already been @@ -943,6 +951,9 @@ diagnostic_report_diagnostic (diagnostic_context *context, diagnostic->message.format_spec = saved_format_spec; diagnostic->x_data = NULL; + if (context->edit_context_ptr) + context->edit_context_ptr->add_fixits (diagnostic->richloc); + context->lock--; return true; |