1 //===- Signals.cpp - Signal Handling support --------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines some helpful functions for dealing with the possibility of
11 // Unix signals occurring while your program is running.
13 //===----------------------------------------------------------------------===//
15 #include "llvm/Config/config.h"
16 #include "llvm/Support/ManagedStatic.h"
17 #include "llvm/Support/Signals.h"
24 //===----------------------------------------------------------------------===//
25 //=== WARNING: Implementation here must contain only TRULY operating system
26 //=== independent code.
27 //===----------------------------------------------------------------------===//
29 static ManagedStatic<std::vector<std::pair<void (*)(void *), void *>>>
31 void sys::RunSignalHandlers() {
32 if (!CallBacksToRun.isConstructed())
34 for (auto &I : *CallBacksToRun)
36 CallBacksToRun->clear();
40 // Include the platform-specific parts of this class.
42 #include "Unix/Signals.inc"
45 #include "Windows/Signals.inc"