@@ -2107,13 +2107,13 @@ static void findTypeMemberDiffs(NodePtr leftSDKRoot, NodePtr rightSDKRoot,
2107
2107
}
2108
2108
2109
2109
static std::unique_ptr<DiagnosticConsumer>
2110
- createDiagConsumer (llvm::raw_ostream &OS, bool &FailOnError,
2110
+ createDiagConsumer (llvm::raw_ostream &OS, bool &FailOnError, bool DisableFailOnError,
2111
2111
bool CompilerStyleDiags, StringRef SerializedDiagPath) {
2112
2112
if (!SerializedDiagPath.empty ()) {
2113
- FailOnError = true ;
2113
+ FailOnError = !DisableFailOnError ;
2114
2114
return serialized_diagnostics::createConsumer (SerializedDiagPath);
2115
2115
} else if (CompilerStyleDiags) {
2116
- FailOnError = true ;
2116
+ FailOnError = !DisableFailOnError ;
2117
2117
return std::make_unique<PrintingDiagnosticConsumer>();
2118
2118
} else {
2119
2119
FailOnError = false ;
@@ -2168,6 +2168,7 @@ static bool readBreakageAllowlist(SDKContext &Ctx, llvm::StringSet<> &lines,
2168
2168
static int diagnoseModuleChange (SDKContext &Ctx, SDKNodeRoot *LeftModule,
2169
2169
SDKNodeRoot *RightModule, StringRef OutputPath,
2170
2170
llvm::StringSet<> ProtocolReqAllowlist,
2171
+ bool DisableFailOnError,
2171
2172
bool CompilerStyleDiags,
2172
2173
StringRef SerializedDiagPath,
2173
2174
StringRef BreakageAllowlistPath,
@@ -2192,7 +2193,7 @@ static int diagnoseModuleChange(SDKContext &Ctx, SDKNodeRoot *LeftModule,
2192
2193
BreakageAllowlistPath);
2193
2194
}
2194
2195
auto pConsumer = std::make_unique<FilteringDiagnosticConsumer>(
2195
- createDiagConsumer (*OS, FailOnError, CompilerStyleDiags,
2196
+ createDiagConsumer (*OS, FailOnError, DisableFailOnError, CompilerStyleDiags,
2196
2197
SerializedDiagPath),
2197
2198
std::move (allowedBreakages));
2198
2199
SWIFT_DEFER { pConsumer->finishProcessing (); };
@@ -2214,6 +2215,7 @@ static int diagnoseModuleChange(SDKContext &Ctx, SDKNodeRoot *LeftModule,
2214
2215
static int diagnoseModuleChange (StringRef LeftPath, StringRef RightPath,
2215
2216
StringRef OutputPath, CheckerOptions Opts,
2216
2217
llvm::StringSet<> ProtocolReqAllowlist,
2218
+ bool DisableFailOnError,
2217
2219
bool CompilerStyleDiags,
2218
2220
StringRef SerializedDiagPath,
2219
2221
StringRef BreakageAllowlistPath,
@@ -2233,7 +2235,7 @@ static int diagnoseModuleChange(StringRef LeftPath, StringRef RightPath,
2233
2235
RightCollector.deSerialize (RightPath);
2234
2236
return diagnoseModuleChange (
2235
2237
Ctx, LeftCollector.getSDKRoot (), RightCollector.getSDKRoot (), OutputPath,
2236
- std::move (ProtocolReqAllowlist), CompilerStyleDiags, SerializedDiagPath,
2238
+ std::move (ProtocolReqAllowlist), DisableFailOnError, CompilerStyleDiags, SerializedDiagPath,
2237
2239
BreakageAllowlistPath, DebugMapping);
2238
2240
}
2239
2241
@@ -2517,6 +2519,7 @@ class SwiftAPIDigesterInvocation {
2517
2519
std::vector<std::string> PreferInterfaceForModules;
2518
2520
std::string ResourceDir;
2519
2521
std::string ModuleCachePath;
2522
+ bool DisableFailOnError;
2520
2523
2521
2524
public:
2522
2525
SwiftAPIDigesterInvocation (const std::string &ExecPath)
@@ -2618,6 +2621,7 @@ class SwiftAPIDigesterInvocation {
2618
2621
ResourceDir = ParsedArgs.getLastArgValue (OPT_resource_dir).str ();
2619
2622
ModuleCachePath = ParsedArgs.getLastArgValue (OPT_module_cache_path).str ();
2620
2623
DebugMapping = ParsedArgs.hasArg (OPT_debug_mapping);
2624
+ DisableFailOnError = ParsedArgs.hasArg (OPT_disable_fail_on_error);
2621
2625
2622
2626
CheckerOpts.AvoidLocation = ParsedArgs.hasArg (OPT_avoid_location);
2623
2627
CheckerOpts.AvoidToolArgs = ParsedArgs.hasArg (OPT_avoid_tool_args);
@@ -2820,21 +2824,21 @@ class SwiftAPIDigesterInvocation {
2820
2824
case ComparisonInputMode::BothJson: {
2821
2825
return diagnoseModuleChange (
2822
2826
SDKJsonPaths[0 ], SDKJsonPaths[1 ], OutputFile, CheckerOpts,
2823
- std::move (protocolAllowlist), CompilerStyleDiags,
2827
+ std::move (protocolAllowlist), DisableFailOnError, CompilerStyleDiags,
2824
2828
SerializedDiagPath, BreakageAllowlistPath, DebugMapping);
2825
2829
}
2826
2830
case ComparisonInputMode::BaselineJson: {
2827
2831
SDKContext Ctx (CheckerOpts);
2828
2832
return diagnoseModuleChange (
2829
2833
Ctx, getBaselineFromJson (Ctx), getSDKRoot (Ctx, false ), OutputFile,
2830
- std::move (protocolAllowlist), CompilerStyleDiags,
2834
+ std::move (protocolAllowlist), DisableFailOnError, CompilerStyleDiags,
2831
2835
SerializedDiagPath, BreakageAllowlistPath, DebugMapping);
2832
2836
}
2833
2837
case ComparisonInputMode::BothLoad: {
2834
2838
SDKContext Ctx (CheckerOpts);
2835
2839
return diagnoseModuleChange (
2836
2840
Ctx, getSDKRoot (Ctx, true ), getSDKRoot (Ctx, false ), OutputFile,
2837
- std::move (protocolAllowlist), CompilerStyleDiags,
2841
+ std::move (protocolAllowlist), DisableFailOnError, CompilerStyleDiags,
2838
2842
SerializedDiagPath, BreakageAllowlistPath, DebugMapping);
2839
2843
}
2840
2844
}
0 commit comments