aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Process.cpp')
-rw-r--r--llvm/lib/Support/Process.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Support/Process.cpp b/llvm/lib/Support/Process.cpp
index 9f0b689..8626117 100644
--- a/llvm/lib/Support/Process.cpp
+++ b/llvm/lib/Support/Process.cpp
@@ -20,6 +20,8 @@
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
+#include <stddef.h> // for _Exit
+
using namespace llvm;
using namespace sys;
@@ -91,10 +93,14 @@ static bool coreFilesPrevented = !LLVM_ENABLE_CRASH_DUMPS;
bool Process::AreCoreFilesPrevented() { return coreFilesPrevented; }
LLVM_ATTRIBUTE_NORETURN
-void Process::Exit(int RetCode) {
+void Process::Exit(int RetCode, bool NoCleanup) {
if (CrashRecoveryContext *CRC = CrashRecoveryContext::GetCurrent())
CRC->HandleExit(RetCode);
- ::exit(RetCode);
+
+ if (NoCleanup)
+ _Exit(RetCode);
+ else
+ ::exit(RetCode);
}
// Include the platform-specific parts of this class.