diff options
author | Ian Lance Taylor <iant@google.com> | 2007-12-05 00:48:49 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-12-05 00:48:49 +0000 |
commit | ad8f37d1ba63a4d799f35e2244b2facb0fedf59b (patch) | |
tree | 482c8bc7b18aa41c439f40f4d1dbe42a9229442b /gold/stringpool.cc | |
parent | 055f1d8ffcf99cdc50eb47e5cbfae62635b5c041 (diff) | |
download | gdb-ad8f37d1ba63a4d799f35e2244b2facb0fedf59b.zip gdb-ad8f37d1ba63a4d799f35e2244b2facb0fedf59b.tar.gz gdb-ad8f37d1ba63a4d799f35e2244b2facb0fedf59b.tar.bz2 |
Stringpool stats. Also make Symbol_table support functions inline.
Diffstat (limited to 'gold/stringpool.cc')
-rw-r--r-- | gold/stringpool.cc | 18 |
1 files changed, 18 insertions, 0 deletions
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<Stringpool_char>::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<typename Stringpool_char> +void +Stringpool_template<Stringpool_char>::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 |