diff options
author | David Malcolm <dmalcolm@redhat.com> | 2015-12-22 22:06:00 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2015-12-22 22:06:00 +0000 |
commit | 329590d70441f5300eafa7340845a65359b1c46b (patch) | |
tree | 7b51b5685ab6c1dc082095c957e45d186e8866aa /libcpp | |
parent | 9edb6bb8d37985e92be466ca9d3418034e00fd7b (diff) | |
download | gcc-329590d70441f5300eafa7340845a65359b1c46b.zip gcc-329590d70441f5300eafa7340845a65359b1c46b.tar.gz gcc-329590d70441f5300eafa7340845a65359b1c46b.tar.bz2 |
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
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 7 | ||||
-rw-r--r-- | libcpp/line-map.c | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 9b296fd..09b8e18 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -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 * diff --git a/libcpp/line-map.c b/libcpp/line-map.c index 209d0fb..c20a32b 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -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; |