From fd3638dfcb5df7759c9c5d5b0da82e244acc242e Mon Sep 17 00:00:00 2001 From: bothner Date: Fri, 5 Dec 2003 20:52:39 +0000 Subject: [PATCH] * line-map.h (source_location): New typedef. (fileline): Redefined as source_location. (struct line_map, linemap_add, linemap_lookup): Replace filefile by source_location. * line-map.c (linemap_add, linemap_lookup): Use source_location. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74344 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++++++ gcc/line-map.c | 6 +++--- gcc/line-map.h | 14 ++++++++------ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9d91798..eaaff18 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-12-05 Per Bothner + + * line-map.h (source_location): New typedef. + (fileline): Redefined as source_location. + (struct line_map, linemap_add, linemap_lookup): Replace filefile + by source_location. + * line-map.c (linemap_add, linemap_lookup): Use source_location. + 2003-12-05 Richard Henderson * config/alpha/alpha.c (alpha_build_builtin_va_list): Add dummy @@ -96,6 +104,7 @@ PR target/12467 * config/rs6000/altivec.md (altivec_vmsummbm): Fix typo. +>>>>>>> 2.1930 2003-12-04 Stuart Hastings * rs6000.c (output_call, macho_branch_islands, diff --git a/gcc/line-map.c b/gcc/line-map.c index f04350d..521c4e5 100644 --- a/gcc/line-map.c +++ b/gcc/line-map.c @@ -1,5 +1,5 @@ /* Map logical line numbers to (source file, line number) pairs. - Copyright (C) 2001 + Copyright (C) 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -75,7 +75,7 @@ linemap_free (struct line_maps *set) const struct line_map * linemap_add (struct line_maps *set, enum lc_reason reason, - unsigned int sysp, unsigned int from_line, + unsigned int sysp, source_location from_line, const char *to_file, unsigned int to_line) { struct line_map *map; @@ -166,7 +166,7 @@ linemap_add (struct line_maps *set, enum lc_reason reason, the list is sorted and we can use a binary search. */ const struct line_map * -linemap_lookup (struct line_maps *set, unsigned int line) +linemap_lookup (struct line_maps *set, source_location line) { unsigned int md, mn = 0, mx = set->used; diff --git a/gcc/line-map.h b/gcc/line-map.h index b53f5e0..c57f51a 100644 --- a/gcc/line-map.h +++ b/gcc/line-map.h @@ -1,5 +1,5 @@ /* Map logical line numbers to (source file, line number) pairs. - Copyright (C) 2001 + Copyright (C) 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -32,8 +32,9 @@ 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; + and effectively typedef source_location location_t. */ +typedef unsigned int source_location; +typedef source_location fileline; /* deprecated name */ /* 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 @@ -47,7 +48,7 @@ struct line_map { const char *to_file; unsigned int to_line; - fileline from_line; + source_location from_line; int included_from; ENUM_BITFIELD (lc_reason) reason : CHAR_BIT; unsigned char sysp; @@ -92,11 +93,12 @@ 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, - fileline from_line, const char *to_file, unsigned int to_line); + source_location 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 *, fileline); +extern const struct line_map *linemap_lookup + (struct line_maps *, source_location); /* 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 -- 2.7.4