Skip to content

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

Merged
merged 1 commit into from
May 19, 2025

Conversation

jketema
Copy link
Contributor

@jketema jketema commented May 19, 2025

hasLocationInfo on dataflow nodes has been deprecated for over a year.

Deprecated in #15853

@github-actions github-actions bot added the C++ label May 19, 2025
@jketema jketema marked this pull request as ready for review May 19, 2025 09:34
@Copilot Copilot AI review requested due to automatic review settings May 19, 2025 09:34
@jketema jketema requested a review from a team as a code owner May 19, 2025 09:34
Copy link
Contributor

@Copilot Copilot AI left a 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(...) with otherSource.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, _, _)
Copy link
Preview

Copilot AI May 19, 2025

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.

Suggested change
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, _, _)
Copy link
Preview

Copilot AI May 19, 2025

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.

@jketema jketema added the no-change-note-required This PR does not need a change note label May 19, 2025
@jketema jketema merged commit 9351702 into github:main May 19, 2025
17 of 18 checks passed
@jketema jketema deleted the depr-rewrite branch May 19, 2025 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants