Skip to content

Conversation

kroening
Copy link
Collaborator

This postpones the conversion of enum base types and enum initializers to enable them to depend on other elaboration-time constants.

@kroening kroening force-pushed the dependent-enum-constants branch from 9c4c997 to 2a10285 Compare February 21, 2024 17:54
@kroening kroening marked this pull request as ready for review February 21, 2024 17:58
// We fall back to the simplifier to approximate
// the standard's definition of 'constant expression'.
return simplify_expr(expr, ns);
auto simplified_expr = simplify_expr(expr, ns);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we've been bitten by this in CBMC (cf. diffblue/cbmc#7856): any use of the simplifier in the front-end needs to make sure that the resulting expression still has a source location.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

This postpones the conversion of enum base types and enum initializers to
enable them to depend on other elaboration-time constants.
@kroening kroening force-pushed the dependent-enum-constants branch from 2a10285 to 1dd80c4 Compare February 21, 2024 18:27
@kroening kroening merged commit 3678a7e into main Feb 21, 2024
@kroening kroening deleted the dependent-enum-constants branch February 21, 2024 18:30
Romy15200 pushed a commit to Romy15200/nws that referenced this pull request Aug 19, 2025
Verilog: enum constants may depend on elaboration-time constants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants