Skip to content

ASTBridging: Bridge more enums directly #82338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3e9923f
ASTBridging: Bridge `swift::AccessorKind` directly
AnthonyLatsis Jun 11, 2025
722bc0f
ASTBridging: Bridge `swift::DiagID` directly
AnthonyLatsis Jun 16, 2025
7de8827
BasicBridging: Turn `BridgedOptional` into a macro
AnthonyLatsis Jun 16, 2025
38360fe
ASTBridging: Bridge `swift::DeclAttrKind` directly
AnthonyLatsis Jun 16, 2025
cf09773
ASTBridging: Bridge `swift::Associativity` directly
AnthonyLatsis Jun 16, 2025
12de029
ASTBridging: Bridge `swift::AccessLevel` directly
AnthonyLatsis Jun 16, 2025
68bb4b3
ASTBridging: Bridge `swift::EffectsKind` directly
AnthonyLatsis Jun 16, 2025
29ef3e3
ASTBridging: Bridge `swift::InheritActorContextModifier` directly
AnthonyLatsis Jun 16, 2025
6527be5
ASTBridging: Bridge `swift::NonIsolatedModifier` directly
AnthonyLatsis Jun 16, 2025
b2b79f3
ASTBridging: Bridge `swift::InlineKind` directly
AnthonyLatsis Jun 16, 2025
0b0ebfc
ASTBridging: Bridge `swift::ExposureKind` directly
AnthonyLatsis Jun 16, 2025
8501c87
ASTBridging: Bridge `swift::ExternKind` directly
AnthonyLatsis Jun 16, 2025
30a8b59
ASTBridging: Bridge `swift::TypeAttrKind` directly
AnthonyLatsis Jun 16, 2025
b347aed
ASTBridging: Encapsulate some operations on `BridgedLayoutConstraint`
AnthonyLatsis Jun 16, 2025
69a27e1
ASTBridging: Bridge `swift::LayoutConstraintKind` directly
AnthonyLatsis Jun 16, 2025
dcbf278
ASTBridging: Bridge `swift::RequirementReprKind` directly
AnthonyLatsis Jun 16, 2025
de46b95
ASTBridging: Bridge `swift::GenericTypeParamKind` directly
AnthonyLatsis Jun 16, 2025
dd78cd6
ASTBridging: Bridge `swift::PlatformKind` directly
AnthonyLatsis Jun 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions SwiftCompilerSources/Sources/AST/DiagnosticEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2022 Apple Inc. and the Swift project authors
// Copyright (c) 2022 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand All @@ -11,10 +11,9 @@
//===----------------------------------------------------------------------===//

import ASTBridging

import Basic

public typealias DiagID = BridgedDiagID
public typealias DiagID = swift.DiagID

public protocol DiagnosticArgument {
func _withBridgedDiagnosticArgument(_ fn: (BridgedDiagnosticArgument) -> Void)
Expand Down Expand Up @@ -130,6 +129,17 @@ public struct DiagnosticEngine {
closure()
}

// FIXME: Remove this overload once https://github.com/swiftlang/swift/issues/82318 is fixed.
public func diagnose(
_ id: DiagID,
arguments args: [DiagnosticArgument],
at position: SourceLoc?,
highlight: CharSourceRange? = nil,
fixIts: [DiagnosticFixIt] = []
) {
diagnose(id, args, at: position, highlight: highlight, fixIts: fixIts)
}

public func diagnose(_ id: DiagID,
_ args: DiagnosticArgument...,
at position: SourceLoc?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private struct DiagnoseDependence {

func diagnose(_ position: SourceLoc?, _ id: DiagID,
_ args: DiagnosticArgument...) {
context.diagnosticEngine.diagnose(id, args, at: position)
context.diagnosticEngine.diagnose(id, arguments: args, at: position)
}

/// Check that this use is inside the dependence scope.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private func insertResultDependencies(for apply: LifetimeDependentApply, _ conte
}

private func diagnoseUnknownDependenceSource(sourceLoc: SourceLoc?, _ context: FunctionPassContext) {
context.diagnosticEngine.diagnose(.lifetime_value_outside_scope, [], at: sourceLoc)
context.diagnosticEngine.diagnose(.lifetime_value_outside_scope, at: sourceLoc)
}

private func insertParameterDependencies(apply: LifetimeDependentApply, target: Operand,
Expand Down
2 changes: 1 addition & 1 deletion SwiftCompilerSources/Sources/SIL/ASTExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand Down
Loading