3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-05 22:06:04 +00:00

Build a temporary SigChunk list in the iterator in the cases where that's needed

This commit is contained in:
Robert O'Callahan 2025-10-30 11:07:02 +00:00
parent 8c9dd3209a
commit 973e8a3928
4 changed files with 55 additions and 25 deletions

View file

@ -277,14 +277,26 @@ inline int ceil_log2(int x)
#endif
}
template <typename T>
auto reversed(T& container) {
struct reverse_view {
reverse_view(T& container) : container(container) {}
auto begin() const { return container.rbegin(); }
auto end() const { return container.rend(); }
T& container;
};
return reverse_view{container};
}
template <typename T>
auto reversed(const T& container) {
struct reverse_view {
const T& cont;
auto begin() const { return cont.rbegin(); }
auto end() const { return cont.rend(); }
};
return reverse_view{container};
struct reverse_view {
reverse_view(const T& container) : container(container) {}
auto begin() const { return container.rbegin(); }
auto end() const { return container.rend(); }
const T& container;
};
return reverse_view{container};
}
YOSYS_NAMESPACE_END