Commit 6c1bc27c by Richard Biener Committed by Richard Biener

lto-streamer.h (lto_location_cache::cached_location::sysp): Add.

2015-08-31  Richard Biener  <rguenther@suse.de>

	* lto-streamer.h (lto_location_cache::cached_location::sysp): Add.
	(lto_location_cache::current_sysp): Likewise.
	(output_block::current_sysp): Likewise.
	* lto-streamer-in.c (lto_location_cache::cmp_loc): Compare sysp.
	(lto_location_cache::apply_location_cache): Properly record
	system header locations.
	(lto_location_cache::input_location): Input whether a file
	is a system header.
	* lto-streamer-out.c (lto_output_location): Stream whether a file
	is a system header.

From-SVN: r227338
parent c25eec8f
2015-08-31 Richard Biener <rguenther@suse.de>
* lto-streamer.h (lto_location_cache::cached_location::sysp): Add.
(lto_location_cache::current_sysp): Likewise.
(output_block::current_sysp): Likewise.
* lto-streamer-in.c (lto_location_cache::cmp_loc): Compare sysp.
(lto_location_cache::apply_location_cache): Properly record
system header locations.
(lto_location_cache::input_location): Input whether a file
is a system header.
* lto-streamer-out.c (lto_output_location): Stream whether a file
is a system header.
2015-08-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2015-08-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR bootstrap/67363 PR bootstrap/67363
......
...@@ -171,6 +171,8 @@ lto_location_cache::cmp_loc (const void *pa, const void *pb) ...@@ -171,6 +171,8 @@ lto_location_cache::cmp_loc (const void *pa, const void *pb)
} }
if (a->file != b->file) if (a->file != b->file)
return strcmp (a->file, b->file); return strcmp (a->file, b->file);
if (a->sysp != b->sysp)
return a->sysp ? 1 : -1;
if (a->line != b->line) if (a->line != b->line)
return a->line - b->line; return a->line - b->line;
return a->col - b->col; return a->col - b->col;
...@@ -194,7 +196,7 @@ lto_location_cache::apply_location_cache () ...@@ -194,7 +196,7 @@ lto_location_cache::apply_location_cache ()
if (current_file != loc.file) if (current_file != loc.file)
linemap_add (line_table, prev_file ? LC_RENAME : LC_ENTER, linemap_add (line_table, prev_file ? LC_RENAME : LC_ENTER,
false, loc.file, loc.line); loc.sysp, loc.file, loc.line);
else if (current_line != loc.line) else if (current_line != loc.line)
{ {
int max = loc.col; int max = loc.col;
...@@ -251,6 +253,7 @@ lto_location_cache::input_location (location_t *loc, struct bitpack_d *bp, ...@@ -251,6 +253,7 @@ lto_location_cache::input_location (location_t *loc, struct bitpack_d *bp,
static const char *stream_file; static const char *stream_file;
static int stream_line; static int stream_line;
static int stream_col; static int stream_col;
static bool stream_sysp;
bool file_change, line_change, column_change; bool file_change, line_change, column_change;
gcc_assert (current_cache == this); gcc_assert (current_cache == this);
...@@ -268,7 +271,10 @@ lto_location_cache::input_location (location_t *loc, struct bitpack_d *bp, ...@@ -268,7 +271,10 @@ lto_location_cache::input_location (location_t *loc, struct bitpack_d *bp,
column_change = bp_unpack_value (bp, 1); column_change = bp_unpack_value (bp, 1);
if (file_change) if (file_change)
stream_file = canon_file_name (bp_unpack_string (data_in, bp)); {
stream_file = canon_file_name (bp_unpack_string (data_in, bp));
stream_sysp = bp_unpack_value (bp, 1);
}
if (line_change) if (line_change)
stream_line = bp_unpack_var_len_unsigned (bp); stream_line = bp_unpack_var_len_unsigned (bp);
...@@ -280,13 +286,14 @@ lto_location_cache::input_location (location_t *loc, struct bitpack_d *bp, ...@@ -280,13 +286,14 @@ lto_location_cache::input_location (location_t *loc, struct bitpack_d *bp,
streaming. */ streaming. */
if (current_file == stream_file && current_line == stream_line if (current_file == stream_file && current_line == stream_line
&& current_col == stream_col) && current_col == stream_col && current_sysp == stream_sysp)
{ {
*loc = current_loc; *loc = current_loc;
return; return;
} }
struct cached_location entry = {stream_file, loc, stream_line, stream_col}; struct cached_location entry
= {stream_file, loc, stream_line, stream_col, stream_sysp};
loc_cache.safe_push (entry); loc_cache.safe_push (entry);
} }
......
...@@ -191,8 +191,12 @@ lto_output_location (struct output_block *ob, struct bitpack_d *bp, ...@@ -191,8 +191,12 @@ lto_output_location (struct output_block *ob, struct bitpack_d *bp,
bp_pack_value (bp, ob->current_col != xloc.column, 1); bp_pack_value (bp, ob->current_col != xloc.column, 1);
if (ob->current_file != xloc.file) if (ob->current_file != xloc.file)
bp_pack_string (ob, bp, xloc.file, true); {
bp_pack_string (ob, bp, xloc.file, true);
bp_pack_value (bp, xloc.sysp, 1);
}
ob->current_file = xloc.file; ob->current_file = xloc.file;
ob->current_sysp = xloc.sysp;
if (ob->current_line != xloc.line) if (ob->current_line != xloc.line)
bp_pack_var_len_unsigned (bp, xloc.line); bp_pack_var_len_unsigned (bp, xloc.line);
......
...@@ -345,6 +345,7 @@ private: ...@@ -345,6 +345,7 @@ private:
const char *file; const char *file;
location_t *loc; location_t *loc;
int line, col; int line, col;
bool sysp;
}; };
/* The location cache. */ /* The location cache. */
...@@ -364,6 +365,7 @@ private: ...@@ -364,6 +365,7 @@ private:
const char *current_file; const char *current_file;
int current_line; int current_line;
int current_col; int current_col;
bool current_sysp;
location_t current_loc; location_t current_loc;
}; };
...@@ -711,6 +713,7 @@ struct output_block ...@@ -711,6 +713,7 @@ struct output_block
const char *current_file; const char *current_file;
int current_line; int current_line;
int current_col; int current_col;
bool current_sysp;
/* Cache of nodes written in this section. */ /* Cache of nodes written in this section. */
struct streamer_tree_cache_d *writer_cache; struct streamer_tree_cache_d *writer_cache;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment