Conversation
2dce37b to
efe205e
Compare
At least in the case of function declarations there can be multiple identical ones within the same module, causing data set check errors if not differentiated.
efe205e to
21937c2
Compare
| if (flags.isIsolated()) { | ||
| ret << "_isolated"; | ||
| } |
There was a problem hiding this comment.
Note that this was duplicating the first if from the loop we're in here.
There was a problem hiding this comment.
Pull request overview
Updates the Swift extractor/QL libraries and bundled resources to support analyzing Swift 6.3, including schema evolution and mangling changes needed to keep identifiers stable/unique under new Swift 6.3 AST behaviors.
Changes:
- Bump bundled Swift toolchains/resources (macOS/Linux) used by the Swift extractor/tests.
- Extend the Swift DB schema/QL type hierarchy (introducing
BuiltinGenericType) and regenerate affected generated QL and test baselines. - Update extractor C++ code (type/stmt translation, mangling) to align with Swift 6.3 API/AST changes and to disambiguate
fileprivatedeclarations.
Show a summary per file
| File | Description |
|---|---|
| swift/third_party/resources/swift-prebuilt-macos.tar.zst | Update bundled macOS Swift prebuilt toolchain (LFS pointer). |
| swift/third_party/resources/swift-prebuilt-linux.tar.zst | Update bundled Linux Swift prebuilt toolchain (LFS pointer). |
| swift/third_party/resources/resource-dir-macos.zip | Update bundled macOS Swift resource directory (LFS pointer). |
| swift/third_party/resources/resource-dir-linux.zip | Update bundled Linux Swift resource directory (LFS pointer). |
| swift/schema.py | Add BuiltinGenericType and make BuiltinFixedArrayType derive from it. |
| swift/ql/test/library-tests/controlflow/graph/Cfg.expected | Regenerate CFG expected output for Swift 6.3 extraction changes. |
| swift/ql/test/library-tests/ast/PrintAst.expected | Regenerate AST printing expected output (iterator-var and location changes). |
| swift/ql/test/extractor-tests/generated/type/IntegerType/IntegerType.expected | Regenerate integer type extraction expected output. |
| swift/ql/test/extractor-tests/generated/stmt/ForEachStmt/ForEachStmt.expected | Regenerate foreach stmt extraction expected output (iterator var locations). |
| swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr.expected | Update object literal type expectations (error type to _). |
| swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl.expected | Regenerate param decl expected output for backing-var bindings. |
| swift/ql/test/extractor-tests/generated/decl/MacroDecl/MacroRole.expected | Update macro role expectations (new attached(extension) role). |
| swift/ql/test/extractor-tests/generated/decl/ConcreteVarDecl/ConcreteVarDecl.expected | Regenerate var decl wrapper-related expected output with locations. |
| swift/ql/test/extractor-tests/generated/decl/CapturedDecl/PrintAst.expected | Update type repr rendering expectation (Optional<Int> → Int?). |
| swift/ql/test/extractor-tests/errors/Errors.expected | Update error-type expectations (use _ in place of <<error type>>). |
| swift/ql/test/extractor-tests/declarations/all.expected | Regenerate declaration list expected output (new binding node emission). |
| swift/ql/lib/upgrades/33e5e5e03bd3f98322f4c67aefa81015be832b88/upgrade.properties | Add Swift 6.3 dbscheme upgrade metadata. |
| swift/ql/lib/upgrades/33e5e5e03bd3f98322f4c67aefa81015be832b88/old.dbscheme | Add prior dbscheme snapshot for Swift 6.3 upgrade step. |
| swift/ql/lib/swift.dbscheme | Evolve dbscheme to include @builtin_generic_type and adjust hierarchy. |
| swift/ql/lib/codeql/swift/generated/type/BuiltinGenericType.qll | New generated QL type wrapper for BuiltinGenericType. |
| swift/ql/lib/codeql/swift/generated/type/BuiltinFixedArrayType.qll | Adjust generated inheritance to go via BuiltinGenericType. |
| swift/ql/lib/codeql/swift/generated/Synth.qll | Update synthesized type unions/conversions for TBuiltinGenericType. |
| swift/ql/lib/codeql/swift/generated/Raw.qll | Update raw wrappers to introduce BuiltinGenericType and rebase fixed arrays. |
| swift/ql/lib/codeql/swift/generated/ParentChild.qll | Regenerate parent/child helpers after raw type hierarchy changes. |
| swift/ql/lib/codeql/swift/elements/type/internal/BuiltinGenericTypeImpl.qll | New internal hand-modifiable wrapper for BuiltinGenericType. |
| swift/ql/lib/codeql/swift/elements/type/BuiltinGenericType.qll | New public QL element type BuiltinGenericType. |
| swift/ql/lib/codeql/swift/elements/type/BuiltinFixedArrayType.qll | Update imports to reflect new base type. |
| swift/ql/lib/codeql/swift/elements.qll | Export new BuiltinGenericType in umbrella module. |
| swift/ql/lib/change-notes/2026-04-06-swift-6.3.md | Add changenote announcing Swift 6.3 support. |
| swift/ql/integration-tests/posix/deduplication/BuiltinTypes.expected | Update deduplication integration-test expected results for builtins. |
| swift/ql/.gitattributes | Mark new generated QL files as linguist-generated. |
| swift/ql/.generated.list | Update generated file manifest/hashes after regeneration. |
| swift/extractor/translators/TypeTranslator.h | Add translation entrypoint for BuiltinFixedArrayType; remove unresolved-type handling. |
| swift/extractor/translators/TypeTranslator.cpp | Implement BuiltinFixedArrayType translation and remove UnresolvedType translation. |
| swift/extractor/translators/StmtTranslator.cpp | Adjust CaseStmt variable extraction for updated Swift API. |
| swift/extractor/mangler/SwiftMangler.h | Extend mangler indexing to include fileprivate values and add fixed-array type mangling hook. |
| swift/extractor/mangler/SwiftMangler.cpp | Implement fileprivate disambiguation indexing, fixed-array mangling, and other Swift 6.3 mangling updates. |
| swift/extractor/infra/SwiftTagTraits.h | Update AST/type tag mappings for Swift 6.3 (BuiltinGenericType, remove UnresolvedType, etc.). |
| swift/downgrades/ee3053b673c901a325b361b18c50b18342752bf8/upgrade.properties | Add Swift 6.3 downgrade/upgrade metadata. |
| swift/downgrades/ee3053b673c901a325b361b18c50b18342752bf8/swift.dbscheme | Add Swift 6.3 downgrade dbscheme snapshot. |
| docs/codeql/reusables/supported-versions-compilers.rst | Update documented supported Swift versions to 5.4–6.3. |
Copilot's findings
- Files reviewed: 31/43 changed files
- Comments generated: 1
| ret << "_isolated"; | ||
| } | ||
| if (isolation.isNonIsolatedCaller()) { | ||
| ret << "_nonisolatednonsending"; |
There was a problem hiding this comment.
Sanity check: Should this cover all the possible cases in the FunctionTypeIsolation enum?
What is missing (looked here: https://github.com/swiftlang/swift/blob/49a7d9cb4da54cd2e7c64b34661caee7718914df/include/swift/AST/ExtInfo.h#L99) is isParameter() and isGlobalActor().
There was a problem hiding this comment.
We've been adding stuff in a pretty ad-hoc manner based on the dataset check errors we were seeing. You might be right, but I have not seen any instances where that actually matters.
Commit-by-commit review recommended.
Most of this is straightforward, although there is quite a bit of getting the mangler into shape again because of new dataset check errors that showed up.
d09e2f6 is probably the most tricky bit. Turns out there is a second place where we need indexing, besides extensions. A module can have
fileprivatemembers. As a module may consist of multiple files, we might actually end up in a situation where there are multiple functions with the same name and signature in the same module; just defined in different source files. This happens fordurationComponents(for:clock:)in Swift 6.3:To get the indexing I've extended the code that was already there for extensions.