Skip to content

Commit

Permalink
Remove hack for maps with incomplete types now that there is a common…
Browse files Browse the repository at this point in the history
… path to using the boost containers
  • Loading branch information
MikePopoloski committed Jul 7, 2023
1 parent a82127a commit 93816ec
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions include/slang/ast/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ struct SLANG_EXPORT AssertionInstanceDetails {
SourceLocation instanceLoc;

/// A map of formal argument symbols to their actual replacements.
map_with_incomplete_type<const Symbol*,
std::tuple<const syntax::PropertyExprSyntax*, ASTContext>>
flat_hash_map<const Symbol*, std::tuple<const syntax::PropertyExprSyntax*, ASTContext>>
argumentMap;

/// A map of local variables declared in the assertion item.
Expand Down
2 changes: 1 addition & 1 deletion include/slang/ast/Compilation.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ struct HierarchyOverrideNode {
overrides;

/// A map of child scopes that also contain overrides.
map_with_incomplete_type<InstancePath::Entry, HierarchyOverrideNode> childNodes;
flat_hash_map<InstancePath::Entry, HierarchyOverrideNode> childNodes;

/// A list of bind directives to apply in this scope.
std::vector<const syntax::BindDirectiveSyntax*> binds;
Expand Down
4 changes: 0 additions & 4 deletions include/slang/util/Hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,6 @@ template<typename T, typename H = hash<T>, typename E = std::equal_to<T>,
typename A = std::allocator<T>>
using flat_node_set = boost::unordered_node_set<T, H, E, A>;

template<typename K, typename V, typename H = hash<K>, typename E = std::equal_to<K>,
typename A = std::allocator<std::pair<const K, V>>>
using map_with_incomplete_type = boost::unordered_flat_map<K, V, H, E, A>;

/// A hash map container that allocates room for its first `N` elements on the stack.
/// Prefer this over a normal hash map for temporary stack variables and small maps
/// where heap allocations can be avoided.
Expand Down

0 comments on commit 93816ec

Please sign in to comment.