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 //===----------------------------------------------------------------------===//
10 // This file defines the PrettyStackTraceEntry class, which is used to make
11 // crashes give more contextual information about what the program was doing
14 //===----------------------------------------------------------------------===//
16 #ifndef CLANG_BASIC_PRETTYSTACKTRACE_H
17 #define CLANG_BASIC_PRETTYSTACKTRACE_H
19 #include "clang/Basic/SourceLocation.h"
20 #include "llvm/Support/PrettyStackTrace.h"
24 /// PrettyStackTraceLoc - If a crash happens while one of these objects are
25 /// live, the message is printed out along with the specified source location.
26 class PrettyStackTraceLoc : public llvm::PrettyStackTraceEntry {
31 PrettyStackTraceLoc(SourceManager &sm, SourceLocation L, const char *Msg)
32 : SM(sm), Loc(L), Message(Msg) {}
33 virtual void print(raw_ostream &OS) const;