Swift: Flow through OpenExistentialExpr#14113
Conversation
|
Should we maybe hide |
That sounds reasonable, I'm not fully confident about how to do it though. Can you point me towards a similar change that was made perhaps? |
Here's an example where we decided to hide Here's a PR that hides I hope that helps. Otherwise, feel free to ask for more input! |
|
(note to self: probably not worth fixing the merge conflicts until after #13980 is merged) |
|
Merge fixed. Ready to merge assuming the checks still pass. |
|
... realized I hadn't addressed the suggestion to hide I'm trying to understand the examples you linked a bit better. I can see that an Notably |
Yes, the existence of override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }on |
|
I've just pushed the solution as discussed, along with extended tests...
|
|
Alright, I can see that this may not be as straightforward as I was hoping then. Maybe we should just go back to your original proposed solution. Then we can always go back and do the AST hiding if this comes back to bite us (i.e., if we run into more instances where the Would that be okay with you @geoffw0? I know you spent a lot of time getting my suggestion to work (which I really appreciate), but I don't want to drag this on for too long since I know you've got a lot on your plate already. |
|
I'll do that then, but will keep the new tests in case we decide to come back to this. In principle I agree it would be better hidden, but looking at it now I think if that's possible at all it would require a bit of a reshuffle of the AST, not just hiding one element. |
|
I've reverted the commit with the switch to AST hiding, merged with main, fixed some conflicts (in the tests). |
|
DCA LGTM. There's supposedly a 15.4% analysis speedup, but I don't see how that related to the changes here. Probably just a rather large wobble. |
|
Fixed merge conflicts. |
Add flow through
OpenExistentialExpr. We sometimes identify flow sources at calls whose qualifier has a protocol type, rather than an actual class type. Swift inserts anOpenExistentialExpraround these calls marking the conversion, and we weren't propagating taint through that - leading to a disappointing lack of results from these sources.