diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-12-04 23:59:35 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-12-04 23:59:35 +0000 |
commit | 99abe958d87a7cf653ea2ea9c467f7ebe0ba956d (patch) | |
tree | 5367afa1553141e677c4411189df8b007d01bd1c /gcc/diagnostic.h | |
parent | 1be71446897bf65257d37183f28355a3b5f9fe8e (diff) | |
download | gcc-99abe958d87a7cf653ea2ea9c467f7ebe0ba956d.zip gcc-99abe958d87a7cf653ea2ea9c467f7ebe0ba956d.tar.gz gcc-99abe958d87a7cf653ea2ea9c467f7ebe0ba956d.tar.bz2 |
error.c (gfc_diagnostic_build_locus_prefix): Use diagnostic_expand_location.
gcc/fortran/ChangeLog:
2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
* error.c (gfc_diagnostic_build_locus_prefix): Use
diagnostic_expand_location.
gcc/ChangeLog:
2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
* diagnostic.h (diagnostic_expand_location): New inline function.
* diagnostic.c (diagnostic_build_prefix): Use it.
(diagnostic_show_locus): Likewise.
From-SVN: r218409
Diffstat (limited to 'gcc/diagnostic.h')
-rw-r--r-- | gcc/diagnostic.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index 81e5988..3c4906a 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -297,6 +297,18 @@ void diagnostic_set_caret_max_width (diagnostic_context *context, int value); void diagnostic_file_cache_fini (void); +/* Expand the location of this diagnostic. Use this function for consistency. */ + +static inline expanded_location +diagnostic_expand_location (const diagnostic_info * diagnostic) +{ + expanded_location s + = expand_location_to_spelling_point (diagnostic->location); + if (diagnostic->override_column) + s.column = diagnostic->override_column; + return s; +} + /* Pure text formatting support functions. */ extern char *file_name_as_prefix (diagnostic_context *, const char *); |