summaryrefslogtreecommitdiff
path: root/lib/System/Win32/Signals.inc
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-09-01 14:17:34 +0000
committerDan Gohman <gohman@apple.com>2010-09-01 14:17:34 +0000
commit41154114f64c1531764236e9268d2a5ac52e3e91 (patch)
tree319ab11fef0bef74dea022b59eb2ad0731112888 /lib/System/Win32/Signals.inc
parent2ad12a0e2afa3cdffa35a4223bea775ad06ad468 (diff)
downloadllvm-41154114f64c1531764236e9268d2a5ac52e3e91.tar.gz
llvm-41154114f64c1531764236e9268d2a5ac52e3e91.tar.bz2
llvm-41154114f64c1531764236e9268d2a5ac52e3e91.tar.xz
Add an interface for unregistering a file from the FilesToRemove list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32/Signals.inc')
-rw-r--r--lib/System/Win32/Signals.inc14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/System/Win32/Signals.inc b/lib/System/Win32/Signals.inc
index d6db71ba4f..2498a26ea9 100644
--- a/lib/System/Win32/Signals.inc
+++ b/lib/System/Win32/Signals.inc
@@ -140,6 +140,20 @@ bool sys::RemoveFileOnSignal(const sys::Path &Filename, std::string* ErrMsg) {
return false;
}
+// DontRemoveFileOnSignal - The public API
+void sys::DontRemoveFileOnSignal(const sys::Path &Filename) {
+ if (FilesToRemove == NULL)
+ return;
+
+ FilesToRemove->push_back(Filename);
+ std::vector<sys::Path>::reverse_iterator I =
+ std::find(FilesToRemove->rbegin(), FilesToRemove->rend(), Filename);
+ if (I != FilesToRemove->rend())
+ FilesToRemove->erase(I.base()-1);
+
+ LeaveCriticalSection(&CriticalSection);
+}
+
/// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or
/// SIGSEGV) is delivered to the process, print a stack trace and then exit.
void sys::PrintStackTraceOnErrorSignal() {