From: David Malcolm Date: Tue, 23 Aug 2016 20:20:48 +0000 (+0000) Subject: line-map.h: add source_range::from_locations X-Git-Tag: basepoints/gcc-8~4914 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d672cded1fc033ff53b3b644272512822364703c;p=thirdparty%2Fgcc.git line-map.h: add source_range::from_locations libcpp/ChangeLog: * include/line-map.h (source_range::from_locations): New method. From-SVN: r239711 --- diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index b0fd9b52ed82..448d63217e8e 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,7 @@ +2016-08-23 David Malcolm + + * include/line-map.h (source_range::from_locations): New method. + 2016-08-19 David Malcolm * include/line-map.h (fixit_hint::kind): Delete REPLACE. diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index f65931c5e527..a2ed008dd910 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; };