This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [lto] Emit location information for statements

>>>>> "Diego" == Diego Novillo <> writes:

Diego> As referenced in my previous message
Diego> (, 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]