Skip to content

Commit

Permalink
Merge pull request #73575 from cachemeifyoucan/eng/PR-127530204
Browse files Browse the repository at this point in the history
Using LLVM style diagnostics for caching build for now
  • Loading branch information
cachemeifyoucan authored May 22, 2024
2 parents 65a5216 + 68c755e commit 59232e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit 59232e0

Please sign in to comment.