1 //===- clang/Basic/PrettyStackTrace.h - Pretty Crash Handling --*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// Defines the PrettyStackTraceEntry class, which is used to make
11 /// crashes give more contextual information about what the program was doing
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_BASIC_PRETTYSTACKTRACE_H
17 #define LLVM_CLANG_BASIC_PRETTYSTACKTRACE_H
19 #include "clang/Basic/SourceLocation.h"
20 #include "llvm/Support/PrettyStackTrace.h"
24 /// If a crash happens while one of these objects are live, the message
25 /// 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 void print(raw_ostream &OS) const override;