summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/Signals.inc
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-07-22 19:01:14 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-07-22 19:01:14 +0000
commit240bd9c875551d9d48ef27681f7b81d6ef1bd0cd (patch)
tree6d74b3dc511af44bf06139677f506b1f6a136793 /llvm/lib/Support/Unix/Signals.inc
parenta2d9369ef35ea16eeafaa926385f55f6bea5df1b (diff)
downloadbcm5719-llvm-240bd9c875551d9d48ef27681f7b81d6ef1bd0cd.tar.gz
bcm5719-llvm-240bd9c875551d9d48ef27681f7b81d6ef1bd0cd.zip
De-duplicate Unix & Windows CallBacksToRun
Move CallBacksToRun into the common Signals.cpp, create RunCallBacksToRun() and use these in both Unix/Signals.inc and Windows/Signals.inc. Lots of potential code to be merged here. llvm-svn: 242925
Diffstat (limited to 'llvm/lib/Support/Unix/Signals.inc')
-rw-r--r--llvm/lib/Support/Unix/Signals.inc10
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc
index 68e10435c7f..caccf7b377c 100644
--- a/llvm/lib/Support/Unix/Signals.inc
+++ b/llvm/lib/Support/Unix/Signals.inc
@@ -17,7 +17,6 @@
#include "llvm/Support/Format.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/Program.h"
@@ -25,7 +24,6 @@
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <string>
-#include <vector>
#if HAVE_EXECINFO_H
# include <execinfo.h> // For backtrace().
#endif
@@ -58,8 +56,6 @@ static ManagedStatic<SmartMutex<true> > SignalsMutex;
static void (*InterruptFunction)() = nullptr;
static ManagedStatic<std::vector<std::string>> FilesToRemove;
-static ManagedStatic<std::vector<std::pair<void (*)(void *), void *>>>
- CallBacksToRun;
// IntSigs - Signals that represent requested termination. There's no bug
// or failure, or if there is, it's not our direct responsibility. For whatever
@@ -205,11 +201,7 @@ static RETSIGTYPE SignalHandler(int Sig) {
}
// Otherwise if it is a fault (like SEGV) run any handler.
- if (CallBacksToRun.isConstructed()) {
- auto &CallBacksToRunRef = *CallBacksToRun;
- for (unsigned i = 0, e = CallBacksToRun->size(); i != e; ++i)
- CallBacksToRunRef[i].first(CallBacksToRunRef[i].second);
- }
+ RunCallBacksToRun();
#ifdef __s390__
// On S/390, certain signals are delivered with PSW Address pointing to
OpenPOWER on IntegriCloud