diff options
Diffstat (limited to 'dwflpp.h')
-rw-r--r-- | dwflpp.h | 25 |
1 files changed, 5 insertions, 20 deletions
@@ -15,6 +15,7 @@ #include "dwarf_wrappers.h" #include "elaborate.h" #include "session.h" +#include "unordered.h" #include <cstring> #include <iostream> @@ -43,33 +44,17 @@ struct dwarf_query; enum line_t { ABSOLUTE, RELATIVE, RANGE, WILDCARD }; enum info_status { info_unknown, info_present, info_absent }; -#ifdef HAVE_TR1_UNORDERED_MAP -#include <tr1/unordered_map> -template<class K, class V> struct stap_map { - typedef std::tr1::unordered_map<K, V> type; -}; -#else -#include <ext/hash_map> -template<class K, class V> struct stap_map { - typedef __gnu_cxx::hash_map<K, V, stap_map> type; - size_t operator() (std::string const& s) const - { __gnu_cxx::hash<const char*> h; return h(s.c_str()); } - size_t operator() (void* const& p) const - { __gnu_cxx::hash<long> h; return h(reinterpret_cast<long>(p)); } -}; -#endif - // module -> cu die[] -typedef stap_map<Dwarf*, std::vector<Dwarf_Die>*>::type module_cu_cache_t; +typedef unordered_map<Dwarf*, std::vector<Dwarf_Die>*> module_cu_cache_t; // function -> die -typedef stap_map<std::string, Dwarf_Die>::type cu_function_cache_t; +typedef unordered_map<std::string, Dwarf_Die> cu_function_cache_t; // cu die -> (function -> die) -typedef stap_map<void*, cu_function_cache_t*>::type mod_cu_function_cache_t; +typedef unordered_map<void*, cu_function_cache_t*> mod_cu_function_cache_t; // inline function die -> instance die[] -typedef stap_map<void*, std::vector<Dwarf_Die>*>::type cu_inl_function_cache_t; +typedef unordered_map<void*, std::vector<Dwarf_Die>*> cu_inl_function_cache_t; typedef std::vector<func_info> func_info_map_t; typedef std::vector<inline_instance_info> inline_instance_map_t; |