Skip to content

Using LLVM style diagnostics for caching build for now #73575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/swift/Basic/SourceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class GeneratedSourceInfo {
CharSourceRange generatedSourceRange;

/// The opaque pointer for an ASTNode for which this buffer was generated.
void *astNode;
void *astNode = nullptr;

/// The declaration context in which this buffer logically resides.
DeclContext *declContext;
DeclContext *declContext = nullptr;

/// The custom attribute for an attached macro.
CustomAttr *attachedMacroCustomAttr = nullptr;
Expand Down
5 changes: 4 additions & 1 deletion lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down