summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Signals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Signals.cpp')
-rw-r--r--llvm/lib/Support/Signals.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/Support/Signals.cpp b/llvm/lib/Support/Signals.cpp
index a11789372d9..598ef50175a 100644
--- a/llvm/lib/Support/Signals.cpp
+++ b/llvm/lib/Support/Signals.cpp
@@ -12,8 +12,11 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Support/Signals.h"
#include "llvm/Config/config.h"
+#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/Signals.h"
+
+#include <vector>
namespace llvm {
using namespace sys;
@@ -23,6 +26,15 @@ using namespace sys;
//=== independent code.
//===----------------------------------------------------------------------===//
+static ManagedStatic<std::vector<std::pair<void (*)(void *), void *>>>
+ CallBacksToRun;
+void RunCallBacksToRun() {
+ if (!CallBacksToRun.isConstructed())
+ return;
+ for (auto &I : *CallBacksToRun)
+ I.first(I.second);
+ CallBacksToRun->clear();
+}
}
// Include the platform-specific parts of this class.
OpenPOWER on IntegriCloud