-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rust/Swift: Cache Element.toString
#18968
Conversation
@@ -4,7 +4,7 @@ | |||
|
|||
module Impl { | |||
class Decl extends Generated::Decl { | |||
override string toString() { result = super.toString() } | |||
override string toStringImpl() { result = super.toStringImpl() } |
Check warning
Code scanning / CodeQL
Redundant override Warning
this predicate
5ab442f
to
03a87de
Compare
Element.toString
Element.toString
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 is nice, thanks!
03a87de
to
dcd01be
Compare
Rebased to resolve merge conflict. |
Swift integration tests failure is a timeout flake, merging this now |
Sadly, we cannot put the
cached
annotation directly on the existingtoString
predicate, as that introduces spurious non-monotonicity errors (the non-monotonicity checker considerscached
predicates to be black-boxes). Instead, we add an intermediatetoStringImpl
predicate, which acts like the previoustoString
predicate, and then cache the newtoString
predicate, which simply forwards totoStringImpl
.DCA shows a nice average 7% analysis time speedup.