Skip to content

Commit b570b60

Browse files
Merge pull request #73848 from cachemeifyoucan/eng/PR-swift-6.0-127530204
[6.0][Caching] Temporarily using llvm style diagnostics in caching
2 parents 925f715 + e91633b commit b570b60

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

include/swift/Basic/SourceManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ class GeneratedSourceInfo {
6161
CharSourceRange generatedSourceRange;
6262

6363
/// The opaque pointer for an ASTNode for which this buffer was generated.
64-
void *astNode;
64+
void *astNode = nullptr;
6565

6666
/// The declaration context in which this buffer logically resides.
67-
DeclContext *declContext;
67+
DeclContext *declContext = nullptr;
6868

6969
/// The custom attribute for an attached macro.
7070
CustomAttr *attachedMacroCustomAttr = nullptr;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,7 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
21422142
Args.hasFlag(OPT_color_diagnostics,
21432143
OPT_no_color_diagnostics,
21442144
/*Default=*/llvm::sys::Process::StandardErrHasColors());
2145-
// If no style options are specified, default to LLVM style.
2145+
// If no style options are specified, default to Swift style.
21462146
Opts.PrintedFormattingStyle = DiagnosticOptions::FormattingStyle::Swift;
21472147
if (const Arg *arg = Args.getLastArg(OPT_diagnostic_style)) {
21482148
StringRef contents = arg->getValue();
@@ -2156,6 +2156,9 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
21562156
return true;
21572157
}
21582158
}
2159+
// Swift style is not fully supported in cached mode yet.
2160+
if (Args.hasArg(OPT_cache_compile_job))
2161+
Opts.PrintedFormattingStyle = DiagnosticOptions::FormattingStyle::LLVM;
21592162

21602163
for (const Arg *arg: Args.filtered(OPT_emit_macro_expansion_files)) {
21612164
StringRef contents = arg->getValue();

0 commit comments

Comments
 (0)