diff options
author | Richard Guenther <rguenther@suse.de> | 2009-10-17 15:40:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-10-17 15:40:53 +0000 |
commit | b7dae211cc118ce7232c3b300fa90ac136d9fd62 (patch) | |
tree | dd8378404eaca9c09dec44f00935d8df7b4649d1 /gcc | |
parent | 96d356ef3f1fa86c4077012ac16e186ac34aaf3e (diff) | |
download | gcc-b7dae211cc118ce7232c3b300fa90ac136d9fd62.zip gcc-b7dae211cc118ce7232c3b300fa90ac136d9fd62.tar.gz gcc-b7dae211cc118ce7232c3b300fa90ac136d9fd62.tar.bz2 |
lto-streamer-in.c (lto_input_location): Try to reuse previous maps.
2009-10-17 Richard Guenther <rguenther@suse.de>
* lto-streamer-in.c (lto_input_location): Try to reuse
previous maps.
From-SVN: r152953
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto-streamer-in.c | 20 |
2 files changed, 17 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 084ec33..230f396 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2009-10-17 Richard Guenther <rguenther@suse.de> + * lto-streamer-in.c (lto_input_location): Try to reuse + previous maps. + +2009-10-17 Richard Guenther <rguenther@suse.de> + * lto-streamer-in.c (input_gimple_stmt): Fixup FIELD_DECL operands in COMPONENT_REFs. diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index 45be0c2..4f7551d 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -274,26 +274,30 @@ static location_t lto_input_location (struct lto_input_block *ib, struct data_in *data_in) { expanded_location xloc; - location_t loc; xloc.file = input_string (data_in, ib); if (xloc.file == NULL) return UNKNOWN_LOCATION; + xloc.file = canon_file_name (xloc.file); xloc.line = lto_input_sleb128 (ib); xloc.column = lto_input_sleb128 (ib); - if (data_in->current_file) - linemap_add (line_table, LC_LEAVE, false, NULL, 0); + if (data_in->current_file != xloc.file) + { + if (data_in->current_file) + linemap_add (line_table, LC_LEAVE, false, NULL, 0); - data_in->current_file = canon_file_name (xloc.file); + linemap_add (line_table, LC_ENTER, false, xloc.file, xloc.line); + } + else if (data_in->current_line != xloc.line) + linemap_line_start (line_table, xloc.line, xloc.column); + + data_in->current_file = xloc.file; data_in->current_line = xloc.line; data_in->current_col = xloc.column; - linemap_add (line_table, LC_ENTER, false, data_in->current_file, xloc.line); - LINEMAP_POSITION_FOR_COLUMN (loc, line_table, xloc.column); - - return loc; + return linemap_position_for_column (line_table, xloc.column); } |