aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2016-07-27 17:21:20 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2016-07-27 17:21:20 +0000
commita01fc54920d7d722eb9efc29156fe4a823d21265 (patch)
treee95187d29ed6854ea7491bfd9df3af7b2456d81d /libcpp
parent182f2f648a9bb55a4be594e4b9e6531fdea1a464 (diff)
downloadgcc-a01fc54920d7d722eb9efc29156fe4a823d21265.tar.gz
gcc-a01fc54920d7d722eb9efc29156fe4a823d21265.tar.bz2
gcc-a01fc54920d7d722eb9efc29156fe4a823d21265.zip
Move make_location from tree.h/c to input.h/c
For some reason I added make_location and some related functions to tree.h/c, rather than to input.h/c. Move them there, so we can use them without requiring tree, and add some selftest coverage. gcc/ChangeLog: * input.c (get_pure_location): Move here from tree.c. (make_location): Likewise. Add header comment. (selftest::test_accessing_ordinary_linemaps): Verify pure_location_p, make_location, get_location_from_adhoc_loc and get_range_from_loc. * input.h (get_pure_location): Move declaration here from tree.h. (get_finish): Likewise for inline function. (make_location): Likewise for declaration. * tree.c (get_pure_location): Move to input.c. (make_location): Likewise. * tree.h (get_pure_location): Move declaration to tree.h. (get_finish): Likewise for inline function. (make_location): Likewise for declaration. libcpp/ChangeLog: * include/line-map.h (source_location): Fix line numbers in comment. From-SVN: r238792
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog5
-rw-r--r--libcpp/include/line-map.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 168e08c15cf..0cdd75d956a 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-27 David Malcolm <dmalcolm@redhat.com>
+
+ * include/line-map.h (source_location): Fix line numbers in
+ comment.
+
2016-07-11 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES):
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
index 43576761e63..443086a0b70 100644
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@ -227,10 +227,10 @@ typedef unsigned int linenum_type;
11111111112
12345678901234567890
- 521
+ 522
523 return foo + bar;
~~~~^~~~~
- 523
+ 524
The location's caret is at the "+", line 523 column 15, but starts
earlier, at the "f" of "foo" at column 11. The finish is at the "r"