diff options
author | Reid Kleckner <rnk@google.com> | 2018-08-23 22:58:56 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-08-23 22:58:56 +0000 |
commit | 7a973fb7f25cfb08858ea56c0d068f9ad4b2c50e (patch) | |
tree | 8e308453911957e0153f882e27f1be0436a72155 /llvm/lib/Support | |
parent | 9f690839d6413a146a65fee793561f25db8f7da4 (diff) | |
download | bcm5719-llvm-7a973fb7f25cfb08858ea56c0d068f9ad4b2c50e.tar.gz bcm5719-llvm-7a973fb7f25cfb08858ea56c0d068f9ad4b2c50e.zip |
Make LLVM_ENABLE_CRASH_DUMPS set a variable default
That way users can set the default to true, but then disable core dumps
from certain apps that link support.
llvm-svn: 340588
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/Process.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Support/Process.cpp b/llvm/lib/Support/Process.cpp index bf5779d69c6..f32355aefbb 100644 --- a/llvm/lib/Support/Process.cpp +++ b/llvm/lib/Support/Process.cpp @@ -83,12 +83,11 @@ static const char colorcodes[2][2][8][10] = { { ALLCOLORS("4",""), ALLCOLORS("4","1;") } }; -// This is set to true when Process::PreventCoreFiles() is called. -static bool coreFilesPrevented = false; +// A CMake option controls wheter we emit core dumps by default. An application +// may disable core dumps by calling Process::PreventCoreFiles(). +static bool coreFilesPrevented = !LLVM_ENABLE_CRASH_DUMPS; -bool Process::AreCoreFilesPrevented() { - return LLVM_ENABLE_CRASH_DUMPS ? coreFilesPrevented : false; -} +bool Process::AreCoreFilesPrevented() { return coreFilesPrevented; } // Include the platform-specific parts of this class. #ifdef LLVM_ON_UNIX |