◐ Shell
clean mode source ↗

Swift: Filter more clang options not recognized by off-the-shelf clang by jketema · Pull Request #21992 · github/codeql

@jketema

DCA mostly shows wobble. The changes in the case of SideStore look like genuine improvements. I'm not concerned about the workflow failures, but I can re-run the DCA experiment if needed.

@jketema jketema marked this pull request as ready for review

June 16, 2026 15:39

Copilot AI review requested due to automatic review settings

June 16, 2026 15:39

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines Swift extraction/integration test behavior by filtering additional Apple/Xcode-specific Clang options that upstream (“off-the-shelf”) Clang may not recognize, and by excluding a synthetic file entry from an Xcode hello-world integration test.

Changes:

  • Extend the Swift tracing config to strip two additional -Xcc-prefixed Clang flags: -fobjc-msgsend-selector-stubs and -fstack-check.
  • Update the hello-xcode integration test query to exclude files whose base name is "<module-includes>".
Show a summary per file
File Description
swift/tools/tracing-config.lua Strips additional unsupported -Xcc Clang flags to reduce extractor/compiler invocation failures with non-Apple Clang.
swift/ql/integration-tests/osx/hello-xcode/Files.ql Filters out the "<module-includes>" synthetic file entry from the integration test results.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

geoffw0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise changes and DCA LGTM. 👍

where exists(f.getRelativePath()) or f instanceof UnknownFile
where
(exists(f.getRelativePath()) or f instanceof UnknownFile) and
not f.getBaseName() = "<module-includes>"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now start to extract additional files, some of which are called <module-includes> (these seem to be internal to the compiler). To keep the test results consistent across the three Xcode versions we run this test with, I'm filtering this out (only shows up with Xcode 26; not the earlier versions).