This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto] Emit location information for statements
- From: Tom Tromey <tromey at redhat dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 May 2009 11:31:54 -0600
- Subject: Re: [lto] Emit location information for statements
- References: <20090515211015.GA750@google.com>
- Reply-to: tromey at redhat dot com
>>>>> "Diego" == Diego Novillo <dnovillo@google.com> writes:
Diego> As referenced in my previous message
Diego> (http://gcc.gnu.org/ml/gcc-patches/2009-05/msg00927.html), this
Diego> patch emits location information for statements in gimple files.
I saw something odd in this patch. I don't know whether it is a bug
or not, but I figured I would mention it just in case.
Diego> +static void
Diego> +output_stmt_location (struct output_block *ob, gimple stmt)
Diego> +{
Diego> + expanded_location xloc;
Diego> +
Diego> + xloc = expand_location (gimple_location (stmt));
Diego> + if (xloc.file == NULL)
Diego> + {
Diego> + output_string (ob, ob->main_stream, xloc.file);
Diego> + return;
Diego> + }
Diego> +
Diego> + output_string (ob, ob->main_stream, xloc.file);
Diego> + output_sleb128 (ob, xloc.line);
Diego> + output_sleb128 (ob, xloc.column);
This conditionally emits the line and column based on file != NULL.
Diego> +static location_t
Diego> +input_stmt_location (struct lto_input_block *ib, struct data_in *data_in)
Diego> +{
[...]
Diego> + file = input_string (data_in, ib);
Diego> + line = lto_input_sleb128 (ib);
Diego> + column = lto_input_sleb128 (ib);
... but this seems to unconditionally read the line and column.
Tom