summaryrefslogtreecommitdiff
path: root/include/llvm/Support/PrettyStackTrace.h
diff options
context:
space:
mode:
authorFilip Pizlo <fpizlo@apple.com>2013-11-04 02:22:25 +0000
committerFilip Pizlo <fpizlo@apple.com>2013-11-04 02:22:25 +0000
commitfa0da86a59c502bfbfa01d3d5f694f18f6e8a717 (patch)
tree770dbb27d0618c91eca701bde217d71e3dd33e64 /include/llvm/Support/PrettyStackTrace.h
parent4ebe64ae7ec729b29964b355face33af0c4ce424 (diff)
downloadllvm-fa0da86a59c502bfbfa01d3d5f694f18f6e8a717.tar.gz
llvm-fa0da86a59c502bfbfa01d3d5f694f18f6e8a717.tar.bz2
llvm-fa0da86a59c502bfbfa01d3d5f694f18f6e8a717.tar.xz
Make the pretty stack trace be an opt-in, rather than opt-out, facility. Enable pretty
stack traces by default if you use PrettyStackTraceProgram, so that existing LLVM-based tools will continue to get it without any changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193971 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/PrettyStackTrace.h')
-rw-r--r--include/llvm/Support/PrettyStackTrace.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/llvm/Support/PrettyStackTrace.h b/include/llvm/Support/PrettyStackTrace.h
index 2122e06d53..4f68fca24f 100644
--- a/include/llvm/Support/PrettyStackTrace.h
+++ b/include/llvm/Support/PrettyStackTrace.h
@@ -21,11 +21,7 @@
namespace llvm {
class raw_ostream;
- /// DisablePrettyStackTrace - Set this to true to disable this module. This
- /// might be necessary if the host application installs its own signal
- /// handlers which conflict with the ones installed by this module.
- /// Defaults to false.
- extern bool DisablePrettyStackTrace;
+ void EnablePrettyStackTrace();
/// PrettyStackTraceEntry - This class is used to represent a frame of the
/// "pretty" stack trace that is dumped when a program crashes. You can define
@@ -64,7 +60,9 @@ namespace llvm {
const char *const *ArgV;
public:
PrettyStackTraceProgram(int argc, const char * const*argv)
- : ArgC(argc), ArgV(argv) {}
+ : ArgC(argc), ArgV(argv) {
+ EnablePrettyStackTrace();
+ }
virtual void print(raw_ostream &OS) const LLVM_OVERRIDE;
};