diagnostic.h (file_name_as_prefix): Add context argument.
* diagnostic.h (file_name_as_prefix): Add context argument. * diagnostic.c (file_name_as_prefix): Likewise. Colorize the string as locus. * langhooks.c (lhd_print_error_function): Adjust caller. cp/ * error.c (cp_print_error_function): Adjust file_name_as_prefix caller. From-SVN: r198331
This commit is contained in:
parent
013e5ef956
commit
e78e8a0b19
|
@ -1,3 +1,10 @@
|
|||
2013-04-26 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* diagnostic.h (file_name_as_prefix): Add context argument.
|
||||
* diagnostic.c (file_name_as_prefix): Likewise. Colorize
|
||||
the string as locus.
|
||||
* langhooks.c (lhd_print_error_function): Adjust caller.
|
||||
|
||||
2013-04-25 Lawrence Crowl <crowl@google.com>
|
||||
|
||||
* var-tracking.c (shared_hash_def::htab):
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2013-04-26 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* error.c (cp_print_error_function): Adjust file_name_as_prefix
|
||||
caller.
|
||||
|
||||
2013-04-25 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/56859
|
||||
|
|
|
@ -2962,7 +2962,7 @@ cp_print_error_function (diagnostic_context *context,
|
|||
const char *file = LOCATION_FILE (diagnostic->location);
|
||||
tree abstract_origin = diagnostic_abstract_origin (diagnostic);
|
||||
char *new_prefix = (file && abstract_origin == NULL)
|
||||
? file_name_as_prefix (file) : NULL;
|
||||
? file_name_as_prefix (context, file) : NULL;
|
||||
|
||||
pp_base_set_prefix (context->printer, new_prefix);
|
||||
|
||||
|
|
|
@ -72,9 +72,12 @@ build_message_string (const char *msg, ...)
|
|||
|
||||
/* Same as diagnostic_build_prefix, but only the source FILE is given. */
|
||||
char *
|
||||
file_name_as_prefix (const char *f)
|
||||
file_name_as_prefix (diagnostic_context *context, const char *f)
|
||||
{
|
||||
return build_message_string ("%s: ", f);
|
||||
const char *locus_cs
|
||||
= colorize_start (pp_show_color (context->printer), "locus");
|
||||
const char *locus_ce = colorize_stop (pp_show_color (context->printer));
|
||||
return build_message_string ("%s%s:%s ", locus_cs, f, locus_ce);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -293,6 +293,6 @@ void diagnostic_set_caret_max_width (diagnostic_context *context, int value);
|
|||
|
||||
|
||||
/* Pure text formatting support functions. */
|
||||
extern char *file_name_as_prefix (const char *);
|
||||
extern char *file_name_as_prefix (diagnostic_context *, const char *);
|
||||
|
||||
#endif /* ! GCC_DIAGNOSTIC_H */
|
||||
|
|
|
@ -372,7 +372,7 @@ lhd_print_error_function (diagnostic_context *context, const char *file,
|
|||
const char *old_prefix = context->printer->prefix;
|
||||
tree abstract_origin = diagnostic_abstract_origin (diagnostic);
|
||||
char *new_prefix = (file && abstract_origin == NULL)
|
||||
? file_name_as_prefix (file) : NULL;
|
||||
? file_name_as_prefix (context, file) : NULL;
|
||||
|
||||
pp_set_prefix (context->printer, new_prefix);
|
||||
|
||||
|
|
Loading…
Reference in New Issue