|
| 1 | +diff --git a/.gitignore b/.gitignore |
| 2 | +index b33f18f8ef8..8c881b0c8a5 100644 |
| 3 | +--- a/.gitignore |
| 4 | ++++ b/.gitignore |
| 5 | +@@ -24,6 +24,8 @@ venv/ |
| 6 | + include/ord/Version.hh |
| 7 | + |
| 8 | + build |
| 9 | ++build_linux |
| 10 | ++build_mac |
| 11 | + test/results |
| 12 | + flow |
| 13 | + |
| 14 | +diff --git a/src/gui/include/gui/gui.h b/src/gui/include/gui/gui.h |
| 15 | +index a182172d5f2..fa64aaf2832 100644 |
| 16 | +--- a/src/gui/include/gui/gui.h |
| 17 | ++++ b/src/gui/include/gui/gui.h |
| 18 | +@@ -803,8 +803,32 @@ class Gui |
| 19 | + utl::Logger* logger_; |
| 20 | + odb::dbDatabase* db_; |
| 21 | + |
| 22 | ++ // There are RTTI implementation differences between libstdc++ and libc++, |
| 23 | ++ // where the latter seems to generate multiple typeids for classes including |
| 24 | ++ // but not limited to sta::Instance* in different compile units. We have been |
| 25 | ++ // unable to remedy this. |
| 26 | ++ // |
| 27 | ++ // These classes are a workaround such that unless __GLIBCXX__ is set, hashing |
| 28 | ++ // and comparing are done on the type's name instead, which adds a negligible |
| 29 | ++ // performance penalty but has the distinct advantage of not crashing when an |
| 30 | ++ // Instance is clicked in the GUI. |
| 31 | ++ // |
| 32 | ++ // In the event the RTTI issue is ever resolved, the following two structs may |
| 33 | ++ // be removed. |
| 34 | ++ struct TypeInfoHasher |
| 35 | ++ { |
| 36 | ++ std::size_t operator()(const std::type_index& x) const; |
| 37 | ++ }; |
| 38 | ++ struct TypeInfoComparator |
| 39 | ++ { |
| 40 | ++ bool operator()(const std::type_index& a, const std::type_index& b) const; |
| 41 | ++ }; |
| 42 | ++ |
| 43 | + // Maps types to descriptors |
| 44 | +- std::unordered_map<std::type_index, std::unique_ptr<const Descriptor>> |
| 45 | ++ std::unordered_map<std::type_index, |
| 46 | ++ std::unique_ptr<const Descriptor>, |
| 47 | ++ TypeInfoHasher, |
| 48 | ++ TypeInfoComparator> |
| 49 | + descriptors_; |
| 50 | + // Heatmaps |
| 51 | + std::set<HeatMapDataSource*> heat_maps_; |
| 52 | +diff --git a/src/gui/src/gui.cpp b/src/gui/src/gui.cpp |
| 53 | +index 4762022dd84..49a2f493086 100644 |
| 54 | +--- a/src/gui/src/gui.cpp |
| 55 | ++++ b/src/gui/src/gui.cpp |
| 56 | +@@ -1336,6 +1336,26 @@ void Gui::updateTimingReport() |
| 57 | + main_window->getTimingWidget()->populatePaths(); |
| 58 | + } |
| 59 | + |
| 60 | ++// See class header for documentation. |
| 61 | ++std::size_t Gui::TypeInfoHasher::operator()(const std::type_index& x) const |
| 62 | ++{ |
| 63 | ++#ifdef __GLIBCXX__ |
| 64 | ++ return std::hash<std::type_index>{}(x); |
| 65 | ++#else |
| 66 | ++ return std::hash<std::string_view>{}(std::string_view(x.name())); |
| 67 | ++#endif |
| 68 | ++} |
| 69 | ++// See class header for documentation. |
| 70 | ++bool Gui::TypeInfoComparator::operator()(const std::type_index& a, |
| 71 | ++ const std::type_index& b) const |
| 72 | ++{ |
| 73 | ++#ifdef __GLIBCXX__ |
| 74 | ++ return a == b; |
| 75 | ++#else |
| 76 | ++ return strcmp(a.name(), b.name()) == 0; |
| 77 | ++#endif |
| 78 | ++} |
| 79 | ++ |
| 80 | + class SafeApplication : public QApplication |
| 81 | + { |
| 82 | + public: |
0 commit comments