X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FSignals.h;h=2a4d84bd891a12f8dc1f85cf68e7dc74b4ebff7a;hb=870fdb54c3aebe7ba21894814cb27dccba19c837;hp=634f4cf76dc0dd4e1c37a8dbce9d8960e87af0f5;hpb=7a2bdde0a0eebcd2125055e0eacaca040f0b766c;p=oota-llvm.git diff --git a/include/llvm/Support/Signals.h b/include/llvm/Support/Signals.h index 634f4cf76dc..2a4d84bd891 100644 --- a/include/llvm/Support/Signals.h +++ b/include/llvm/Support/Signals.h @@ -12,12 +12,15 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SYSTEM_SIGNALS_H -#define LLVM_SYSTEM_SIGNALS_H +#ifndef LLVM_SUPPORT_SIGNALS_H +#define LLVM_SUPPORT_SIGNALS_H -#include "llvm/Support/Path.h" +#include namespace llvm { +class StringRef; +class raw_ostream; + namespace sys { /// This function runs all the registered interrupt handlers, including the @@ -27,16 +30,25 @@ namespace sys { /// This function registers signal handlers to ensure that if a signal gets /// delivered that the named file is removed. /// @brief Remove a file if a fatal signal occurs. - bool RemoveFileOnSignal(const Path &Filename, std::string* ErrMsg = 0); + bool RemoveFileOnSignal(StringRef Filename, std::string* ErrMsg = nullptr); /// This function removes a file from the list of files to be removed on /// signal delivery. - void DontRemoveFileOnSignal(const Path &Filename); + void DontRemoveFileOnSignal(StringRef Filename); /// When an error signal (such as SIBABRT or SIGSEGV) is delivered to the /// process, print a stack trace and then exit. /// @brief Print a stack trace if a fatal signal occurs. - void PrintStackTraceOnErrorSignal(); + void PrintStackTraceOnErrorSignal(bool DisableCrashReporting = false); + + /// Disable all system dialog boxes that appear when the process crashes. + void DisableSystemDialogsOnCrash(); + + /// \brief Print the stack trace using the given \c raw_ostream object. + void PrintStackTrace(raw_ostream &OS); + + // Run all registered signal handlers. + void RunSignalHandlers(); /// AddSignalHandler - Add a function to be called when an abort/kill signal /// is delivered to the process. The handler can have a cookie passed to it