diff options
author | David Malcolm <dmalcolm@redhat.com> | 2015-11-02 19:47:03 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2015-11-02 19:47:03 +0000 |
commit | 525ce91010c1606b6d8cb0155ef23321bb556aad (patch) | |
tree | db9b37e922843db6316a583629c8e361352b1328 /libcpp | |
parent | 5c1a2e639a26f1582318ac6f547a8819ea7c6034 (diff) | |
download | gcc-525ce91010c1606b6d8cb0155ef23321bb556aad.zip gcc-525ce91010c1606b6d8cb0155ef23321bb556aad.tar.gz gcc-525ce91010c1606b6d8cb0155ef23321bb556aad.tar.bz2 |
libcpp: Improvements to description of source_location in line-map.h
libcpp/ChangeLog:
* include/line-map.h (source_location): In the table in the
descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION,
LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION.
Add notes about ad-hoc values.
From-SVN: r229673
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 7 | ||||
-rw-r--r-- | libcpp/include/line-map.h | 23 |
2 files changed, 25 insertions, 5 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index f474fe7..295124e 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,10 @@ +2015-11-02 David Malcolm <dmalcolm@redhat.com> + + * include/line-map.h (source_location): In the table in the + descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION, + LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION. + Add notes about ad-hoc values. + 2015-10-21 Mikhail Maltsev <maltsevm@gmail.com> * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING. diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index e718fc2..e5867ed 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -59,8 +59,10 @@ typedef unsigned int linenum_type; Actual | Value | Meaning -----------+-------------------------------+------------------------------- - 0x00000000 | | Reserved for use by libcpp - 0x00000001 | RESERVED_LOCATION_COUNT - 1 | Reserved for use by libcpp + 0x00000000 | UNKNOWN_LOCATION (gcc/input.h)| Unknown/invalid location. + -----------+-------------------------------+------------------------------- + 0x00000001 | BUILTINS_LOCATION | The location for declarations + | (gcc/input.h) | in "<built-in>" -----------+-------------------------------+------------------------------- 0x00000002 | RESERVED_LOCATION_COUNT | The first location to be | (also | handed out, and the @@ -94,6 +96,16 @@ typedef unsigned int linenum_type; | | (unallocated integers) | + 0x60000000 | LINE_MAP_MAX_LOCATION_WITH_COLS + | Beyond this point, ordinary linemaps have 0 bits per column: + | each increment of the value corresponds to a new source line. + | + 0x70000000 | LINE_MAP_MAX_SOURCE_LOCATION + | Beyond the point, we give up on ordinary maps; attempts to + | create locations in them lead to UNKNOWN_LOCATION (0). + | + | (unallocated integers) + | | Macro maps grow this way | ^^^^^^^^^^^^^^^^^^^^^^^^ | | @@ -107,10 +119,11 @@ typedef unsigned int linenum_type; | macromap[1]->start_location | Start of macro map 1 -----------+-------------------------------+------------------------------- | macromap[0]->start_location | Start of macro map 0 - 0x7fffffff | MAX_SOURCE_LOCATION | + 0x7fffffff | MAX_SOURCE_LOCATION | Also used as a mask for + | | accessing the ad-hoc data table -----------+-------------------------------+------------------------------- - 0x80000000 | Start of ad-hoc values | - ... | | + 0x80000000 | Start of ad-hoc values; the lower 31 bits are used as an index + ... | into the line_table->location_adhoc_data_map.data array. 0xffffffff | UINT_MAX | -----------+-------------------------------+------------------------------- |