For performance, use unordered_set/map where possible. No functional change intended.

This commit is contained in:
Wilson Snyder
2020-11-25 20:57:30 -05:00
parent 085ef5fc05
commit f2d8e45d72
22 changed files with 34 additions and 28 deletions
+3 -2
View File
@@ -240,7 +240,7 @@ class HierBlockUsageCollectVisitor final : public AstNVisitor {
AstUser1InUse m_inuser1;
// STATE
typedef std::set<const AstModule*> ModuleSet;
typedef std::unordered_set<const AstModule*> ModuleSet;
V3HierBlockPlan* const m_planp;
AstModule* m_modp = nullptr; // The current module
AstModule* m_hierBlockp = nullptr; // The nearest parent module that is a hierarchical block
@@ -355,7 +355,8 @@ void V3HierBlockPlan::createPlan(AstNetlist* nodep) {
}
V3HierBlockPlan::HierVector V3HierBlockPlan::hierBlocksSorted() const {
typedef std::map<const V3HierBlock*, std::set<const V3HierBlock*>> ChildrenMap;
typedef std::unordered_map<const V3HierBlock*, std::unordered_set<const V3HierBlock*>>
ChildrenMap;
ChildrenMap childrenOfHierBlock;
HierVector sorted;