aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-01 19:55:46 -0700
committerTom Tromey <tom@tromey.com>2019-03-15 16:02:08 -0600
commit1b7a07cba0aa096c2eb66895ef339aa5143e9995 (patch)
tree817c4e8fe6ceb3e62133833a2c40cf58e4f5f629 /gdb/objfiles.h
parent3db066bcd5bac9a8d6be85ea4cfa8f52dbdcc600 (diff)
downloadgdb-1b7a07cba0aa096c2eb66895ef339aa5143e9995.zip
gdb-1b7a07cba0aa096c2eb66895ef339aa5143e9995.tar.gz
gdb-1b7a07cba0aa096c2eb66895ef339aa5143e9995.tar.bz2
Use bitset for demangled_hash_languages
I noticed that objfile_per_bfd_storage::demangled_hash_languages is a std::vector, which seemed quite large for something that, fundamentally, can be represented as a bitset. This patch reimplements it as a std::bitset. gdb/ChangeLog 2019-03-15 Tom Tromey <tom@tromey.com> * objfiles.h (struct objfile_per_bfd_storage) <demangled_hash_languages>: Now a bitset. * minsyms.c (add_minsym_to_demangled_hash_table): Update. (lookup_minimal_symbol): Update.
Diffstat (limited to 'gdb/objfiles.h')
-rw-r--r--gdb/objfiles.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index c5ce9ee..47df002 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -28,6 +28,7 @@
#include "registry.h"
#include "gdb_bfd.h"
#include "psymtab.h"
+#include <bitset>
#include <vector>
#include "common/next-iterator.h"
#include "common/safe-iterator.h"
@@ -313,10 +314,8 @@ struct objfile_per_bfd_storage
minimal_symbol *msymbol_demangled_hash[MINIMAL_SYMBOL_HASH_SIZE] {};
/* All the different languages of symbols found in the demangled
- hash table. A flat/vector-based map is more efficient than a map
- or hash table here, since this will only usually contain zero or
- one entries. */
- std::vector<enum language> demangled_hash_languages;
+ hash table. */
+ std::bitset<nr_languages> demangled_hash_languages;
};
/* Master structure for keeping track of each file from which