diff options
author | Per Bothner <pbothner@apple.com> | 2003-08-06 19:34:43 +0000 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 2003-08-06 12:34:43 -0700 |
commit | 8b82c52809e3ed72ae20c7b17725c34370cad1cf (patch) | |
tree | cd2aed5c69b804274d0c2f5cc4fe4b2cc5f29384 /gcc | |
parent | b869f90433f1efc9849bcd4ac3265985ee2b5d31 (diff) | |
download | gcc-8b82c52809e3ed72ae20c7b17725c34370cad1cf.zip gcc-8b82c52809e3ed72ae20c7b17725c34370cad1cf.tar.gz gcc-8b82c52809e3ed72ae20c7b17725c34370cad1cf.tar.bz2 |
line-map.h (fileline): New typedef.
* line-map.h (fileline): New typedef.
(struct line_map, linemap_add, linemap_lookup): Use it.
* input.h (struct location_s): Comment notes that long-term we want
to replace it by fileline.
From-SVN: r70205
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/input.h | 1 | ||||
-rw-r--r-- | gcc/line-map.h | 12 |
3 files changed, 16 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2041409..b918929 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-08-06 Per Bothner <pbothner@apple.com> + + * line-map.h (fileline): New typedef. + (struct line_map, linemap_add, linemap_lookup): Use it. + * input.h (struct location_s): Comment notes that long-term we want + to replace it by fileline. + 2003-08-06 J"orn Rennecke <joern.rennecke@superh.com> Fix SHcompact exception handling: diff --git a/gcc/input.h b/gcc/input.h index f422f74..7d08e11 100644 --- a/gcc/input.h +++ b/gcc/input.h @@ -23,6 +23,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define GCC_INPUT_H /* The data structure used to record a location in a translation unit. */ +/* Long-term, we want to get rid of this and typedef fileline location_t. */ struct location_s GTY (()) { /* The name of the source file involved. */ diff --git a/gcc/line-map.h b/gcc/line-map.h index dcb6f7d..983ba69 100644 --- a/gcc/line-map.h +++ b/gcc/line-map.h @@ -30,6 +30,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. (e.g. a #line directive in C). */ enum lc_reason {LC_ENTER = 0, LC_LEAVE, LC_RENAME}; +/* A logical line number, i,e, an "index" into a line_map. */ +/* Long-term, we want to use this to replace struct location_s (in input.h), + and effectively typedef fileline location_t. */ +typedef unsigned int fileline; + /* The logical line FROM_LINE maps to physical source file TO_FILE at line TO_LINE, and subsequently one-to-one until the next line_map structure in the set. INCLUDED_FROM is an index into the set that @@ -42,7 +47,7 @@ struct line_map { const char *to_file; unsigned int to_line; - unsigned int from_line; + fileline from_line; int included_from; ENUM_BITFIELD (lc_reason) reason : CHAR_BIT; unsigned char sysp; @@ -87,12 +92,11 @@ extern void linemap_free (struct line_maps *); maps, so any stored line_map pointers should not be used. */ extern const struct line_map *linemap_add (struct line_maps *, enum lc_reason, unsigned int sysp, - unsigned int from_line, const char *to_file, unsigned int to_line); + fileline from_line, const char *to_file, unsigned int to_line); /* Given a logical line, returns the map from which the corresponding (source file, line) pair can be deduced. */ -extern const struct line_map *linemap_lookup (struct line_maps *, - unsigned int); +extern const struct line_map *linemap_lookup (struct line_maps *, fileline); /* Print the file names and line numbers of the #include commands which led to the map MAP, if any, to stderr. Nothing is output if |