From b1c7889f326fe04e539a136145c1a166eab1c1a1 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 3 Jun 2022 16:21:42 -0700 Subject: [PATCH] [config] Remove RETSIGTYPE from config.h.cmake, NFC This doesn't need to be configurable. It was hardcoded to void in all LLVM build systems. --- llvm/cmake/config-ix.cmake | 3 --- llvm/include/llvm/Config/config.h.cmake | 3 --- llvm/lib/Support/Unix/Signals.inc | 8 ++++---- llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn | 1 - .../bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h | 3 --- utils/bazel/llvm_configs/config.h.cmake | 3 --- 6 files changed, 4 insertions(+), 17 deletions(-) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index 0da93ec..9a375a6 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -539,9 +539,6 @@ else() set(LLVM_ENABLE_DIA_SDK 0) endif( MSVC ) -# FIXME: Signal handler return type, currently hardcoded to 'void' -set(RETSIGTYPE void) - if( LLVM_ENABLE_THREADS ) # Check if threading primitives aren't supported on this platform if( NOT HAVE_PTHREAD_H AND NOT WIN32 ) diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake index 307a289..0055bc01 100644 --- a/llvm/include/llvm/Config/config.h.cmake +++ b/llvm/include/llvm/Config/config.h.cmake @@ -323,9 +323,6 @@ /* Define to the vendor of this package. */ #cmakedefine PACKAGE_VENDOR "${PACKAGE_VENDOR}" -/* Define as the return type of signal handlers (`int' or `void'). */ -#cmakedefine RETSIGTYPE ${RETSIGTYPE} - /* Define if std::is_trivially_copyable is supported */ #cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE ${HAVE_STD_IS_TRIVIALLY_COPYABLE} diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index 575e2aa..23ac012 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -79,8 +79,8 @@ using namespace llvm; -static RETSIGTYPE SignalHandler(int Sig); // defined below. -static RETSIGTYPE InfoSignalHandler(int Sig); // defined below. +static void SignalHandler(int Sig); // defined below. +static void InfoSignalHandler(int Sig); // defined below. using SignalHandlerFunctionType = void (*)(); /// The function to call if ctrl-c is pressed. @@ -362,7 +362,7 @@ void sys::CleanupOnSignal(uintptr_t Context) { } // The signal handler that runs. -static RETSIGTYPE SignalHandler(int Sig) { +static void SignalHandler(int Sig) { // Restore the signal behavior to default, so that the program actually // crashes when we return and the signal reissues. This also ensures that if // we crash in our signal handler that the program will terminate immediately @@ -406,7 +406,7 @@ static RETSIGTYPE SignalHandler(int Sig) { #endif } -static RETSIGTYPE InfoSignalHandler(int Sig) { +static void InfoSignalHandler(int Sig) { SaveAndRestore SaveErrnoDuringASignalHandler(errno); if (SignalHandlerFunctionType CurrentInfoFunction = InfoSignalFunction) CurrentInfoFunction(); diff --git a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn index 225c11a..951dabe 100644 --- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn @@ -129,7 +129,6 @@ write_cmake_config("config") { "PACKAGE_STRING=LLVM ${llvm_version}git", "PACKAGE_VERSION=${llvm_version}git", "PACKAGE_VENDOR=", - "RETSIGTYPE=void", "LLVM_GISEL_COV_ENABLED=", "LLVM_GISEL_COV_PREFIX=", diff --git a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h index 85b43ed..d5b6034 100644 --- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h +++ b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h @@ -336,9 +336,6 @@ /* Define to the vendor of this package. */ /* #undef PACKAGE_VENDOR */ -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - /* Define if std::is_trivially_copyable is supported */ #define HAVE_STD_IS_TRIVIALLY_COPYABLE 1 diff --git a/utils/bazel/llvm_configs/config.h.cmake b/utils/bazel/llvm_configs/config.h.cmake index 307a289..0055bc01 100644 --- a/utils/bazel/llvm_configs/config.h.cmake +++ b/utils/bazel/llvm_configs/config.h.cmake @@ -323,9 +323,6 @@ /* Define to the vendor of this package. */ #cmakedefine PACKAGE_VENDOR "${PACKAGE_VENDOR}" -/* Define as the return type of signal handlers (`int' or `void'). */ -#cmakedefine RETSIGTYPE ${RETSIGTYPE} - /* Define if std::is_trivially_copyable is supported */ #cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE ${HAVE_STD_IS_TRIVIALLY_COPYABLE} -- 2.7.4