mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
Swift: upgrade to 5.9.1
This commit is contained in:
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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(_:) |
|
||||
|
||||
@@ -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() | () -> () |
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
#-----| -> { ... }
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -14,7 +14,7 @@ actor Bar {
|
||||
@MainActor
|
||||
class Baz {
|
||||
init() {}
|
||||
func instanceMethod() {}
|
||||
nonisolated func instanceMethod() {}
|
||||
static func staticMethod() {}
|
||||
class func classMethod() {}
|
||||
}
|
||||
|
||||
16
swift/third_party/load.bzl
vendored
16
swift/third_party/load.bzl
vendored
@@ -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 = {
|
||||
@@ -23,13 +20,13 @@ _toolchain_info = {
|
||||
platform = "ubuntu2004",
|
||||
suffix = "ubuntu20.04",
|
||||
extension = "tar.gz",
|
||||
sha = "dd4b04c7f95c4ada4a2aacb66864b1ed20358313aaa4c880dc3974bf1eefa275",
|
||||
sha = "057f6c0c3c6472b733e4d5bd8f10e83dd8536c1db1d0ec4a1dca414cd023ab0d",
|
||||
),
|
||||
"macos": struct(
|
||||
platform = "xcode",
|
||||
suffix = "osx",
|
||||
extension = "pkg",
|
||||
sha = "417d46f73b2e6b5da82ebbc8a5f4979f7187691fd42119157ba56d5a8bc89eda",
|
||||
sha = "fa4d3a67c4db8d63897e10d52903af40599cc351e8a73d6f5a4eb3cfd07c4605",
|
||||
),
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
)
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
`std::result_of` was removed in C++20, but is still used in the Swift headers. We can't
|
||||
remove it from there before prebuilding, as that is still done with C++14, but we can
|
||||
replace it with `std::invoke_result` for compiling the extractor.
|
||||
|
||||
diff --git a/include/swift/Basic/RelativePointer.h b/include/swift/Basic/RelativePointer.h
|
||||
index 73f91262afa..bdaa304c804 100644
|
||||
--- a/include/swift/Basic/RelativePointer.h
|
||||
+++ b/include/swift/Basic/RelativePointer.h
|
||||
@@ -551,7 +551,7 @@ public:
|
||||
}
|
||||
|
||||
template <typename... ArgTy>
|
||||
- typename std::result_of<T *(ArgTy...)>::type operator()(ArgTy... arg) const {
|
||||
+ typename std::invoke_result<T*, ArgTy...>::type operator()(ArgTy... arg) const {
|
||||
#if SWIFT_PTRAUTH
|
||||
void *ptr = this->super::getWithoutCast();
|
||||
return reinterpret_cast<T *>(ptrauth_sign_unauthenticated(
|
||||
diff --git a/include/swift/Basic/STLExtras.h b/include/swift/Basic/STLExtras.h
|
||||
index 7fa3d0c8890..6bc891a9b63 100644
|
||||
--- a/include/swift/Basic/STLExtras.h
|
||||
+++ b/include/swift/Basic/STLExtras.h
|
||||
@@ -405,7 +405,7 @@ class OptionalTransformIterator {
|
||||
typename std::iterator_traits<Iterator>::reference;
|
||||
|
||||
using ResultReference =
|
||||
- typename std::result_of<OptionalTransform(UnderlyingReference)>::type;
|
||||
+ typename std::invoke_result<OptionalTransform, UnderlyingReference>::type;
|
||||
|
||||
public:
|
||||
/// Used to indicate when the current iterator has already been
|
||||
Reference in New Issue
Block a user