Skip to content

Commit 1ceeb70

Browse files
Merge pull request #82338 from AnthonyLatsis/jepa
ASTBridging: Bridge more enums directly
2 parents 58cd10c + dd78cd6 commit 1ceeb70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+953
-1132
lines changed

SwiftCompilerSources/Sources/AST/DiagnosticEngine.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2022 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -11,10 +11,9 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import ASTBridging
14-
1514
import Basic
1615

17-
public typealias DiagID = BridgedDiagID
16+
public typealias DiagID = swift.DiagID
1817

1918
public protocol DiagnosticArgument {
2019
func _withBridgedDiagnosticArgument(_ fn: (BridgedDiagnosticArgument) -> Void)
@@ -130,6 +129,17 @@ public struct DiagnosticEngine {
130129
closure()
131130
}
132131

132+
// FIXME: Remove this overload once https://github.com/swiftlang/swift/issues/82318 is fixed.
133+
public func diagnose(
134+
_ id: DiagID,
135+
arguments args: [DiagnosticArgument],
136+
at position: SourceLoc?,
137+
highlight: CharSourceRange? = nil,
138+
fixIts: [DiagnosticFixIt] = []
139+
) {
140+
diagnose(id, args, at: position, highlight: highlight, fixIts: fixIts)
141+
}
142+
133143
public func diagnose(_ id: DiagID,
134144
_ args: DiagnosticArgument...,
135145
at position: SourceLoc?,

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private struct DiagnoseDependence {
139139

140140
func diagnose(_ position: SourceLoc?, _ id: DiagID,
141141
_ args: DiagnosticArgument...) {
142-
context.diagnosticEngine.diagnose(id, args, at: position)
142+
context.diagnosticEngine.diagnose(id, arguments: args, at: position)
143143
}
144144

145145
/// Check that this use is inside the dependence scope.

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceInsertion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ private func insertResultDependencies(for apply: LifetimeDependentApply, _ conte
263263
}
264264

265265
private func diagnoseUnknownDependenceSource(sourceLoc: SourceLoc?, _ context: FunctionPassContext) {
266-
context.diagnosticEngine.diagnose(.lifetime_value_outside_scope, [], at: sourceLoc)
266+
context.diagnosticEngine.diagnose(.lifetime_value_outside_scope, at: sourceLoc)
267267
}
268268

269269
private func insertParameterDependencies(apply: LifetimeDependentApply, target: Operand,

SwiftCompilerSources/Sources/SIL/ASTExtensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information

0 commit comments

Comments
 (0)