* stringpool.cc (Stringpool_template::reserve): Add
authorIan Lance Taylor <iant@google.com>
Fri, 20 Dec 2013 05:54:43 +0000 (21:54 -0800)
committerIan Lance Taylor <iant@google.com>
Fri, 20 Dec 2013 05:54:43 +0000 (21:54 -0800)
HAVE_UNORDERED_MAP case.
* stringpool.cc (Stringpool_template::print_stats): Likewise.

gold/ChangeLog
gold/stringpool.cc

index 2e269463bac7a4eb9ea3c869870d39c0aa761648..1cec15ea45d4660d450f83a9c38211aefc8dbc64 100644 (file)
@@ -1,3 +1,9 @@
+2013-12-19  Dimitry Andric  <dimitry@andric.com>
+
+       * stringpool.cc (Stringpool_template::reserve): Add
+       HAVE_UNORDERED_MAP case.
+       * stringpool.cc (Stringpool_template::print_stats): Likewise.
+
 2013-12-18  Cary Coutant  <ccoutant@google.com>
 
        * configure.ac: Check for <unordered_set> and <unordered_map>.
index 665fcc8ce59d7e62dcebd9c36dbdda88b2dfa097..00ed1842bd013a833b4aa5dd60b95e12128e3882 100644 (file)
@@ -73,7 +73,10 @@ Stringpool_template<Stringpool_char>::reserve(unsigned int n)
 {
   this->key_to_offset_.reserve(n);
 
-#if defined(HAVE_TR1_UNORDERED_MAP)
+#if defined(HAVE_UNORDERED_MAP)
+  this->string_set_.rehash(this->string_set_.size() + n);
+  return;
+#elif defined(HAVE_TR1_UNORDERED_MAP)
   // rehash() implementation is broken in gcc 4.0.3's stl
   //this->string_set_.rehash(this->string_set_.size() + n);
   //return;
@@ -503,7 +506,7 @@ 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)
+#if defined(HAVE_UNORDERED_MAP) || 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());