summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/lto-streamer-in.c20
2 files changed, 17 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 084ec33521e..230f396c6c1 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 45be0c2d47b..4f7551d0d17 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);
}