aboutsummaryrefslogtreecommitdiff
path: root/gcc/coverage.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/coverage.c')
-rw-r--r--gcc/coverage.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 44b616c..0eeaaa5 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -174,7 +174,7 @@ counts_entry::remove (value_type *entry)
}
/* Hash table of count data. */
-static hash_table <counts_entry> counts_hash;
+static hash_table<counts_entry> *counts_hash;
/* Read in the counts file, if available. */
@@ -215,7 +215,7 @@ read_counts_file (void)
tag = gcov_read_unsigned ();
bbg_file_stamp = crc32_unsigned (bbg_file_stamp, tag);
- counts_hash.create (10);
+ counts_hash = new hash_table<counts_entry> (10);
while ((tag = gcov_read_unsigned ()))
{
gcov_unsigned_t length;
@@ -270,7 +270,7 @@ read_counts_file (void)
elt.ident = fn_ident;
elt.ctr = GCOV_COUNTER_FOR_TAG (tag);
- slot = counts_hash.find_slot (&elt, INSERT);
+ slot = counts_hash->find_slot (&elt, INSERT);
entry = *slot;
if (!entry)
{
@@ -291,14 +291,16 @@ read_counts_file (void)
error ("checksum is (%x,%x) instead of (%x,%x)",
entry->lineno_checksum, entry->cfg_checksum,
lineno_checksum, cfg_checksum);
- counts_hash.dispose ();
+ delete counts_hash;
+ counts_hash = NULL;
break;
}
else if (entry->summary.num != n_counts)
{
error ("Profile data for function %u is corrupted", fn_ident);
error ("number of counters is %d instead of %d", entry->summary.num, n_counts);
- counts_hash.dispose ();
+ delete counts_hash;
+ counts_hash = NULL;
break;
}
else if (elt.ctr >= GCOV_COUNTERS_SUMMABLE)
@@ -324,7 +326,8 @@ read_counts_file (void)
{
error (is_error < 0 ? "%qs has overflowed" : "%qs is corrupted",
da_file_name);
- counts_hash.dispose ();
+ delete counts_hash;
+ counts_hash = NULL;
break;
}
}
@@ -342,7 +345,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
counts_entry_t *entry, elt;
/* No hash table, no counts. */
- if (!counts_hash.is_created ())
+ if (!counts_hash)
{
static int warned = 0;
@@ -358,7 +361,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
elt.ident = current_function_funcdef_no + 1;
elt.ctr = counter;
- entry = counts_hash.find (&elt);
+ entry = counts_hash->find (&elt);
if (!entry || !entry->summary.num)
/* The function was not emitted, or is weak and not chosen in the
final executable. Silently fail, because there's nothing we