[PATCH][LTO] Optimize reading of locations

Tom Tromey tromey@redhat.com
Sun Oct 18 03:10:00 GMT 2009


>>>>> "Richard" == Richard Guenther <rguenther@suse.de> writes:

Richard> !   if (data_in->current_file != xloc.file)
Richard> !     {
Richard> !       if (data_in->current_file)
Richard> ! 	linemap_add (line_table, LC_LEAVE, false, NULL, 0);
  
Richard> !       linemap_add (line_table, LC_ENTER, false, xloc.file, xloc.line);
Richard> !     }
Richard> !   else if (data_in->current_line != xloc.line)
Richard> !     linemap_line_start (line_table, xloc.line, xloc.column);

I think linemap assumes that the lines are increasing order.  (I'm not
100% certain about this.)  If so, I suspect that this won't work in all
cases, you need to also LC_ENTER+LC_LEAVE if the new line is less than
the previous line.

Tom



More information about the Gcc-patches mailing list