diff options
author | Gabriel Charette <gchare@google.com> | 2011-08-15 20:35:58 +0000 |
---|---|---|
committer | Gabriel Charette <gchare@gcc.gnu.org> | 2011-08-15 20:35:58 +0000 |
commit | 3f6ced102dddee2a41f6ae4e96c42a6580f8e279 (patch) | |
tree | f0b82291b2916fbc64b32cd6b2aa4f506273a69f /libcpp | |
parent | e535f1b22917730c13fc85f91360288d456f054f (diff) | |
download | gcc-3f6ced102dddee2a41f6ae4e96c42a6580f8e279.zip gcc-3f6ced102dddee2a41f6ae4e96c42a6580f8e279.tar.gz gcc-3f6ced102dddee2a41f6ae4e96c42a6580f8e279.tar.bz2 |
LINEMAP_POSITION_FOR_COLUMN had the exact same effect as linemap_position_for_column...
LINEMAP_POSITION_FOR_COLUMN had the exact same effect as
linemap_position_for_column, removed it and updated users
to use linemap_position_for_column instead
libcpp/ChangeLog
* include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
Update all users to use linemap_position_for_column instead.
gcc/go/ChangeLog
* gofrontend/lex.cc (Lex::location): Update to use
linemap_position_for_column instead.
(Lex::earlier_location): Likewise.
From-SVN: r177768
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 5 | ||||
-rw-r--r-- | libcpp/directives-only.c | 2 | ||||
-rw-r--r-- | libcpp/include/line-map.h | 17 | ||||
-rw-r--r-- | libcpp/lex.c | 4 |
4 files changed, 8 insertions, 20 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 1b22418..e136852 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,8 @@ +2011-08-15 Gabriel Charette <gchare@google.com> + + * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove. + Update all users to use linemap_position_for_column instead. + 2011-07-28 Gabriel Charette <gchare@google.com> * include/line-map.h (struct line_maps): diff --git a/libcpp/directives-only.c b/libcpp/directives-only.c index e19f806..c6772af 100644 --- a/libcpp/directives-only.c +++ b/libcpp/directives-only.c @@ -142,7 +142,7 @@ _cpp_preprocess_dir_only (cpp_reader *pfile, flags |= DO_LINE_COMMENT; else if (!(flags & DO_SPECIAL)) /* Mark the position for possible error reporting. */ - LINEMAP_POSITION_FOR_COLUMN (loc, pfile->line_table, col); + loc = linemap_position_for_column (pfile->line_table, col); break; diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index f1d5bee..3c84035 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -165,23 +165,6 @@ extern const struct line_map *linemap_lookup /* Nonzero if the map is at the bottom of the include stack. */ #define MAIN_FILE_P(MAP) ((MAP)->included_from < 0) -/* Set LOC to a source position that is the same line as the most recent - linemap_line_start, but with the specified TO_COLUMN column number. */ - -#define LINEMAP_POSITION_FOR_COLUMN(LOC, SET, TO_COLUMN) do { \ - unsigned int to_column = (TO_COLUMN); \ - struct line_maps *set = (SET); \ - if (__builtin_expect (to_column >= set->max_column_hint, 0)) \ - (LOC) = linemap_position_for_column (set, to_column); \ - else { \ - source_location r = set->highest_line; \ - r = r + to_column; \ - if (r >= set->highest_location) \ - set->highest_location = r; \ - (LOC) = r; \ - }} while (0) - - extern source_location linemap_position_for_column (struct line_maps *set, unsigned int to_column); diff --git a/libcpp/lex.c b/libcpp/lex.c index d29f36d..d460b98 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1975,8 +1975,8 @@ _cpp_lex_direct (cpp_reader *pfile) } c = *buffer->cur++; - LINEMAP_POSITION_FOR_COLUMN (result->src_loc, pfile->line_table, - CPP_BUF_COLUMN (buffer, buffer->cur)); + result->src_loc = linemap_position_for_column (pfile->line_table, + CPP_BUF_COLUMN (buffer, buffer->cur)); switch (c) { |