Skip to content

Commit 0517e97

Browse files
committed
ABI/API checker: use colors when emitting diagnostics in module loading
1 parent d4bfae8 commit 0517e97

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/swift-api-digester/ModuleAnalyzerNodes.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2079,7 +2079,9 @@ swift::ide::api::getSDKNodeRoot(SDKContext &SDKCtx,
20792079

20802080
CompilerInstance &CI = SDKCtx.newCompilerInstance();
20812081
// Display diagnostics to stderr.
2082-
PrintingDiagnosticConsumer PrintDiags;
2082+
PrintingDiagnosticConsumer PrintDiags(llvm::errs());
2083+
if (llvm::errs().has_colors())
2084+
PrintDiags.forceColors();
20832085
CI.addDiagnosticConsumer(&PrintDiags);
20842086
if (CI.setup(Invocation)) {
20852087
llvm::errs() << "Failed to setup the compiler instance\n";

0 commit comments

Comments
 (0)