[llvm] 53a656d - [utils/not] Disable coredumps when --crash is passed
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 4 10:45:25 PST 2024
Author: Alexander Richardson
Date: 2024-03-04T10:45:22-08:00
New Revision: 53a656d9a4032b842ad0c59489353e17daa54531
URL: https://github.com/llvm/llvm-project/commit/53a656d9a4032b842ad0c59489353e17daa54531
DIFF: https://github.com/llvm/llvm-project/commit/53a656d9a4032b842ad0c59489353e17daa54531.diff
LOG: [utils/not] Disable coredumps when --crash is passed
We are expecting a crash, so it is unlikely that a coredump is going to
be particularly useful. For debugging the program can always be run without
the `not --crash` wrapper.
Reviewed By: jh7370
Pull Request: https://github.com/llvm/llvm-project/pull/83704
Added:
Modified:
llvm/utils/not/not.cpp
Removed:
################################################################################
diff --git a/llvm/utils/not/not.cpp b/llvm/utils/not/not.cpp
index 4fcc0e89fc4023..6ba59190d8ada0 100644
--- a/llvm/utils/not/not.cpp
+++ b/llvm/utils/not/not.cpp
@@ -11,6 +11,7 @@
// not --crash cmd
// Will return true if cmd crashes (e.g. for testing crash reporting).
+#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
@@ -41,6 +42,9 @@ int main(int argc, const char **argv) {
setenv("LLVM_DISABLE_CRASH_REPORT", "1", 0);
setenv("LLVM_DISABLE_SYMBOLIZATION", "1", 0);
#endif
+ // Try to disable coredumps for expected crashes as well since this can
+ // noticeably slow down running the test suite.
+ sys::Process::PreventCoreFiles();
}
if (argc == 0)
More information about the llvm-commits
mailing list