Loading lldb/tools/driver/Driver.cpp +0 −10 Original line number Diff line number Diff line Loading @@ -853,16 +853,6 @@ int main(int argc, char const *argv[]) signal(SIGCONT, sigcont_handler); #endif // Occasionally, during test teardown, LLDB writes to a closed pipe. // Sometimes the communication is inherently unreliable, so LLDB tries to // avoid being killed due to SIGPIPE. However, LLVM's default SIGPIPE behavior // is to exit with IO_ERR. Opt LLDB out of that. // // We don't disable LLVM's signal handling entirely because we still want // pretty stack traces, and file cleanup (for when, say, the clang embedded // in LLDB leaves behind temporary objects). llvm::sys::SetPipeSignalFunction(nullptr); int exit_code = 0; // Create a scope for driver so that the driver object will destroy itself // before SBDebugger::Terminate() is called. Loading llvm/include/llvm/Support/Signals.h +0 −11 Original line number Diff line number Diff line Loading @@ -84,17 +84,6 @@ namespace sys { /// function. Note also that the handler may be executed on a different /// thread on some platforms. void SetInfoSignalFunction(void (*Handler)()); /// Registers a function to be called when a "pipe" signal is delivered to /// the process. /// /// The "pipe" signal typically indicates a failed write to a pipe (SIGPIPE). /// The default installed handler calls `exit(EX_IOERR)`, causing the process /// to immediately exit with an IO error exit code. /// /// This function is only applicable on POSIX systems. void SetPipeSignalFunction(void (*Handler)()); } // End sys namespace } // End llvm namespace Loading llvm/lib/Support/Unix/Signals.inc +1 −13 Original line number Diff line number Diff line Loading @@ -82,18 +82,12 @@ using namespace llvm; static RETSIGTYPE SignalHandler(int Sig); // defined below. static RETSIGTYPE InfoSignalHandler(int Sig); // defined below. static void DefaultPipeSignalFunction() { exit(EX_IOERR); } using SignalHandlerFunctionType = void (*)(); /// The function to call if ctrl-c is pressed. static std::atomic<SignalHandlerFunctionType> InterruptFunction = ATOMIC_VAR_INIT(nullptr); static std::atomic<SignalHandlerFunctionType> InfoSignalFunction = ATOMIC_VAR_INIT(nullptr); static std::atomic<SignalHandlerFunctionType> PipeSignalFunction = ATOMIC_VAR_INIT(DefaultPipeSignalFunction); namespace { /// Signal-safe removal of files. Loading Loading @@ -369,8 +363,7 @@ static RETSIGTYPE SignalHandler(int Sig) { // Send a special return code that drivers can check for, from sysexits.h. if (Sig == SIGPIPE) if (SignalHandlerFunctionType CurrentPipeFunction = PipeSignalFunction) CurrentPipeFunction(); exit(EX_IOERR); raise(Sig); // Execute the default handler. return; Loading Loading @@ -410,11 +403,6 @@ void llvm::sys::SetInfoSignalFunction(void (*Handler)()) { RegisterHandlers(); } void llvm::sys::SetPipeSignalFunction(void (*Handler)()) { PipeSignalFunction.exchange(Handler); RegisterHandlers(); } // The public API bool llvm::sys::RemoveFileOnSignal(StringRef Filename, std::string* ErrMsg) { Loading llvm/lib/Support/Windows/Signals.inc +0 −3 Original line number Diff line number Diff line Loading @@ -560,9 +560,6 @@ void llvm::sys::SetInfoSignalFunction(void (*Handler)()) { // Unimplemented. } void llvm::sys::SetPipeSignalFunction(void (*Handler)()) { // Unimplemented. } /// Add a function to be called when a signal is delivered to the process. The /// handler can have a cookie passed to it to identify what instance of the Loading llvm/unittests/Support/CMakeLists.txt +0 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ add_llvm_unittest(SupportTests ReverseIterationTest.cpp ReplaceFileTest.cpp ScaledNumberTest.cpp SignalsTest.cpp SourceMgrTest.cpp SpecialCaseListTest.cpp StringPool.cpp Loading Loading
lldb/tools/driver/Driver.cpp +0 −10 Original line number Diff line number Diff line Loading @@ -853,16 +853,6 @@ int main(int argc, char const *argv[]) signal(SIGCONT, sigcont_handler); #endif // Occasionally, during test teardown, LLDB writes to a closed pipe. // Sometimes the communication is inherently unreliable, so LLDB tries to // avoid being killed due to SIGPIPE. However, LLVM's default SIGPIPE behavior // is to exit with IO_ERR. Opt LLDB out of that. // // We don't disable LLVM's signal handling entirely because we still want // pretty stack traces, and file cleanup (for when, say, the clang embedded // in LLDB leaves behind temporary objects). llvm::sys::SetPipeSignalFunction(nullptr); int exit_code = 0; // Create a scope for driver so that the driver object will destroy itself // before SBDebugger::Terminate() is called. Loading
llvm/include/llvm/Support/Signals.h +0 −11 Original line number Diff line number Diff line Loading @@ -84,17 +84,6 @@ namespace sys { /// function. Note also that the handler may be executed on a different /// thread on some platforms. void SetInfoSignalFunction(void (*Handler)()); /// Registers a function to be called when a "pipe" signal is delivered to /// the process. /// /// The "pipe" signal typically indicates a failed write to a pipe (SIGPIPE). /// The default installed handler calls `exit(EX_IOERR)`, causing the process /// to immediately exit with an IO error exit code. /// /// This function is only applicable on POSIX systems. void SetPipeSignalFunction(void (*Handler)()); } // End sys namespace } // End llvm namespace Loading
llvm/lib/Support/Unix/Signals.inc +1 −13 Original line number Diff line number Diff line Loading @@ -82,18 +82,12 @@ using namespace llvm; static RETSIGTYPE SignalHandler(int Sig); // defined below. static RETSIGTYPE InfoSignalHandler(int Sig); // defined below. static void DefaultPipeSignalFunction() { exit(EX_IOERR); } using SignalHandlerFunctionType = void (*)(); /// The function to call if ctrl-c is pressed. static std::atomic<SignalHandlerFunctionType> InterruptFunction = ATOMIC_VAR_INIT(nullptr); static std::atomic<SignalHandlerFunctionType> InfoSignalFunction = ATOMIC_VAR_INIT(nullptr); static std::atomic<SignalHandlerFunctionType> PipeSignalFunction = ATOMIC_VAR_INIT(DefaultPipeSignalFunction); namespace { /// Signal-safe removal of files. Loading Loading @@ -369,8 +363,7 @@ static RETSIGTYPE SignalHandler(int Sig) { // Send a special return code that drivers can check for, from sysexits.h. if (Sig == SIGPIPE) if (SignalHandlerFunctionType CurrentPipeFunction = PipeSignalFunction) CurrentPipeFunction(); exit(EX_IOERR); raise(Sig); // Execute the default handler. return; Loading Loading @@ -410,11 +403,6 @@ void llvm::sys::SetInfoSignalFunction(void (*Handler)()) { RegisterHandlers(); } void llvm::sys::SetPipeSignalFunction(void (*Handler)()) { PipeSignalFunction.exchange(Handler); RegisterHandlers(); } // The public API bool llvm::sys::RemoveFileOnSignal(StringRef Filename, std::string* ErrMsg) { Loading
llvm/lib/Support/Windows/Signals.inc +0 −3 Original line number Diff line number Diff line Loading @@ -560,9 +560,6 @@ void llvm::sys::SetInfoSignalFunction(void (*Handler)()) { // Unimplemented. } void llvm::sys::SetPipeSignalFunction(void (*Handler)()) { // Unimplemented. } /// Add a function to be called when a signal is delivered to the process. The /// handler can have a cookie passed to it to identify what instance of the Loading
llvm/unittests/Support/CMakeLists.txt +0 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ add_llvm_unittest(SupportTests ReverseIterationTest.cpp ReplaceFileTest.cpp ScaledNumberTest.cpp SignalsTest.cpp SourceMgrTest.cpp SpecialCaseListTest.cpp StringPool.cpp Loading