summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-23 20:20:48 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-23 20:20:48 +0000
commita59dbf081ffa9fcc794f189ec5eb14dc5e5ac5b6 (patch)
tree8f41240afb6e12321e582c483fe5a8e8832b2eb2 /libcpp
parent5233bf6ac244fb61cab7cba2f2db6469e54f4787 (diff)
downloadgcc-a59dbf081ffa9fcc794f189ec5eb14dc5e5ac5b6.tar.gz
line-map.h: add source_range::from_locations
libcpp/ChangeLog: * include/line-map.h (source_range::from_locations): New method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239711 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog4
-rw-r--r--libcpp/include/line-map.h10
2 files changed, 14 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index b0fd9b52ed8..448d63217e8 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 f65931c5e52..a2ed008dd91 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;
};