Skip to content

Commit

Permalink
Swift: upgrade to 5.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Denisov committed Nov 7, 2023
1 parent a0e73ea commit f35ccd5
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 96 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
| file://:0:0:0:0 | Foo | getModule: | file://:0:0:0:0 | Foo | getNumberOfMembers: | 0 | getInterfaceType: | module<Foo> | getName: | Foo | getNumberOfInheritedTypes: | 0 | isBuiltinModule: | no | isSystemModule: | no | getNumberOfImportedModules: | 4 | getNumberOfExportedModules: | 1 |
| file://:0:0:0:0 | Foo | getModule: | file://:0:0:0:0 | Foo | getNumberOfMembers: | 0 | getInterfaceType: | module<Foo> | getName: | Foo | getNumberOfInheritedTypes: | 0 | isBuiltinModule: | no | isSystemModule: | no | getNumberOfImportedModules: | 5 | getNumberOfExportedModules: | 1 |
| file://:0:0:0:0 | __ObjC | getModule: | file://:0:0:0:0 | __ObjC | getNumberOfMembers: | 0 | getInterfaceType: | module<__ObjC> | getName: | __ObjC | getNumberOfInheritedTypes: | 0 | isBuiltinModule: | no | isSystemModule: | no | getNumberOfImportedModules: | 1 | getNumberOfExportedModules: | 0 |
| file://:0:0:0:0 | default_module_name | getModule: | file://:0:0:0:0 | default_module_name | getNumberOfMembers: | 0 | getInterfaceType: | module<default_module_name> | getName: | default_module_name | getNumberOfInheritedTypes: | 0 | isBuiltinModule: | no | isSystemModule: | no | getNumberOfImportedModules: | 4 | getNumberOfExportedModules: | 0 |
| file://:0:0:0:0 | default_module_name | getModule: | file://:0:0:0:0 | default_module_name | getNumberOfMembers: | 0 | getInterfaceType: | module<default_module_name> | getName: | default_module_name | getNumberOfInheritedTypes: | 0 | isBuiltinModule: | no | isSystemModule: | no | getNumberOfImportedModules: | 5 | getNumberOfExportedModules: | 0 |
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
| file://:0:0:0:0 | Foo | file://:0:0:0:0 | SwiftOnoneSupport |
| file://:0:0:0:0 | Foo | file://:0:0:0:0 | _Concurrency |
| file://:0:0:0:0 | Foo | file://:0:0:0:0 | _StringProcessing |
| file://:0:0:0:0 | Foo | file://:0:0:0:0 | _SwiftConcurrencyShims |
| file://:0:0:0:0 | __ObjC | file://:0:0:0:0 | Swift |
| file://:0:0:0:0 | default_module_name | file://:0:0:0:0 | Swift |
| file://:0:0:0:0 | default_module_name | file://:0:0:0:0 | SwiftOnoneSupport |
| file://:0:0:0:0 | default_module_name | file://:0:0:0:0 | _Concurrency |
| file://:0:0:0:0 | default_module_name | file://:0:0:0:0 | _StringProcessing |
| file://:0:0:0:0 | default_module_name | file://:0:0:0:0 | _SwiftConcurrencyShims |
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
| method_lookups.swift:44:11:44:13 | .foo(_:_:) | method_lookups.swift:12:3:12:35 | foo(_:_:) |
| method_lookups.swift:47:1:47:1 | Task<Success, Never>.init(priority:operation:) | file://:0:0:0:0 | Task<Success, Never>.init(priority:operation:) |
| method_lookups.swift:48:9:48:11 | .foo(_:_:) | method_lookups.swift:22:3:22:35 | foo(_:_:) |
| method_lookups.swift:49:9:49:11 | .bar() | method_lookups.swift:23:3:23:21 | bar() |
| method_lookups.swift:49:9:49:11 | .bar() | method_lookups.swift:23:15:23:33 | bar() |
| method_lookups.swift:50:9:50:9 | Z.init() | method_lookups.swift:26:3:28:3 | Z.init() |
| method_lookups.swift:50:9:50:13 | .baz(_:) | method_lookups.swift:24:3:24:21 | baz(_:) |
| method_lookups.swift:52:11:52:13 | .bar() | method_lookups.swift:23:3:23:21 | bar() |
| method_lookups.swift:52:11:52:13 | .bar() | method_lookups.swift:23:15:23:33 | bar() |
| method_lookups.swift:53:18:53:18 | Z.init() | method_lookups.swift:26:3:28:3 | Z.init() |
| method_lookups.swift:53:23:53:23 | .baz(_:) | method_lookups.swift:24:3:24:21 | baz(_:) |
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
| method_lookups.swift:44:11:44:13 | .foo(_:_:) | (Int, Int) -> () |
| method_lookups.swift:47:1:47:1 | Task<Success, Never>.init(priority:operation:) | (TaskPriority?, __owned @escaping @Sendable () async -> ()) -> Task<(), Never> |
| method_lookups.swift:48:9:48:11 | .foo(_:_:) | @MainActor (Int, Int) -> () |
| method_lookups.swift:49:9:49:11 | .bar() | @MainActor () -> () |
| method_lookups.swift:49:9:49:11 | .bar() | () -> () |
| method_lookups.swift:50:9:50:9 | Z.init() | @MainActor () -> Z |
| method_lookups.swift:50:9:50:13 | .baz(_:) | @MainActor (Int) -> () |
| method_lookups.swift:52:11:52:13 | .bar() | () -> () |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ actor Y {
@MainActor
class Z {
static func foo(_: Int, _:Int) {}
class func bar() {}
nonisolated class func bar() {}
func baz(_: Int) {}

init() {
Expand Down
88 changes: 43 additions & 45 deletions swift/ql/test/library-tests/ast/PrintAst.expected
Original file line number Diff line number Diff line change
Expand Up @@ -3248,51 +3248,49 @@ cfg.swift:
# 524| getParam(0): [ParamDecl] continuation
# 524| Type = AsyncStream<Int>.Continuation
# 523| getBody(): [BraceStmt] { ... }
# 525| getElement(0): [BraceStmt] { ... }
# 525| getElement(0): [CallExpr] call to detached(priority:operation:)
# 525| getFunction(): [MethodLookupExpr] .detached(priority:operation:)
# 525| getBase(): [TypeExpr] Task<(), Never>.Type
# 525| getTypeRepr(): [TypeRepr] Task<(), Never>
# 525| getMethodRef(): [DeclRefExpr] detached(priority:operation:)
# 525| getArgument(0): [Argument] priority: default priority
# 525| getExpr(): [DefaultArgumentExpr] default priority
# 525| getArgument(1): [Argument] operation: { ... }
# 525| getExpr(): [ExplicitClosureExpr] { ... }
# 525| getBody(): [BraceStmt] { ... }
# 526| getElement(0): [ForEachStmt] for ... in ... { ... }
# 526| getPattern(): [NamedPattern] i
#-----| getIteratorVar(): [PatternBindingDecl] var ... = ...
# 526| getInit(0): [CallExpr] call to makeIterator()
# 526| getFunction(): [MethodLookupExpr] .makeIterator()
# 526| getBase(): [BinaryExpr] ... ....(_:_:) ...
# 526| getFunction(): [MethodLookupExpr] ....(_:_:)
# 526| getBase(): [TypeExpr] Int.Type
# 526| getTypeRepr(): [TypeRepr] Int
# 526| getMethodRef(): [DeclRefExpr] ...(_:_:)
# 526| getArgument(0): [Argument] : 1
# 526| getExpr(): [IntegerLiteralExpr] 1
# 526| getArgument(1): [Argument] : 100
# 526| getExpr(): [IntegerLiteralExpr] 100
#-----| getMethodRef(): [DeclRefExpr] makeIterator()
# 526| getPattern(0): [NamedPattern] $i$generator
# 526| getNextCall(): [CallExpr] call to next()
# 526| getFunction(): [MethodLookupExpr] .next()
# 526| getBase(): [DeclRefExpr] $i$generator
# 526| getBase().getFullyConverted(): [InOutExpr] &...
#-----| getMethodRef(): [DeclRefExpr] next()
# 526| getBody(): [BraceStmt] { ... }
# 527| getElement(0): [CallExpr] call to yield(_:)
# 527| getFunction(): [MethodLookupExpr] .yield(_:)
# 527| getBase(): [DeclRefExpr] continuation
# 527| getMethodRef(): [DeclRefExpr] yield(_:)
# 527| getArgument(0): [Argument] : i
# 527| getExpr(): [DeclRefExpr] i
# 529| getElement(1): [CallExpr] call to finish()
# 529| getFunction(): [MethodLookupExpr] .finish()
# 529| getBase(): [DeclRefExpr] continuation
# 529| getMethodRef(): [DeclRefExpr] finish()
# 527| getCapture(0): [CapturedDecl] continuation
# 525| getElement(1): [ReturnStmt] return
# 525| getElement(0): [CallExpr] call to detached(priority:operation:)
# 525| getFunction(): [MethodLookupExpr] .detached(priority:operation:)
# 525| getBase(): [TypeExpr] Task<(), Never>.Type
# 525| getTypeRepr(): [TypeRepr] Task<(), Never>
# 525| getMethodRef(): [DeclRefExpr] detached(priority:operation:)
# 525| getArgument(0): [Argument] priority: default priority
# 525| getExpr(): [DefaultArgumentExpr] default priority
# 525| getArgument(1): [Argument] operation: { ... }
# 525| getExpr(): [ExplicitClosureExpr] { ... }
# 525| getBody(): [BraceStmt] { ... }
# 526| getElement(0): [ForEachStmt] for ... in ... { ... }
# 526| getPattern(): [NamedPattern] i
#-----| getIteratorVar(): [PatternBindingDecl] var ... = ...
# 526| getInit(0): [CallExpr] call to makeIterator()
# 526| getFunction(): [MethodLookupExpr] .makeIterator()
# 526| getBase(): [BinaryExpr] ... ....(_:_:) ...
# 526| getFunction(): [MethodLookupExpr] ....(_:_:)
# 526| getBase(): [TypeExpr] Int.Type
# 526| getTypeRepr(): [TypeRepr] Int
# 526| getMethodRef(): [DeclRefExpr] ...(_:_:)
# 526| getArgument(0): [Argument] : 1
# 526| getExpr(): [IntegerLiteralExpr] 1
# 526| getArgument(1): [Argument] : 100
# 526| getExpr(): [IntegerLiteralExpr] 100
#-----| getMethodRef(): [DeclRefExpr] makeIterator()
# 526| getPattern(0): [NamedPattern] $i$generator
# 526| getNextCall(): [CallExpr] call to next()
# 526| getFunction(): [MethodLookupExpr] .next()
# 526| getBase(): [DeclRefExpr] $i$generator
# 526| getBase().getFullyConverted(): [InOutExpr] &...
#-----| getMethodRef(): [DeclRefExpr] next()
# 526| getBody(): [BraceStmt] { ... }
# 527| getElement(0): [CallExpr] call to yield(_:)
# 527| getFunction(): [MethodLookupExpr] .yield(_:)
# 527| getBase(): [DeclRefExpr] continuation
# 527| getMethodRef(): [DeclRefExpr] yield(_:)
# 527| getArgument(0): [Argument] : i
# 527| getExpr(): [DeclRefExpr] i
# 529| getElement(1): [CallExpr] call to finish()
# 529| getFunction(): [MethodLookupExpr] .finish()
# 529| getBase(): [DeclRefExpr] continuation
# 529| getMethodRef(): [DeclRefExpr] finish()
# 527| getCapture(0): [CapturedDecl] continuation
# 523| getPattern(0): [NamedPattern] stream
# 533| getElement(1): [ForEachStmt] for ... in ... { ... }
# 533| getPattern(): [NamedPattern] i
Expand Down
5 changes: 1 addition & 4 deletions swift/ql/test/library-tests/controlflow/graph/Cfg.expected
Original file line number Diff line number Diff line change
Expand Up @@ -6077,14 +6077,11 @@ cfg.swift:
# 525| Task<(), Never>.Type
#-----| -> default priority

# 525| return
#-----| return -> exit { ... } (normal)

# 525| .detached(priority:operation:)
#-----| -> Task<(), Never>.Type

# 525| call to detached(priority:operation:)
#-----| -> return
#-----| -> exit { ... } (normal)

# 525| default priority
#-----| -> { ... }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ methodlookup.swift:
# 47| getFunction(): [MethodLookupExpr] .instanceMethod()
# 47| getBase(): [DeclRefExpr] baz
# 47| getMethodRef(): [DeclRefExpr] instanceMethod()
# 47| getMethodRef().getFullyConverted(): [FunctionConversionExpr] ((Baz) -> @MainActor () -> ()) ...
# 47| getElement(2).getFullyConverted(): [AwaitExpr] await ...
# 48| getElement(3): [CallExpr] call to { ... }
# 48| getFunction(): [CallExpr] call to Baz.instanceMethod()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ actor Bar {
@MainActor
class Baz {
init() {}
func instanceMethod() {}
nonisolated func instanceMethod() {}
static func staticMethod() {}
class func classMethod() {}
}
Expand Down
14 changes: 5 additions & 9 deletions swift/third_party/load.bzl
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

# TODO: remove `remove-result-of.patch` once we update to a Swift version containing
# https://github.com/apple/swift/commit/2ed2cea2
# (probably when updating to 5.9)
_swift_prebuilt_version = "swift-5.8.1-RELEASE.214"
_swift_prebuilt_version = "swift-5.9.1-RELEASE.255"
_swift_sha_map = {
"Linux-X64": "009594131d2f6327e0033c4b7b0479a5730427575eb59a81a439fe0e343aa777",
"macOS-ARM64": "304a918e3699d404f57e967eff79b982388d8c5330c2135272c9f3a825920a39",
"macOS-X64": "c763c493e5782869b54887dc72df2aad00d59af7272c6d96377f1debb98741f2",
"Linux-X64": "0d5682d8acbe3ab81c2a0b8dc0dfadc0240895e28722cca6467d2ab71a69e004",
"macOS-ARM64": "ee53def6f89f97ce0882375121629d71fd87a673baa194f4c510920720d7bce6",
"macOS-X64": "61c2879ee89d6796f3b58fada8a5890756f5a8c053597f4faca019d660743d70",
}

_swift_arch_map = {
Expand All @@ -29,7 +26,7 @@ _toolchain_info = {
platform = "xcode",
suffix = "osx",
extension = "pkg",
sha = "417d46f73b2e6b5da82ebbc8a5f4979f7187691fd42119157ba56d5a8bc89eda",
sha = "fa4d3a67c4db8d63897e10d52903af40599cc351e8a73d6f5a4eb3cfd07c4605",
),
}

Expand Down Expand Up @@ -131,7 +128,6 @@ def load_dependencies(workspace_name):
patches = [
"@%s//swift/third_party/swift-llvm-support:patches/%s.patch" % (workspace_name, patch_name)
for patch_name in (
"remove-result-of",
"remove-redundant-operators",
"add-constructor-to-Compilation",
)
Expand Down

This file was deleted.

0 comments on commit f35ccd5

Please sign in to comment.