summaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-26 06:54:54 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-26 06:54:54 +0000
commit2cafe21106dc81d9ec203120ef94e4e35527eaa4 (patch)
tree445f8e0a123deaa48447d0f3140806f626a413a0 /gcc/diagnostic.c
parent33df9a15badf6dce67fcaa65338d2ce2c7384843 (diff)
downloadgcc-2cafe21106dc81d9ec203120ef94e4e35527eaa4.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198331 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index e454cf31af2..f9a236b9113 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -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);
}