Changeset View
Changeset View
Standalone View
Standalone View
src/analyze/gui/parser.cpp
Show All 22 Lines | |||||
23 | 23 | | |||
24 | #include <QDebug> | 24 | #include <QDebug> | ||
25 | 25 | | |||
26 | #include "analyze/accumulatedtracedata.h" | 26 | #include "analyze/accumulatedtracedata.h" | ||
27 | 27 | | |||
28 | #include <future> | 28 | #include <future> | ||
29 | #include <tuple> | 29 | #include <tuple> | ||
30 | #include <vector> | 30 | #include <vector> | ||
31 | #include <unordered_map> | ||||
31 | 32 | | |||
32 | using namespace std; | 33 | using namespace std; | ||
33 | 34 | | |||
35 | // Only use this hash when filling in the cache | ||||
36 | struct CacheSymbolHash | ||||
37 | { | ||||
38 | std::size_t operator()(const Symbol &symbol) const noexcept | ||||
39 | { | ||||
40 | size_t seed = 0; | ||||
41 | boost::hash_combine(seed, std::hash<QString>{}(symbol.symbol)); | ||||
42 | boost::hash_combine(seed, std::hash<QString>{}(symbol.binary)); | ||||
43 | boost::hash_combine(seed, std::hash<QString>{}(symbol.path)); | ||||
44 | return seed; | ||||
45 | } | ||||
46 | }; | ||||
47 | | ||||
34 | namespace { | 48 | namespace { | ||
35 | 49 | | |||
36 | struct Location | 50 | struct Location | ||
37 | { | 51 | { | ||
38 | Symbol symbol; | 52 | Symbol symbol; | ||
39 | FileLine fileLine; | 53 | FileLine fileLine; | ||
40 | }; | 54 | }; | ||
41 | 55 | | |||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 101 | { | |||
88 | transform(strings.begin() + m_strings.size(), strings.end(), back_inserter(m_strings), | 102 | transform(strings.begin() + m_strings.size(), strings.end(), back_inserter(m_strings), | ||
89 | [](const string& str) { return QString::fromStdString(str); }); | 103 | [](const string& str) { return QString::fromStdString(str); }); | ||
90 | } | 104 | } | ||
91 | 105 | | |||
92 | vector<QString> m_strings; | 106 | vector<QString> m_strings; | ||
93 | // interned module basenames | 107 | // interned module basenames | ||
94 | mutable QHash<QString, QString> m_pathToBinaries; | 108 | mutable QHash<QString, QString> m_pathToBinaries; | ||
95 | // existing symbols | 109 | // existing symbols | ||
96 | mutable std::map<Symbol, SymbolId, Symbol::FullLessThan> m_symbols; | 110 | mutable std::unordered_map<Symbol, SymbolId, CacheSymbolHash, Symbol::FullEqual> m_symbols; | ||
97 | 111 | | |||
98 | bool diffMode = false; | 112 | bool diffMode = false; | ||
99 | 113 | | |||
100 | mutable SymbolId m_nextSymbolId = 0; | 114 | mutable SymbolId m_nextSymbolId = 0; | ||
101 | }; | 115 | }; | ||
102 | 116 | | |||
103 | struct ChartMergeData | 117 | struct ChartMergeData | ||
104 | { | 118 | { | ||
▲ Show 20 Lines • Show All 540 Lines • Show Last 20 Lines |