diff options
author | David Malcolm <dmalcolm@redhat.com> | 2016-08-23 20:20:48 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2016-08-23 20:20:48 +0000 |
commit | d672cded1fc033ff53b3b644272512822364703c (patch) | |
tree | 8f41240afb6e12321e582c483fe5a8e8832b2eb2 /libcpp | |
parent | 0da825e9623ea8c160a2a4a884d207da89bebab6 (diff) | |
download | gcc-d672cded1fc033ff53b3b644272512822364703c.zip gcc-d672cded1fc033ff53b3b644272512822364703c.tar.gz gcc-d672cded1fc033ff53b3b644272512822364703c.tar.bz2 |
line-map.h: add source_range::from_locations
libcpp/ChangeLog:
* include/line-map.h (source_range::from_locations): New method.
From-SVN: r239711
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 4 | ||||
-rw-r--r-- | libcpp/include/line-map.h | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index b0fd9b5..448d632 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,7 @@ +2016-08-23 David Malcolm <dmalcolm@redhat.com> + + * include/line-map.h (source_range::from_locations): New method. + 2016-08-19 David Malcolm <dmalcolm@redhat.com> * include/line-map.h (fixit_hint::kind): Delete REPLACE. diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index f65931c..a2ed008 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -296,6 +296,16 @@ struct GTY(()) source_range return result; } + /* Make a source_range from a pair of source_location. */ + static source_range from_locations (source_location start, + source_location finish) + { + source_range result; + result.m_start = start; + result.m_finish = finish; + return result; + } + /* Is there any part of this range on the given line? */ bool intersects_line_p (const char *file, int line) const; }; |