1 //===- clang/Basic/PrettyStackTrace.h - Pretty Crash Handling --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief Defines the PrettyStackTraceEntry class, which is used to make
12 /// crashes give more contextual information about what the program was doing
15 //===----------------------------------------------------------------------===//
17 #ifndef CLANG_BASIC_PRETTYSTACKTRACE_H
18 #define CLANG_BASIC_PRETTYSTACKTRACE_H
20 #include "clang/Basic/SourceLocation.h"
21 #include "llvm/Support/PrettyStackTrace.h"
25 /// If a crash happens while one of these objects are live, the message
26 /// is printed out along with the specified source location.
27 class PrettyStackTraceLoc : public llvm::PrettyStackTraceEntry {
32 PrettyStackTraceLoc(SourceManager &sm, SourceLocation L, const char *Msg)
33 : SM(sm), Loc(L), Message(Msg) {}
34 virtual void print(raw_ostream &OS) const;