newcelltypes: use unordered_map

This commit is contained in:
Emil J. Tywoniak 2025-11-27 02:53:29 +01:00
parent 43ca5254b8
commit 105c591bbe
1 changed files with 6 additions and 1 deletions

View File

@ -548,8 +548,13 @@ struct NewCellType {
};
struct NewCellTypes {
struct IdStringHash {
std::size_t operator()(const IdString id) const {
return static_cast<size_t>(id.hash_top().yield());
}
};
StaticCellTypes::Categories::Category static_cell_types = StaticCellTypes::categories.empty;
dict<RTLIL::IdString, NewCellType> custom_cell_types = {};
std::unordered_map<RTLIL::IdString, NewCellType, IdStringHash> custom_cell_types {};
NewCellTypes() {
static_cell_types = StaticCellTypes::categories.empty;