File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 50
50
#include " llvm/TargetParser/Host.h"
51
51
#include " llvm/TargetParser/Triple.h"
52
52
53
+ #include < csignal>
53
54
#include < memory>
54
55
#include < stdlib.h>
55
56
@@ -460,6 +461,11 @@ int swift::mainEntry(int argc_, const char **argv_) {
460
461
llvm::transform (utf8Args, std::back_inserter (utf8CStrs),
461
462
std::mem_fn (&std::string::c_str));
462
463
argv_ = utf8CStrs.data ();
464
+ #else
465
+ // Set SIGINT to the default handler, ensuring we exit. This needs to be set
466
+ // before PROGRAM_START/INITIALIZE_LLVM since LLVM will set its own signal
467
+ // handler that does some cleanup before delegating to the original handler.
468
+ std::signal (SIGINT, SIG_DFL);
463
469
#endif
464
470
// Expand any response files in the command line argument vector - arguments
465
471
// may be passed through response files in the event of command line length
You can’t perform that action at this time.
0 commit comments