Skip to content

Commit 0be3c50

Browse files
committed
ABI/API checker: use colors when emitting diagnostics in module loading
1 parent 2efb5b2 commit 0be3c50

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
@@ -2074,7 +2074,9 @@ swift::ide::api::getSDKNodeRoot(SDKContext &SDKCtx,
20742074

20752075
CompilerInstance &CI = SDKCtx.newCompilerInstance();
20762076
// Display diagnostics to stderr.
2077-
PrintingDiagnosticConsumer PrintDiags;
2077+
PrintingDiagnosticConsumer PrintDiags(llvm::errs());
2078+
if (llvm::errs().has_colors())
2079+
PrintDiags.forceColors();
20782080
CI.addDiagnosticConsumer(&PrintDiags);
20792081
if (CI.setup(Invocation)) {
20802082
llvm::errs() << "Failed to setup the compiler instance\n";

0 commit comments

Comments
 (0)