libcpp: Avoid unnecessary ad-hoc uses for large source files

libcpp/ChangeLog:
	* line-map.c (get_combined_adhoc_loc): Remove condition
	on locus < RESERVED_LOCATION_COUNT when considering
	whether a caret == start == finish location can be
	simply stored as the caret location.

From-SVN: r231918
This commit is contained in:
David Malcolm 2015-12-22 22:06:00 +00:00 committed by David Malcolm
parent 9edb6bb8d3
commit 329590d704
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2015-12-22 David Malcolm <dmalcolm@redhat.com>
* line-map.c (get_combined_adhoc_loc): Remove condition
on locus < RESERVED_LOCATION_COUNT when considering
whether a caret == start == finish location can be
simply stored as the caret location.
2015-12-07 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (rich_location::set_range): Add line_maps *

View File

@ -196,10 +196,9 @@ get_combined_adhoc_loc (struct line_maps *set,
}
}
/* We can also compactly store the reserved locations
/* We can also compactly store locations
when locus == start == finish (and data is NULL). */
if (locus < RESERVED_LOCATION_COUNT
&& locus == src_range.m_start
if (locus == src_range.m_start
&& locus == src_range.m_finish
&& !data)
return locus;