This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] line-map.h: add source_range::from_locations
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Tue, 23 Aug 2016 16:52:28 -0400
- Subject: [committed] line-map.h: add source_range::from_locations
- Authentication-results: sourceware.org; auth=none
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu.
Committed to trunk as r239711.
libcpp/ChangeLog:
* include/line-map.h (source_range::from_locations): New method.
---
libcpp/include/line-map.h | 10 ++++++++++
1 file changed, 10 insertions(+)
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;
};
--
1.8.5.3