aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Watchdog.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-03-26 01:27:52 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-03-26 01:27:52 +0000
commit4e06def851a32cbe1a7d18562462850cb9ca2a1e (patch)
tree4e75b9aa7f52a0b25360659790d546171270bf92 /llvm/lib/Support/Watchdog.cpp
parent2f59302ce804c0886ccc4dcdd5e51789981d4bc3 (diff)
downloadllvm-4e06def851a32cbe1a7d18562462850cb9ca2a1e.zip
llvm-4e06def851a32cbe1a7d18562462850cb9ca2a1e.tar.gz
llvm-4e06def851a32cbe1a7d18562462850cb9ca2a1e.tar.bz2
Add a new watchdog timer interface. The interface does not permit handling timeouts, so
it's only really useful if you're going to crash anyways. Use it in the pretty stack trace printer to kill the compiler if we hang while printing the stack trace. llvm-svn: 177962
Diffstat (limited to 'llvm/lib/Support/Watchdog.cpp')
-rw-r--r--llvm/lib/Support/Watchdog.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/Support/Watchdog.cpp b/llvm/lib/Support/Watchdog.cpp
new file mode 100644
index 0000000..724aa00
--- /dev/null
+++ b/llvm/lib/Support/Watchdog.cpp
@@ -0,0 +1,23 @@
+//===---- Watchdog.cpp - Implement Watchdog ---------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the Watchdog class.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/Watchdog.h"
+#include "llvm/Config/config.h"
+
+// Include the platform-specific parts of this class.
+#ifdef LLVM_ON_UNIX
+#include "Unix/Watchdog.inc"
+#endif
+#ifdef LLVM_ON_WIN32
+#include "Windows/Watchdog.inc"
+#endif