From c426b3d98af4c3cc48d97322001963f8b886e8e9 Mon Sep 17 00:00:00 2001 From: "jimblandy@gmail.com" Date: Thu, 3 Sep 2009 18:27:16 +0000 Subject: Breakpad: Don't use the deprecated __gnu_cxx::hash_map container. Modern GNU compilers warn about the #inclusion of ; that container is deprecated, and code should use instead. However, to stay within the boundaries of C++ '98, it's probably fine just to use plain old std::map. Breakpad uses hash_map in three cases: o The DWARF reader's SectionMap type maps object file section names to data. This map is consulted once per section kind per DWARF compilation unit; it is not performance-critical. o The Mac dump_syms tool uses it to map machine architectures to section maps in Universal binaries. It's hard to imagine there ever being more than two entries in such a map. o The processor's BasicSourceLineResolver uses a hash_map to map file numbers to file names. This is the map that will probably have the most entries, but it's only accessed once per frame, after we've found the frame's line entry. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@393 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/processor/basic_source_line_resolver.cc | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/processor') diff --git a/src/processor/basic_source_line_resolver.cc b/src/processor/basic_source_line_resolver.cc index fe04439e..63a94a3a 100644 --- a/src/processor/basic_source_line_resolver.cc +++ b/src/processor/basic_source_line_resolver.cc @@ -51,9 +51,6 @@ using std::map; using std::vector; using std::make_pair; -#ifndef BSLR_NO_HASH_MAP -using __gnu_cxx::hash; -#endif // BSLR_NO_HASH_MAP namespace google_breakpad { @@ -125,11 +122,7 @@ class BasicSourceLineResolver::Module { private: friend class BasicSourceLineResolver; -#ifdef BSLR_NO_HASH_MAP typedef map FileMap; -#else // BSLR_NO_HASH_MAP - typedef hash_map FileMap; -#endif // BSLR_NO_HASH_MAP // The types for stack_info_. This is equivalent to MS DIA's // StackFrameTypeEnum. Each identifies a different type of frame @@ -702,15 +695,9 @@ bool BasicSourceLineResolver::Module::ParseStackInfo(char *stack_info_line) { return true; } -#ifdef BSLR_NO_HASH_MAP bool BasicSourceLineResolver::CompareString::operator()( const string &s1, const string &s2) const { return strcmp(s1.c_str(), s2.c_str()) < 0; } -#else // BSLR_NO_HASH_MAP -size_t BasicSourceLineResolver::HashString::operator()(const string &s) const { - return hash()(s.c_str()); -} -#endif // BSLR_NO_HASH_MAP } // namespace google_breakpad -- cgit v1.2.1