Skip to content

Commit e64d7cc

Browse files
committed
---
yaml --- r: 323373 b: refs/heads/tensorflow-next c: c60b259 h: refs/heads/master i: 323371: a8eeb80
1 parent 53b36c0 commit e64d7cc

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,4 +1461,4 @@ refs/heads/master-rebranch: 86e95c23aa0d37f24ec138b7853146c1cead2e40
14611461
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14621462
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14631463
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec
1464-
refs/heads/tensorflow-next: 95e6d938e48d8ebdf3c7f676a26f4dd21a37c7f2
1464+
refs/heads/tensorflow-next: c60b25964eec64fa3ccf44ffd2354eb67e72bf15

branches/tensorflow-next/tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
// can be reflected as source-breaking changes for API users. If they are,
2727
// the output of api-digester will include such changes.
2828

29+
#include "swift/Frontend/PrintingDiagnosticConsumer.h"
2930
#include "swift/AST/DiagnosticsModuleDiffer.h"
3031
#include "swift/IDE/APIDigesterData.h"
3132
#include <functional>
@@ -209,6 +210,11 @@ static llvm::cl::opt<std::string>
209210
LocationFilter("location",
210211
llvm::cl::desc("Filter nodes with the given location."),
211212
llvm::cl::cat(Category));
213+
214+
static llvm::cl::opt<bool>
215+
CompilerStyleDiags("compiler-style-diags",
216+
llvm::cl::desc("Print compiler style diagnostics to stderr."),
217+
llvm::cl::cat(Category));
212218
} // namespace options
213219

214220
namespace {
@@ -2114,9 +2120,11 @@ static int diagnoseModuleChange(SDKContext &Ctx, SDKNodeRoot *LeftModule,
21142120
FileOS.reset(new llvm::raw_fd_ostream(OutputPath, EC, llvm::sys::fs::F_None));
21152121
OS = FileOS.get();
21162122
}
2117-
ModuleDifferDiagsConsumer PDC(true, *OS);
2123+
std::unique_ptr<DiagnosticConsumer> pConsumer = options::CompilerStyleDiags ?
2124+
llvm::make_unique<PrintingDiagnosticConsumer>():
2125+
llvm::make_unique<ModuleDifferDiagsConsumer>(true, *OS);
21182126

2119-
Ctx.getDiags().addConsumer(PDC);
2127+
Ctx.getDiags().addConsumer(*pConsumer);
21202128
TypeAliasDiffFinder(LeftModule, RightModule,
21212129
Ctx.getTypeAliasUpdateMap()).search();
21222130
PrunePass Prune(Ctx, std::move(ProtocolReqWhitelist));
@@ -2185,10 +2193,11 @@ static int generateMigrationScript(StringRef LeftPath, StringRef RightPath,
21852193
return 1;
21862194
}
21872195
llvm::errs() << "Diffing: " << LeftPath << " and " << RightPath << "\n";
2188-
2189-
ModuleDifferDiagsConsumer PDC(false);
2196+
std::unique_ptr<DiagnosticConsumer> pConsumer = options::CompilerStyleDiags ?
2197+
llvm::make_unique<PrintingDiagnosticConsumer>():
2198+
llvm::make_unique<ModuleDifferDiagsConsumer>(false);
21902199
SDKContext Ctx(Opts);
2191-
Ctx.getDiags().addConsumer(PDC);
2200+
Ctx.getDiags().addConsumer(*pConsumer);
21922201

21932202
SwiftDeclCollector LeftCollector(Ctx);
21942203
LeftCollector.deSerialize(LeftPath);

0 commit comments

Comments
 (0)