summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/PrettyStackTrace.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/PrettyStackTrace.cpp
parent2f59302ce804c0886ccc4dcdd5e51789981d4bc3 (diff)
downloadbcm5719-llvm-4e06def851a32cbe1a7d18562462850cb9ca2a1e.tar.gz
bcm5719-llvm-4e06def851a32cbe1a7d18562462850cb9ca2a1e.zip
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/PrettyStackTrace.cpp')
-rw-r--r--llvm/lib/Support/PrettyStackTrace.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Support/PrettyStackTrace.cpp b/llvm/lib/Support/PrettyStackTrace.cpp
index 21d56adb5e0..23ee5ab105a 100644
--- a/llvm/lib/Support/PrettyStackTrace.cpp
+++ b/llvm/lib/Support/PrettyStackTrace.cpp
@@ -17,6 +17,7 @@
#include "llvm/Config/config.h" // Get autoconf configuration settings
#include "llvm/Support/Signals.h"
#include "llvm/Support/ThreadLocal.h"
+#include "llvm/Support/Watchdog.h"
#include "llvm/Support/raw_ostream.h"
#ifdef HAVE_CRASHREPORTERCLIENT_H
@@ -37,7 +38,10 @@ static unsigned PrintStack(const PrettyStackTraceEntry *Entry, raw_ostream &OS){
if (Entry->getNextEntry())
NextID = PrintStack(Entry->getNextEntry(), OS);
OS << NextID << ".\t";
- Entry->print(OS);
+ {
+ sys::Watchdog W(5);
+ Entry->print(OS);
+ }
return NextID+1;
}
OpenPOWER on IntegriCloud