[FIRRTL] Use type_{cast, isa, dyn_cast} and FIRRTLTypeSwitch #5539
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR mechanically replaces type casts with
firrtl::type*
casts which strips outer most type aliases. Also replace TypeSwitch with FIRRTLTypeSwitch.Unline #5167, this PR just replaces all the casts in FIRRTL dialect with
firrtl::type_*
because it's tedious to use a brain to think about whether or not firrtl::type_cast is necessary. Since type casts introduced by #5417 automatically eliminate unnecessary look up for type aliases at the compile time, there is no runtime regression because of that.