From d672cded1fc033ff53b3b644272512822364703c Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 23 Aug 2016 20:20:48 +0000 Subject: line-map.h: add source_range::from_locations libcpp/ChangeLog: * include/line-map.h (source_range::from_locations): New method. From-SVN: r239711 --- libcpp/include/line-map.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libcpp/include') 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; }; -- cgit v1.1