summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-in.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-17 15:40:53 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-17 15:40:53 +0000
commitcb0ae7a99a3c13d0e276afeecbf6a6315594ca5f (patch)
treedd8378404eaca9c09dec44f00935d8df7b4649d1 /gcc/lto-streamer-in.c
parent03844a2ace65c9cb05a67435c5d1ce4cd5eb8dac (diff)
downloadgcc-cb0ae7a99a3c13d0e276afeecbf6a6315594ca5f.tar.gz
2009-10-17 Richard Guenther <rguenther@suse.de>
* lto-streamer-in.c (lto_input_location): Try to reuse previous maps. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152953 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r--gcc/lto-streamer-in.c20
1 files changed, 12 insertions, 8 deletions
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);
}