3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-13 05:01:29 +00:00

Add IdString const &id_string() const to StaticIdString and IdString

The vast majority of ID(...) uses are in a context that is overloaded
for StaticIdString or will cause implicit conversion to an IdString
constant reference. For some sufficently overloaded contexts, implicit
conversion may fail, so it's useful to have a method to force obtaining
a `IdString const &` from an ID(...) use.

When turning all literal IdStrings of the codebase into StaticIdStrings
this was needed in exactly one place, for which this commit adds an
`id_string()` call.
This commit is contained in:
Jannis Harder 2025-09-08 12:59:13 +02:00
parent 6a1d8abf7c
commit ca9d1e5fd8
2 changed files with 4 additions and 1 deletions

View file

@ -77,7 +77,7 @@ struct ExampleDtPass : public Pass
auto enqueue = [&](DriveSpec const &spec) {
int index = queue(spec);
if (index == GetSize(graph_nodes))
graph_nodes.emplace_back(compute_graph.add(ID($pending), index).index());
graph_nodes.emplace_back(compute_graph.add(ID($pending).id_string(), index).index());
//if (index >= GetSize(graph_nodes))
return compute_graph[graph_nodes[index]];
};