-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Swift: initial interprocedural data flow implementation #9342
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
Swift: initial interprocedural data flow implementation #9342
Conversation
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.
Excellent! A couple of non-blocking comments, but otherwise this LGTM.
swift/ql/lib/codeql/swift/dataflow/internal/DataFlowDispatch.qll
Outdated
Show resolved
Hide resolved
swift/ql/lib/codeql/swift/dataflow/internal/DataFlowDispatch.qll
Outdated
Show resolved
Hide resolved
swift/ql/lib/codeql/swift/dataflow/internal/DataFlowPrivate.qll
Outdated
Show resolved
Hide resolved
bc83757
to
ef31aec
Compare
} | ||
} | ||
|
||
private predicate localFlowSsaInput(Node nodeFrom, Ssa::Definition def, Ssa::Definition next) { |
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.
I think this predicate deserves a comment, probably just the same as for the Ruby version.
Most of this PR is fairly straightforward pairings of input and output nodes, plus the addition of flow steps for Phi nodes. The main subtlety is the way functions are modeled in the call graph - there's now a non-AST control flow node for each function with the parameter declarations and body as children. The reason these aren't
AstControlFlowNode
s is so that nested functions don't appear in the CFG of their containing function and result in duplicated nodes.