-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIRRTL] Use preferred cast style, NFC #5401
Conversation
As mentioned in https://mlir.llvm.org/deprecation/, `x.dyn_cast<T>/x.cast<T>/x.isa<T>` are deprecated. This commit replaces each of them wtih `dyn_cast<T>(x)/cast<T>(x)/isa<T>(x)`. This will make it a lot easier to migrate into type alias aware type_cast.
3cae38f
to
9a1731f
Compare
@@ -732,7 +732,7 @@ Attribute Visitor::convertVectorConstant(FVectorType oldType, | |||
newElements.push_back(convertConstant(oldElementType, oldElement)); | |||
} | |||
|
|||
auto bundleType = newElementType.cast<BundleType>(); | |||
auto bundleType = dyn_cast<BundleType>(newElementType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this cast
to dyn_cast
intentional ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It seems mistake 😔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, I hope we can get this in quick. I didn't review in detail, but we'll want this at some point anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, as far as I could scan through the lines.
As mentioned in https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443 and https://mlir.llvm.org/deprecation/,
x.dyn_cast<T>/x.cast<T>/x.isa<T>
are deprecated. This commit replaces cast member functions in FIRRTL dialect withdyn_cast<T>(x)/cast<T>(x)/isa<T>(x)
.This will make it a lot easier to migrate into type alias aware type_cast. We also need to refactor tablegen files as well but it will be done in a follow-up to avoid the conflict with #5399