diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2003-07-22 16:24:53 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2003-07-22 16:24:53 +0000 |
commit | a2f7be91fc5f7347408fb24fe132194be4860bec (patch) | |
tree | f17d769828f9016a03c5e139b2664c5e6bed6bec /gcc | |
parent | bef89e9e0929d4c17cfa23c0ab8c8cc3315a88c9 (diff) | |
download | gcc-a2f7be91fc5f7347408fb24fe132194be4860bec.zip gcc-a2f7be91fc5f7347408fb24fe132194be4860bec.tar.gz gcc-a2f7be91fc5f7347408fb24fe132194be4860bec.tar.bz2 |
hashtable.c (approx_sqrt): Make static.
* hashtable.c (approx_sqrt): Make static.
* hashtable.h: Don't prototype approx_sqrt.
* line-map.c (init_line_maps): Rename linemap_init.
(free_line_maps): Rename linemap_free.
(add_line_map): Rename linemap_add.
(lookup_line): Rename linemap_lookup.
(print_containing_files): Rename linemap_print_containing_files.
* linemap.h: Update to match.
* cpperror.c, cppinit.c, cpplib.c, cppmacro.c: Update calls to
linemap routines to use new names.
From-SVN: r69672
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/cpperror.c | 4 | ||||
-rw-r--r-- | gcc/cppinit.c | 4 | ||||
-rw-r--r-- | gcc/cpplib.c | 4 | ||||
-rw-r--r-- | gcc/cppmacro.c | 2 | ||||
-rw-r--r-- | gcc/hashtable.c | 3 | ||||
-rw-r--r-- | gcc/hashtable.h | 4 | ||||
-rw-r--r-- | gcc/line-map.c | 15 | ||||
-rw-r--r-- | gcc/line-map.h | 13 |
9 files changed, 40 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85eab61..065c768 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2003-07-22 Zack Weinberg <zack@codesourcery.com> + + * hashtable.c (approx_sqrt): Make static. + * hashtable.h: Don't prototype approx_sqrt. + * line-map.c (init_line_maps): Rename linemap_init. + (free_line_maps): Rename linemap_free. + (add_line_map): Rename linemap_add. + (lookup_line): Rename linemap_lookup. + (print_containing_files): Rename linemap_print_containing_files. + * linemap.h: Update to match. + + * cpperror.c, cppinit.c, cpplib.c, cppmacro.c: Update calls to + linemap routines to use new names. + 2003-07-16 Nathan Sidwell <nathan@codesourcery.com> * c-common.c (handle_packed_attribute): Don't pack a struct via a @@ -77,7 +91,7 @@ Tue Jul 22 00:42:12 CEST 2003 Jan Hubicka <jh@suse.cz> 2003-07-17 Eric Botcazou <ebotcazou@libertysurf.fr> - PR optimization/11536 + PR optimization/11536 * unroll.c (loop_iterations): Do not replace a register holding the final value by its equivalent before the loop if it is not invariant. @@ -93,7 +107,7 @@ Tue Jul 22 00:42:12 CEST 2003 Jan Hubicka <jh@suse.cz> 2003-07-20 Lisa M. Goldstein <opus@gnu.org> - * doc/invoke.texi: Fixes to style, grammar and diction. + * doc/invoke.texi: Fixes to style, grammar and diction. 2003-07-20 Roger Sayle <roger@eyesopen.com> diff --git a/gcc/cpperror.c b/gcc/cpperror.c index ceb4b93..310631d 100644 --- a/gcc/cpperror.c +++ b/gcc/cpperror.c @@ -44,8 +44,8 @@ print_location (cpp_reader *pfile, unsigned int line, unsigned int col) { const struct line_map *map; - map = lookup_line (&pfile->line_maps, line); - print_containing_files (&pfile->line_maps, map); + map = linemap_lookup (&pfile->line_maps, line); + linemap_print_containing_files (&pfile->line_maps, map); line = SOURCE_LINE (map, line); if (col == 0) diff --git a/gcc/cppinit.c b/gcc/cppinit.c index d019ee8..e5011ef 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -163,7 +163,7 @@ cpp_create_reader (enum c_lang lang, hash_table *table) /* Initialize the line map. Start at logical line 1, so we can use a line number of zero for special states. */ - init_line_maps (&pfile->line_maps); + linemap_init (&pfile->line_maps); /* Initialize lexer state. */ pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments); @@ -252,7 +252,7 @@ cpp_destroy (cpp_reader *pfile) free (context); } - free_line_maps (&pfile->line_maps); + linemap_free (&pfile->line_maps); free (pfile); } diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 69a1169..b732c30 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -898,8 +898,8 @@ _cpp_do_file_change (cpp_reader *pfile, enum lc_reason reason, const char *to_file, unsigned int file_line, unsigned int sysp) { - pfile->map = add_line_map (&pfile->line_maps, reason, sysp, - pfile->line, to_file, file_line); + pfile->map = linemap_add (&pfile->line_maps, reason, sysp, + pfile->line, to_file, file_line); if (pfile->cb.file_change) pfile->cb.file_change (pfile, pfile->map); diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 1cf55ef..045d4e3 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -80,7 +80,7 @@ _cpp_warn_if_unused_macro (cpp_reader *pfile, cpp_hashnode *node, cpp_macro *macro = node->value.macro; if (!macro->used - && MAIN_FILE_P (lookup_line (&pfile->line_maps, macro->line))) + && MAIN_FILE_P (linemap_lookup (&pfile->line_maps, macro->line))) cpp_error_with_line (pfile, DL_WARNING, macro->line, 0, "macro \"%s\" is not used", NODE_NAME (node)); } diff --git a/gcc/hashtable.c b/gcc/hashtable.c index 4740f1d..5254882 100644 --- a/gcc/hashtable.c +++ b/gcc/hashtable.c @@ -32,6 +32,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static unsigned int calc_hash (const unsigned char *, unsigned int); static void ht_expand (hash_table *); +static double approx_sqrt (double); /* Calculate the hash of the string STR of length LEN. */ @@ -275,7 +276,7 @@ ht_dump_statistics (hash_table *table) /* Return the approximate positive square root of a number N. This is for statistical reports, not code generation. */ -double +static double approx_sqrt (double x) { double s, d; diff --git a/gcc/hashtable.h b/gcc/hashtable.h index b14ab18..dd7c0b1 100644 --- a/gcc/hashtable.h +++ b/gcc/hashtable.h @@ -78,8 +78,4 @@ extern void ht_forall (hash_table *, ht_cb, const void *); /* Dump allocation statistics to stderr. */ extern void ht_dump_statistics (hash_table *); -/* Approximate positive square root of a host double. This is for - statistical reports, not code generation. */ -extern double approx_sqrt (double); - #endif /* GCC_HASHTABLE_H */ diff --git a/gcc/line-map.c b/gcc/line-map.c index 897af21..f3c2369 100644 --- a/gcc/line-map.c +++ b/gcc/line-map.c @@ -30,7 +30,7 @@ static void trace_include (const struct line_maps *, const struct line_map *); /* Initialize a line map set. */ void -init_line_maps (struct line_maps *set) +linemap_init (struct line_maps *set) { set->maps = 0; set->allocated = 0; @@ -43,7 +43,7 @@ init_line_maps (struct line_maps *set) /* Free a line map set. */ void -free_line_maps (struct line_maps *set) +linemap_free (struct line_maps *set) { if (set->maps) { @@ -68,9 +68,9 @@ free_line_maps (struct line_maps *set) function. */ const struct line_map * -add_line_map (struct line_maps *set, enum lc_reason reason, - unsigned int sysp, unsigned int from_line, - const char *to_file, unsigned int to_line) +linemap_add (struct line_maps *set, enum lc_reason reason, + unsigned int sysp, unsigned int from_line, + const char *to_file, unsigned int to_line) { struct line_map *map; @@ -151,7 +151,7 @@ add_line_map (struct line_maps *set, enum lc_reason reason, the list is sorted and we can use a binary search. */ const struct line_map * -lookup_line (struct line_maps *set, unsigned int line) +linemap_lookup (struct line_maps *set, unsigned int line) { unsigned int md, mn = 0, mx = set->used; @@ -175,7 +175,8 @@ lookup_line (struct line_maps *set, unsigned int line) the most recently listed stack is the same as the current one. */ void -print_containing_files (struct line_maps *set, const struct line_map *map) +linemap_print_containing_files (struct line_maps *set, + const struct line_map *map) { if (MAIN_FILE_P (map) || set->last_listed == map->included_from) return; diff --git a/gcc/line-map.h b/gcc/line-map.h index 8309f08..1176743 100644 --- a/gcc/line-map.h +++ b/gcc/line-map.h @@ -68,10 +68,10 @@ struct line_maps }; /* Initialize a line map set. */ -extern void init_line_maps (struct line_maps *); +extern void linemap_init (struct line_maps *); /* Free a line map set. */ -extern void free_line_maps (struct line_maps *); +extern void linemap_free (struct line_maps *); /* 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 @@ -82,19 +82,20 @@ extern void free_line_maps (struct line_maps *); FROM_LINE should be monotonic increasing across calls to this function. A call to this function can relocate the previous set of maps, so any stored line_map pointers should not be used. */ -extern const struct line_map *add_line_map +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); /* Given a logical line, returns the map from which the corresponding (source file, line) pair can be deduced. */ -extern const struct line_map *lookup_line (struct line_maps *, unsigned int); +extern const struct line_map *linemap_lookup (struct line_maps *, + unsigned int); /* 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 the most recently listed stack is the same as the current one. */ -extern void print_containing_files (struct line_maps *, - const struct line_map *); +extern void linemap_print_containing_files (struct line_maps *, + const struct line_map *); /* Converts a map and logical line to source line. */ #define SOURCE_LINE(MAP, LINE) ((LINE) + (MAP)->to_line - (MAP)->from_line) |