diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-12-04 23:35:29 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-12-04 23:35:29 +0000 |
commit | b93c07227e9ce2ee03d1cdc5ae2250fef3b0c130 (patch) | |
tree | 33789715c13d21a2d6b517515a507f50dc9274ee /gcc/fortran/scanner.c | |
parent | 97aa8bb6e20579f382357ffaa8f7233133fc1e7c (diff) | |
download | gcc-b93c07227e9ce2ee03d1cdc5ae2250fef3b0c130.zip gcc-b93c07227e9ce2ee03d1cdc5ae2250fef3b0c130.tar.gz gcc-b93c07227e9ce2ee03d1cdc5ae2250fef3b0c130.tar.bz2 |
line-map.c (linemap_position_for_loc_and_offset): Add new linemap_assert_fails.
libcpp/ChangeLog:
2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
* line-map.c (linemap_position_for_loc_and_offset): Add new
linemap_assert_fails.
gcc/fortran/ChangeLog:
2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
* scanner.c (gfc_next_char_literal): Use gfc_warning_now.
(load_file): Use the line length as the column hint for
linemap_line_start. Reserve a location for the highest column of
the line.
From-SVN: r218407
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r-- | gcc/fortran/scanner.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index 0de0998..718c323 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -1056,7 +1056,8 @@ restart: gfc_current_locus.lb->truncated = 0; gfc_current_locus.nextc = gfc_current_locus.lb->line + maxlen; - gfc_warning_now_1 ("Line truncated at %L", &gfc_current_locus); + gfc_warning_now (OPT_Wline_truncation, + "Line truncated at %L", &gfc_current_locus); gfc_current_locus.nextc = current_nextc; } @@ -1195,7 +1196,8 @@ restart: && gfc_current_locus.lb->truncated) { gfc_current_locus.lb->truncated = 0; - gfc_warning_now_1 ("Line truncated at %L", &gfc_current_locus); + gfc_warning_now (OPT_Wline_truncation, + "Line truncated at %L", &gfc_current_locus); } prev_openmp_flag = openmp_flag; @@ -2044,7 +2046,13 @@ load_file (const char *realfilename, const char *displayedname, bool initial) + (len + 1) * sizeof (gfc_char_t)); b->location - = linemap_line_start (line_table, current_file->line++, 120); + = linemap_line_start (line_table, current_file->line++, len); + /* ??? We add the location for the maximum column possible here, + because otherwise if the next call creates a new line-map, it + will not reserve space for any offset. */ + if (len > 0) + linemap_position_for_column (line_table, len); + b->file = current_file; b->truncated = trunc; wide_strcpy (b->line, line); |