aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-12-05 00:48:49 +0000
committerIan Lance Taylor <iant@google.com>2007-12-05 00:48:49 +0000
commitad8f37d1ba63a4d799f35e2244b2facb0fedf59b (patch)
tree482c8bc7b18aa41c439f40f4d1dbe42a9229442b /gold/symtab.cc
parent055f1d8ffcf99cdc50eb47e5cbfae62635b5c041 (diff)
downloadgdb-ad8f37d1ba63a4d799f35e2244b2facb0fedf59b.zip
gdb-ad8f37d1ba63a4d799f35e2244b2facb0fedf59b.tar.gz
gdb-ad8f37d1ba63a4d799f35e2244b2facb0fedf59b.tar.bz2
Stringpool stats. Also make Symbol_table support functions inline.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 6094c2a..40b3080 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -306,20 +306,18 @@ Symbol_table::~Symbol_table()
{
}
-// The hash function. The key is always canonicalized, so we use a
-// simple combination of the pointers.
+// The hash function. The key values are Stringpool keys.
-size_t
+inline size_t
Symbol_table::Symbol_table_hash::operator()(const Symbol_table_key& key) const
{
return key.first ^ key.second;
}
-// The symbol table key equality function. This is only called with
-// canonicalized name and version strings, so we can use pointer
-// comparison.
+// The symbol table key equality function. This is called with
+// Stringpool keys.
-bool
+inline bool
Symbol_table::Symbol_table_eq::operator()(const Symbol_table_key& k1,
const Symbol_table_key& k2) const
{
@@ -1909,6 +1907,7 @@ Symbol_table::print_stats() const
fprintf(stderr, _("%s: symbol table entries: %zu\n"),
program_name, this->table_.size());
#endif
+ this->namepool_.print_stats("symbol table stringpool");
}
// We check for ODR violations by looking for symbols with the same