Repository navigation
[NFC] Rename Type::is{,Non}NullableRef #9286
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -551,7 +551,7 @@ struct DAE : public Pass { | |||||||||||
| // Do this for more complicated uninhabitable types such as non-nullable | ||||||||||||
| // references to structs with non-nullable reference cycles. | ||||||||||||
| bool wasReturnUninhabitable = | ||||||||||||
| func->getResults().isNull() && func->getResults().isNonNullable(); | ||||||||||||
| func->getResults().isNull() && func->getResults().isNonNullableRef(); | ||||||||||||
|
Comment on lines
553
to
+554
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a logical contradiction in this check.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not correct, but also points to a good renaming we could do. I'll also rename "isNull" to "isBottomRef". |
||||||||||||
| func->setResults(Type::none); | ||||||||||||
| // Remove the drops on the calls. Note that we must do this before updating | ||||||||||||
| // returns in ReturnUpdater, as there may be recursive calls of this | ||||||||||||
|
|
||||||||||||
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.
This looks equivalent to
!isRef || !isNullablewhile the original code is!isRef || isNonNullable. Is!isNullablethe same asisNonNullable? I guess this is only in the case whenisRefso yes?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.
Yeah, I think this should be good.
Non-refs: take the branch before and after.
nullable refs: do not take the branch before and after.
non-nullable refs: take the branch before and after.