Skip to content

Guards: Update Guards-CFG integration to recognize MatchSuccessors. - #23182

Draft
aschackmull wants to merge 2 commits into
github:mainfrom
aschackmull:guards/pattern-match
Draft

aschackmull wants to merge 2 commits into
github:mainfrom
aschackmull:guards/pattern-match

Conversation

@aschackmull

@aschackmull aschackmull commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

This PR reimplements the way that switch-case guards work in the shared Guards library. Given the now much more uniform handling of switch statements and patterns in the shared CFG, we can depend on MatchingSuccessors to more precisely indicate matching patterns. When these patterns occur in a switch-case context then we can have them satisfy isEquality, which then provides the relevant implications. Support for expression-less switch statements is also added (they're considered to switch on the implicit constant true).

A legacy hook is kept in order to not drop support for C++ switch-case guards.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant