clang 8.0.0

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 /// 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
20 #include "clang/Basic/SourceLocation.h"
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:
32 PrettyStackTraceLoc(SourceManager &sm, SourceLocation L, const char *Msg)
33 : SM(sm), Loc(L), Message(Msg) {}
34 void print(raw_ostream &OS) const override;
35 };
36 }
37
38 #endif
clang::PrettyStackTraceLoc::print
void print(raw_ostream &OS) const override
Definition: SourceLocation.cpp:32
clang::PrettyStackTraceLoc
If a crash happens while one of these objects are live, the message is printed out along with the spe...
Definition: PrettyStackTrace.h:27
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:88
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
SourceLocation.h
Defines the clang::SourceLocation class and associated facilities.
clang::SourceManager
This class handles loading and caching of source files into memory.
Definition: SourceManager.h:582
clang::PrettyStackTraceLoc::PrettyStackTraceLoc
PrettyStackTraceLoc(SourceManager &sm, SourceLocation L, const char *Msg)
Definition: PrettyStackTrace.h:32