line-map.h: add source_range::from_locations

libcpp/ChangeLog:
	* include/line-map.h (source_range::from_locations): New method.

From-SVN: r239711
This commit is contained in:
David Malcolm 2016-08-23 20:20:48 +00:00 committed by David Malcolm
parent 0da825e962
commit d672cded1f
2 changed files with 14 additions and 0 deletions

View File

@ -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.

View File

@ -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;
};