summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2014-08-29 01:05:16 +0000
committerChris Bieneman <beanz@apple.com>2014-08-29 01:05:16 +0000
commitb1cd51e33c0f035ff8fdb06968c7df9f57e7e325 (patch)
treeeccd13dbafd038761ca631ad467470182ee778ff /llvm/lib/Support
parent5e7f44c25edb8e16e9250c51674ca9abef20048e (diff)
downloadbcm5719-llvm-b1cd51e33c0f035ff8fdb06968c7df9f57e7e325.tar.gz
bcm5719-llvm-b1cd51e33c0f035ff8fdb06968c7df9f57e7e325.zip
Cleaning up static initializers in Signals.inc
Reviewed by: Chandlerc llvm-svn: 216704
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Unix/Signals.inc9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc
index c820553665d..36e521b2531 100644
--- a/llvm/lib/Support/Unix/Signals.inc
+++ b/llvm/lib/Support/Unix/Signals.inc
@@ -56,7 +56,6 @@ static std::vector<std::pair<void(*)(void*), void*> > CallBacksToRun;
static const int IntSigs[] = {
SIGHUP, SIGINT, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2
};
-static const int *const IntSigsEnd = std::end(IntSigs);
// KillSigs - Signals that represent that we have a bug, and our prompt
// termination has been ordered.
@@ -75,7 +74,6 @@ static const int KillSigs[] = {
, SIGEMT
#endif
};
-static const int *const KillSigsEnd = std::end(KillSigs);
static unsigned NumRegisteredSignals = 0;
static struct {
@@ -106,8 +104,8 @@ static void RegisterHandlers() {
// If the handlers are already registered, we're done.
if (NumRegisteredSignals != 0) return;
- std::for_each(IntSigs, IntSigsEnd, RegisterHandler);
- std::for_each(KillSigs, KillSigsEnd, RegisterHandler);
+ for (auto S : IntSigs) RegisterHandler(S);
+ for (auto S : KillSigs) RegisterHandler(S);
}
static void UnregisterHandlers() {
@@ -167,7 +165,8 @@ static RETSIGTYPE SignalHandler(int Sig) {
unique_lock<SmartMutex<true>> Guard(SignalsMutex);
RemoveFilesToRemove();
- if (std::find(IntSigs, IntSigsEnd, Sig) != IntSigsEnd) {
+ if (std::find(std::begin(IntSigs), std::end(IntSigs), Sig)
+ != std::end(IntSigs)) {
if (InterruptFunction) {
void (*IF)() = InterruptFunction;
Guard.unlock();
OpenPOWER on IntegriCloud