Skip to content

Commit 7efc73e

Browse files
authored
Merge pull request swiftlang#73325 from gottesmm/pr-ec03a99eea33e15f33d743d35e41aa2e439efa13
[sil-opt] Hard exit(-1) instead of finishDiagProcessing when failing to setup a compiler invocation.
2 parents 428fe21 + 4fb8a20 commit 7efc73e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/DriverTool/sil_opt_main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,11 @@ int sil_opt_main(ArrayRef<const char *> argv, void *MainAddr) {
864864
std::string InstanceSetupError;
865865
if (CI.setup(Invocation, InstanceSetupError)) {
866866
llvm::errs() << InstanceSetupError << '\n';
867-
return finishDiagProcessing(1);
867+
// Rather than finish Diag processing, exit -1 here to show we failed to
868+
// setup here. The reason we do this is if the setup fails, we want to fail
869+
// hard. We shouldn't be testing that we setup correctly with
870+
// -verify/etc. We should be testing that later.
871+
exit(-1);
868872
}
869873

870874
CI.performSema();

0 commit comments

Comments
 (0)