From ad8f37d1ba63a4d799f35e2244b2facb0fedf59b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 5 Dec 2007 00:48:49 +0000 Subject: Stringpool stats. Also make Symbol_table support functions inline. --- gold/stringpool.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gold/stringpool.cc') diff --git a/gold/stringpool.cc b/gold/stringpool.cc index 39bb9d0..19698e2 100644 --- a/gold/stringpool.cc +++ b/gold/stringpool.cc @@ -457,6 +457,24 @@ Stringpool_template::write(Output_file* of, off_t offset) of->write_output_view(offset, this->strtab_size_, view); } +// Print statistical information to stderr. This is used for --stats. + +template +void +Stringpool_template::print_stats(const char* name) const +{ +#if defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_EXT_HASH_MAP) + fprintf(stderr, _("%s: %s entries: %zu; buckets: %zu\n"), + program_name, name, this->string_set_.size(), + this->string_set_.bucket_count()); +#else + fprintf(stderr, _("%s: %s entries: %zu\n"), + program_name, name, this->table_.size()); +#endif + fprintf(stderr, _("%s: %s Stringdata structures: %zu\n"), + program_name, name, this->strings_.size()); +} + // Instantiate the templates we need. template -- cgit v1.1