diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-22 22:06:00 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-22 22:06:00 +0000 |
commit | 7b4b11d3bd6a295a74062583f8fc0bf2d5161005 (patch) | |
tree | 7b51b5685ab6c1dc082095c957e45d186e8866aa | |
parent | fc7a3a00ad5089bd13f7e4646f7a319e7eee407c (diff) | |
download | gcc-7b4b11d3bd6a295a74062583f8fc0bf2d5161005.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231918 138bc75d-0d04-0410-961f-82ee72b054a4
-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 9b296fd836a..09b8e1825e9 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 209d0fbe656..c20a32b5f0f 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; |