LLVM API Documentation
00001 //===- llvm/System/Signals.h - Signal Handling support ----------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file was developed by the LLVM research group and is distributed under 00006 // the University of Illinois Open Source License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines some helpful functions for dealing with the possibility of 00011 // unix signals occuring while your program is running. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef LLVM_SYSTEM_SIGNALS_H 00016 #define LLVM_SYSTEM_SIGNALS_H 00017 00018 #include "llvm/System/Path.h" 00019 00020 namespace llvm { 00021 namespace sys { 00022 00023 /// This function registers signal handlers to ensure that if a signal gets 00024 /// delivered that the named file is removed. 00025 /// @brief Remove a file if a fatal signal occurs. 00026 void RemoveFileOnSignal(const Path &Filename); 00027 00028 /// This function registers a signal handler to ensure that if a fatal signal 00029 /// gets delivered to the process that the named directory and all its 00030 /// contents are removed. 00031 /// @brief Remove a directory if a fatal signal occurs. 00032 void RemoveDirectoryOnSignal(const Path& path); 00033 00034 /// When an error signal (such as SIBABRT or SIGSEGV) is delivered to the 00035 /// process, print a stack trace and then exit. 00036 /// @brief Print a stack trace if a fatal signal occurs. 00037 void PrintStackTraceOnErrorSignal(); 00038 00039 } // End sys namespace 00040 } // End llvm namespace 00041 00042 #endif