-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C++: Do not use deprecated hasLocationInfo
in FlowTestCommon
#19515
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
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.
Pull Request Overview
Updates test utilities to stop using the deprecated hasLocationInfo
directly on dataflow nodes and instead call it on the node’s location.
- Replaces
otherSource.hasLocationInfo(...)
withotherSource.getLocation().hasLocationInfo(...)
- Applies this change in both the IR and AST flow test modules
@@ -26,7 +26,7 @@ module IRFlowTest<IRDataFlow::GlobalFlowSig Flow> implements TestSig { | |||
n = | |||
strictcount(int line, int column | | |||
Flow::flow(any(IRDataFlow::Node otherSource | | |||
otherSource.hasLocationInfo(_, line, column, _, _) | |||
otherSource.getLocation().hasLocationInfo(_, line, column, _, _) |
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.
[nitpick] Consider extracting the repeated getLocation().hasLocationInfo
pattern into a helper predicate or variable to improve readability and reduce duplication across these test modules.
otherSource.getLocation().hasLocationInfo(_, line, column, _, _) | |
hasLocationInfo(otherSource, line, column) |
Copilot uses AI. Check for mistakes.
@@ -55,7 +55,7 @@ module AstFlowTest<AstDataFlow::GlobalFlowSig Flow> implements TestSig { | |||
n = | |||
strictcount(int line, int column | | |||
Flow::flow(any(AstDataFlow::Node otherSource | | |||
otherSource.hasLocationInfo(_, line, column, _, _) | |||
otherSource.getLocation().hasLocationInfo(_, line, column, _, _) |
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.
[nitpick] This call is identical to the one above in the IR flow tests; you might centralize it in a shared helper to keep both clauses in sync.
Copilot uses AI. Check for mistakes.
hasLocationInfo
on dataflow nodes has been deprecated for over a year.Deprecated in #15853