/* Read and write coverage files, and associated functionality.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999,
- 2000, 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2000, 2001, 2003, 2004, 2005, 2007, 2008 Free Software Foundation,
+ Inc.
Contributed by James E. Wilson, UC Berkeley/Cygnus Support;
based on some ideas from Dain Samples of UC Berkeley.
Further mangling by Bob Manson, Cygnus Support.
#include "expr.h"
#include "function.h"
#include "toplev.h"
+#include "tm_p.h"
#include "ggc.h"
#include "coverage.h"
#include "langhooks.h"
#include "hashtab.h"
#include "tree-iterator.h"
#include "cgraph.h"
+#include "tree-pass.h"
#include "gcov-io.c"
static hashval_t
htab_counts_entry_hash (const void *of)
{
- const counts_entry_t *entry = of;
+ const counts_entry_t *const entry = (const counts_entry_t *) of;
return entry->ident * GCOV_COUNTERS + entry->ctr;
}
static int
htab_counts_entry_eq (const void *of1, const void *of2)
{
- const counts_entry_t *entry1 = of1;
- const counts_entry_t *entry2 = of2;
+ const counts_entry_t *const entry1 = (const counts_entry_t *) of1;
+ const counts_entry_t *const entry2 = (const counts_entry_t *) of2;
return entry1->ident == entry2->ident && entry1->ctr == entry2->ctr;
}
static void
htab_counts_entry_del (void *of)
{
- counts_entry_t *entry = of;
+ counts_entry_t *const entry = (counts_entry_t *) of;
free (entry->counts);
free (entry);
static int warned = 0;
if (!warned++)
- inform ((flag_guess_branch_prob
+ inform (input_location, (flag_guess_branch_prob
? "file %s not found, execution counts estimated"
: "file %s not found, execution counts assumed to be zero"),
da_file_name);
elt.ident = current_function_funcdef_no + 1;
elt.ctr = counter;
- entry = htab_find (counts_hash, &elt);
+ entry = (counts_entry_t *) htab_find (counts_hash, &elt);
if (!entry)
{
warning (0, "no coverage for function %qs found", IDENTIFIER_POINTER
if (!inhibit_warnings)
{
if (entry->checksum != checksum)
- inform ("checksum is %x instead of %x", entry->checksum, checksum);
+ inform (input_location, "checksum is %x instead of %x", entry->checksum, checksum);
else
- inform ("number of counters is %d instead of %d",
+ inform (input_location, "number of counters is %d instead of %d",
entry->summary.num, expected);
}
&& !inhibit_warnings
&& !warned++)
{
- inform ("coverage mismatch ignored due to -Wcoverage-mismatch");
- inform (flag_guess_branch_prob
+ inform (input_location, "coverage mismatch ignored due to -Wcoverage-mismatch");
+ inform (input_location, flag_guess_branch_prob
? "execution counts estimated"
: "execution counts assumed to be zero");
if (!flag_guess_branch_prob)
- inform ("this can result in poorly optimized code");
+ inform (input_location, "this can result in poorly optimized code");
}
return NULL;
ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", counter + 1);
DECL_NAME (tree_ctr_tables[counter]) = get_identifier (buf);
DECL_ALIGN (tree_ctr_tables[counter]) = TYPE_ALIGN (gcov_type_node);
+
+ if (dump_file)
+ fprintf (dump_file, "Using data file %s\n", da_file_name);
}
fn_b_ctrs[counter] = fn_n_ctrs[counter];
fn_n_ctrs[counter] += num;
_GLOBAL__N_<filename>_<wrongmagicnumber>_<magicnumber>functionname
since filename might contain extra underscores there seems
to be no better chance then walk all possible offsets looking
- for magicnuber. */
+ for magicnumber. */
if (offset)
{
for (i = i + offset; string[i]; i++)