From: Ian Lance Taylor Date: Fri, 20 Dec 2013 05:54:43 +0000 (-0800) Subject: * stringpool.cc (Stringpool_template::reserve): Add X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c09fb0ba1f48543909dea5a988cf8f951699d10;p=binutils-gdb.git * stringpool.cc (Stringpool_template::reserve): Add HAVE_UNORDERED_MAP case. * stringpool.cc (Stringpool_template::print_stats): Likewise. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 2e269463bac..1cec15ea45d 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2013-12-19 Dimitry Andric + + * stringpool.cc (Stringpool_template::reserve): Add + HAVE_UNORDERED_MAP case. + * stringpool.cc (Stringpool_template::print_stats): Likewise. + 2013-12-18 Cary Coutant * configure.ac: Check for and . diff --git a/gold/stringpool.cc b/gold/stringpool.cc index 665fcc8ce59..00ed1842bd0 100644 --- a/gold/stringpool.cc +++ b/gold/stringpool.cc @@ -73,7 +73,10 @@ Stringpool_template::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 void Stringpool_template::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());