diff --git a/Sources/SwiftCompilerPlugin/CompilerPlugin.swift b/Sources/SwiftCompilerPlugin/CompilerPlugin.swift index 431b8ad2f3b..3ced3a43de1 100644 --- a/Sources/SwiftCompilerPlugin/CompilerPlugin.swift +++ b/Sources/SwiftCompilerPlugin/CompilerPlugin.swift @@ -112,12 +112,6 @@ extension CompilerPlugin { let connection = try StandardIOMessageConnection() let provider = MacroProviderAdapter(plugin: Self()) let impl = CompilerPluginMessageListener(connection: connection, provider: provider) - do { - try impl.main() - } catch { - // Emit a diagnostic and indicate failure to the plugin host, - // and exit with an error code. - fatalError("Internal Error: \(error)") - } + impl.main() } } diff --git a/Sources/SwiftCompilerPluginMessageHandling/CompilerPluginMessageHandler.swift b/Sources/SwiftCompilerPluginMessageHandling/CompilerPluginMessageHandler.swift index 8051af7e549..ca18cb418c8 100644 --- a/Sources/SwiftCompilerPluginMessageHandling/CompilerPluginMessageHandler.swift +++ b/Sources/SwiftCompilerPluginMessageHandling/CompilerPluginMessageHandler.swift @@ -11,8 +11,10 @@ //===----------------------------------------------------------------------===// #if swift(>=6) +private import _SwiftSyntaxCShims public import SwiftSyntaxMacros #else +@_implementationOnly import _SwiftSyntaxCShims import SwiftSyntaxMacros #endif @@ -83,12 +85,20 @@ public class CompilerPluginMessageListener