[AST] Merge BridgedDiagnosticEngine + BridgedDiagEngine

Introduce a macro that can stamp out wrapper
classes for underlying C++ pointers, and use
it to define BridgedDiagnosticEngine in
ASTBridging. Then, migrate users of
BridgedDiagEngine onto it.
This commit is contained in:
Hamish Knight
2023-10-30 23:49:55 +00:00
parent fe0ad60fe8
commit fce1cb54d5
18 changed files with 82 additions and 58 deletions

View File

@@ -52,16 +52,16 @@ public struct DiagnosticFixIt {
}
public struct DiagnosticEngine {
private let bridged: BridgedDiagEngine
private let bridged: BridgedDiagnosticEngine
public init(bridged: BridgedDiagEngine) {
public init(bridged: BridgedDiagnosticEngine) {
self.bridged = bridged
}
public init?(bridged: BridgedOptionalDiagnosticEngine) {
guard let object = bridged.object else {
public init?(bridged: BridgedNullableDiagnosticEngine) {
guard let raw = bridged.raw else {
return nil
}
self.bridged = BridgedDiagEngine(object: object)
self.bridged = BridgedDiagnosticEngine(raw: raw)
}
public func diagnose(_ position: SourceLoc?,