[HW] Make `hw::getBitWidth` use std::optional vs -1
Open
Nobody has claimed this yet.
HW
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 524
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 46
Description
Convert `circt::getBitWidth` to return `std::optional`. Also convert the `BitWidthTypeInterface` `getBitWidth` method to return the same instead of a signed version. Update the callsites. Where the callsites do not check for it, add an assertion. In cases where a bitwidth was inappropriately assumed (e.g. canonicalizers) but wasn't checked or asserted, update the code to bail out appropriately without making changes.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.