]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
line-map.h: add source_range::from_locations
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 23 Aug 2016 20:20:48 +0000 (20:20 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 23 Aug 2016 20:20:48 +0000 (20:20 +0000)
libcpp/ChangeLog:
* include/line-map.h (source_range::from_locations): New method.

From-SVN: r239711

libcpp/ChangeLog
libcpp/include/line-map.h

index b0fd9b52ed823670d8ab3836c4ef61d413810516..448d63217e8e756472e07c4b4abf21fc4365e2df 100644 (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.
index f65931c5e527038d32cf5eac1df0bb0d0f7b84ed..a2ed008dd9107b842f7f10ea6dc6dac4bd56be0f 100644 (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;
 };