diff options
-rw-r--r-- | llvm/CMakeLists.txt | 2 | ||||
-rw-r--r-- | llvm/include/llvm/Config/config.h.cmake | 3 | ||||
-rw-r--r-- | llvm/lib/Support/Process.cpp | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 8f6827170ae..269b45af803 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -320,6 +320,8 @@ if(LLVM_ENABLE_CRASH_OVERRIDES) set(ENABLE_CRASH_OVERRIDES 1) endif() +option(LLVM_ENABLE_CRASH_DUMPS "Turn on memory dumps on crashes. Currently only implemented on Windows." OFF) + option(LLVM_ENABLE_FFI "Use libffi to call external functions from the interpreter" OFF) set(FFI_LIBRARY_DIR "" CACHE PATH "Additional directory, where CMake should search for libffi.so") set(FFI_INCLUDE_DIR "" CACHE PATH "Additional directory, where CMake should search for ffi.h or ffi/ffi.h") diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake index e934617d7ec..aece421b77d 100644 --- a/llvm/include/llvm/Config/config.h.cmake +++ b/llvm/include/llvm/Config/config.h.cmake @@ -13,6 +13,9 @@ /* Define to 1 to enable crash overrides, and to 0 otherwise. */ #cmakedefine01 ENABLE_CRASH_OVERRIDES +/* Define to 1 to enable crash memory dumps, and to 0 otherwise. */ +#cmakedefine01 LLVM_ENABLE_CRASH_DUMPS + /* Define to 1 if you have the `backtrace' function. */ #cmakedefine HAVE_BACKTRACE ${HAVE_BACKTRACE} diff --git a/llvm/lib/Support/Process.cpp b/llvm/lib/Support/Process.cpp index 3f5a9d722ca..b46edb1a791 100644 --- a/llvm/lib/Support/Process.cpp +++ b/llvm/lib/Support/Process.cpp @@ -15,6 +15,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Config/llvm-config.h" +#include "llvm/Config/config.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/Program.h" @@ -86,7 +87,7 @@ static const char colorcodes[2][2][8][10] = { static bool coreFilesPrevented = false; bool Process::AreCoreFilesPrevented() { - return coreFilesPrevented; + return !LLVM_ENABLE_CRASH_DUMPS; } // Include the platform-specific parts of this class. |