[Caching] Temporarily using llvm style diagnostics in caching

When caching is enabled, using swift style diagnotics can lead to
crashes due to some uninitialized variables. Even more, the swift style
diagnostics is not going to render the same when replay from the cache
since the currect caching diagnostics processor is not capture all
information that is needed to render diagnostis from SwiftSyntax.
Temprarily using llvm style for caching builds.

rdar://127530204
This commit is contained in:
Steven Wu
2024-05-10 15:44:54 -07:00
parent 5d32c313ca
commit 68c755e99c
2 changed files with 6 additions and 3 deletions

View File

@@ -2172,7 +2172,7 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
Args.hasFlag(OPT_color_diagnostics,
OPT_no_color_diagnostics,
/*Default=*/llvm::sys::Process::StandardErrHasColors());
// If no style options are specified, default to LLVM style.
// If no style options are specified, default to Swift style.
Opts.PrintedFormattingStyle = DiagnosticOptions::FormattingStyle::Swift;
if (const Arg *arg = Args.getLastArg(OPT_diagnostic_style)) {
StringRef contents = arg->getValue();
@@ -2186,6 +2186,9 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
return true;
}
}
// Swift style is not fully supported in cached mode yet.
if (Args.hasArg(OPT_cache_compile_job))
Opts.PrintedFormattingStyle = DiagnosticOptions::FormattingStyle::LLVM;
for (const Arg *arg: Args.filtered(OPT_emit_macro_expansion_files)) {
StringRef contents = arg->getValue();