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