2626using namespace swift ;
2727
2828#if SWIFT_BUILD_SWIFT_SYNTAX
29- static BridgedDiagnosticSeverity bridgeDiagnosticSeverity (DiagnosticKind kind) {
30- switch (kind) {
31- case DiagnosticKind::Error:
32- return BridgedDiagnosticSeverity::BridgedError;
33-
34- case DiagnosticKind::Warning:
35- return BridgedDiagnosticSeverity::BridgedWarning;
36-
37- case DiagnosticKind::Remark:
38- return BridgedDiagnosticSeverity::BridgedRemark;
39-
40- case DiagnosticKind::Note:
41- return BridgedDiagnosticSeverity::BridgedNote;
42- }
43- }
4429
4530// / Enqueue a diagnostic with ASTGen's diagnostic rendering.
4631static void addQueueDiagnostic (void *queuedDiagnostics,
@@ -53,8 +38,6 @@ static void addQueueDiagnostic(void *queuedDiagnostics,
5338 info.FormatArgs );
5439 }
5540
56- BridgedDiagnosticSeverity severity = bridgeDiagnosticSeverity (info.Kind );
57-
5841 // Map the highlight ranges.
5942 SmallVector<BridgedCharSourceRange, 2 > highlightRanges;
6043 for (const auto &range : info.Ranges ) {
@@ -72,7 +55,7 @@ static void addQueueDiagnostic(void *queuedDiagnostics,
7255 swift_ASTGen_addQueuedDiagnostic (
7356 queuedDiagnostics, perFrontendState,
7457 text.str (),
75- severity , info.Loc ,
58+ info. Kind , info.Loc ,
7659 info.Category ,
7760 documentationPath,
7861 highlightRanges.data (), highlightRanges.size (),
@@ -102,11 +85,9 @@ void DiagnosticBridge::emitDiagnosticWithoutLocation(
10285 info.FormatArgs );
10386 }
10487
105- BridgedDiagnosticSeverity severity = bridgeDiagnosticSeverity (info.Kind );
106-
10788 BridgedStringRef bridgedRenderedString{nullptr , 0 };
10889 swift_ASTGen_renderSingleDiagnostic (
109- perFrontendState, text.str (), severity , info.Category ,
90+ perFrontendState, text.str (), info. Kind , info.Category ,
11091 llvm::StringRef (info.CategoryDocumentationURL ), forceColors ? 1 : 0 ,
11192 &bridgedRenderedString);
11293
0 commit comments