Commit e2b9853b by Neil Booth Committed by Neil Booth

* line-map.c, line-map.h: Convert to ISO prototypes.

From-SVN: r68242
parent f139561c
2003-06-20 Neil Booth <neil@daikokuya.co.uk>
* line-map.c, line-map.h: Convert to ISO prototypes.
2003-06-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> 2003-06-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* gcse.c (store_killed_in_insn): Fix. * gcse.c (store_killed_in_insn): Fix.
......
...@@ -27,14 +27,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -27,14 +27,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "line-map.h" #include "line-map.h"
#include "intl.h" #include "intl.h"
static void trace_include static void trace_include (const struct line_maps *, const struct line_map *);
PARAMS ((const struct line_maps *, const struct line_map *));
/* Initialize a line map set. */ /* Initialize a line map set. */
void void
init_line_maps (set) init_line_maps (struct line_maps *set)
struct line_maps *set;
{ {
set->maps = 0; set->maps = 0;
set->allocated = 0; set->allocated = 0;
...@@ -47,8 +45,7 @@ init_line_maps (set) ...@@ -47,8 +45,7 @@ init_line_maps (set)
/* Free a line map set. */ /* Free a line map set. */
void void
free_line_maps (set) free_line_maps (struct line_maps *set)
struct line_maps *set;
{ {
if (set->maps) if (set->maps)
{ {
...@@ -73,13 +70,9 @@ free_line_maps (set) ...@@ -73,13 +70,9 @@ free_line_maps (set)
function. */ function. */
const struct line_map * const struct line_map *
add_line_map (set, reason, sysp, from_line, to_file, to_line) add_line_map (struct line_maps *set, enum lc_reason reason,
struct line_maps *set; unsigned int sysp, unsigned int from_line,
enum lc_reason reason; const char *to_file, unsigned int to_line)
unsigned int sysp;
unsigned int from_line;
const char *to_file;
unsigned int to_line;
{ {
struct line_map *map; struct line_map *map;
...@@ -161,9 +154,7 @@ add_line_map (set, reason, sysp, from_line, to_file, to_line) ...@@ -161,9 +154,7 @@ add_line_map (set, reason, sysp, from_line, to_file, to_line)
the list is sorted and we can use a binary search. */ the list is sorted and we can use a binary search. */
const struct line_map * const struct line_map *
lookup_line (set, line) lookup_line (struct line_maps *set, unsigned int line)
struct line_maps *set;
unsigned int line;
{ {
unsigned int md, mn = 0, mx = set->used; unsigned int md, mn = 0, mx = set->used;
...@@ -187,9 +178,7 @@ lookup_line (set, line) ...@@ -187,9 +178,7 @@ lookup_line (set, line)
the most recently listed stack is the same as the current one. */ the most recently listed stack is the same as the current one. */
void void
print_containing_files (set, map) print_containing_files (struct line_maps *set, const struct line_map *map)
struct line_maps *set;
const struct line_map *map;
{ {
if (MAIN_FILE_P (map) || set->last_listed == map->included_from) if (MAIN_FILE_P (map) || set->last_listed == map->included_from)
return; return;
...@@ -225,9 +214,7 @@ print_containing_files (set, map) ...@@ -225,9 +214,7 @@ print_containing_files (set, map)
/* Print an include trace, for e.g. the -H option of the preprocessor. */ /* Print an include trace, for e.g. the -H option of the preprocessor. */
static void static void
trace_include (set, map) trace_include (const struct line_maps *set, const struct line_map *map)
const struct line_maps *set;
const struct line_map *map;
{ {
unsigned int i = set->depth; unsigned int i = set->depth;
......
...@@ -68,12 +68,10 @@ struct line_maps ...@@ -68,12 +68,10 @@ struct line_maps
}; };
/* Initialize a line map set. */ /* Initialize a line map set. */
extern void init_line_maps extern void init_line_maps (struct line_maps *);
PARAMS ((struct line_maps *));
/* Free a line map set. */ /* Free a line map set. */
extern void free_line_maps extern void free_line_maps (struct line_maps *);
PARAMS ((struct line_maps *));
/* Add a mapping of logical source line to physical source file and /* Add a mapping of logical source line to physical source file and
line number. The text pointed to by TO_FILE must have a lifetime line number. The text pointed to by TO_FILE must have a lifetime
...@@ -85,19 +83,18 @@ extern void free_line_maps ...@@ -85,19 +83,18 @@ extern void free_line_maps
function. A call to this function can relocate the previous set of function. A call to this function can relocate the previous set of
maps, so any stored line_map pointers should not be used. */ maps, so any stored line_map pointers should not be used. */
extern const struct line_map *add_line_map extern const struct line_map *add_line_map
PARAMS ((struct line_maps *, enum lc_reason, unsigned int sysp, (struct line_maps *, enum lc_reason, unsigned int sysp,
unsigned int from_line, const char *to_file, unsigned int to_line)); unsigned int from_line, const char *to_file, unsigned int to_line);
/* Given a logical line, returns the map from which the corresponding /* Given a logical line, returns the map from which the corresponding
(source file, line) pair can be deduced. */ (source file, line) pair can be deduced. */
extern const struct line_map *lookup_line extern const struct line_map *lookup_line (struct line_maps *, unsigned int);
PARAMS ((struct line_maps *, unsigned int));
/* Print the file names and line numbers of the #include commands /* 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 which led to the map MAP, if any, to stderr. Nothing is output if
the most recently listed stack is the same as the current one. */ the most recently listed stack is the same as the current one. */
extern void print_containing_files extern void print_containing_files (struct line_maps *,
PARAMS ((struct line_maps *, const struct line_map *)); const struct line_map *);
/* Converts a map and logical line to source line. */ /* Converts a map and logical line to source line. */
#define SOURCE_LINE(MAP, LINE) ((LINE) + (MAP)->to_line - (MAP)->from_line) #define SOURCE_LINE(MAP, LINE) ((LINE) + (MAP)->to_line - (MAP)->from_line)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment