Make the pretty stack trace be an opt-in, rather than opt-out, facility. Enable pretty
[oota-llvm.git] / include / llvm / Support / PrettyStackTrace.h
index 2122e06d53fed7f3a58cec8ca339fec050fa48a1..4f68fca24f3849053d882a9796880c6dde5f447f 100644 (file)
 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;
   };