* 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
+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
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.
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>
{
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)
/* 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);
free (context);
}
- free_line_maps (&pfile->line_maps);
+ linemap_free (&pfile->line_maps);
free (pfile);
}
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);
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));
}
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. */
/* 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;
/* 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 */
/* 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;
/* Free a line map set. */
void
-free_line_maps (struct line_maps *set)
+linemap_free (struct line_maps *set)
{
if (set->maps)
{
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;
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;
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;
};
/* 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
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)