clang  6.0.0svn
PrettyStackTrace.h
Go to the documentation of this file.
1 //===- clang/Basic/PrettyStackTrace.h - Pretty Crash Handling --*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief Defines the PrettyStackTraceEntry class, which is used to make
12 /// crashes give more contextual information about what the program was doing
13 /// when it crashed.
14 ///
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_CLANG_BASIC_PRETTYSTACKTRACE_H
18 #define LLVM_CLANG_BASIC_PRETTYSTACKTRACE_H
19 
21 #include "llvm/Support/PrettyStackTrace.h"
22 
23 namespace clang {
24 
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 {
28  SourceManager &SM;
29  SourceLocation Loc;
30  const char *Message;
31  public:
33  : SM(sm), Loc(L), Message(Msg) {}
34  void print(raw_ostream &OS) const override;
35  };
36 }
37 
38 #endif
void print(raw_ostream &OS) const override
If a crash happens while one of these objects are live, the message is printed out along with the spe...
Encodes a location in the source.
Dataflow Directional Tag Classes.
Defines the clang::SourceLocation class and associated facilities.
This class handles loading and caching of source files into memory.
PrettyStackTraceLoc(SourceManager &sm, SourceLocation L, const char *Msg)