summaryrefslogtreecommitdiff
path: root/libcpp/ChangeLog
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-21 14:52:09 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-21 14:52:09 +0000
commit3cff347ab261f0be00d79ebe005ea87867044a6a (patch)
treed6ef29716f94168c6e65dfa60ed66087d0e70533 /libcpp/ChangeLog
parenta8cf79e68422820c79e7cc8d78fea274d1b8080b (diff)
downloadgcc-3cff347ab261f0be00d79ebe005ea87867044a6a.tar.gz
Handle lines encoded into several maps in linemap_position_for_loc_and_offset
linemap_position_for_loc_and_offset() tries to generate a location_t encoding a column offset from the current location, for example, point to a certain character inside a string. This is trivial to do when the new location "fits within" the map of the original location. However, it may happen that the (long) line corresponding to the original location is encoded in several maps, thus the new location should actually be encoded in a subsequent map from the original location. This patch detects this case and adjusts the map correspondingly. (This shows that the line-map representation is quite wasteful in this case, because line-maps always start at column 0. That is, map[0] highest location may encode up to line 8 column 80, then map[1]->start_location starts encoding at line 8 column 0. Thus, there are two location_t values that point to the same source location.) libcpp/ChangeLog: 2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/66415 * line-map.c (linemap_position_for_loc_and_offset): Handle the case of long lines encoded in multiple maps. gcc/testsuite/ChangeLog: 2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/66415 * gcc.dg/cpp/pr66415-1.c: Test column number. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227975 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/ChangeLog')
-rw-r--r--libcpp/ChangeLog6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 3173bf558d1..5cb23d03267 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR c/66415
+ * line-map.c (linemap_position_for_loc_and_offset): Handle the
+ case of long lines encoded in multiple maps.
+
2015-09-07 Marek Polacek <polacek@redhat.com>
* system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.