Skip to content

[HW] Make hw::getBitWidth use std::optional vs -1 #9287

@teqdruid

Description

@teqdruid

Convert circt::getBitWidth to return std::optional<uint64_t>. 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.

Metadata

Metadata

Assignees

Labels

HWInvolving the `hw` dialect

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions