1 //===- PrettyDeclStackTrace.h - Stack trace for decl processing -*- 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 an llvm::PrettyStackTraceEntry object for showing
11 // that a particular declaration was being processed when a crash
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_SEMA_PRETTYDECLSTACKTRACE_H
17 #define LLVM_CLANG_SEMA_PRETTYDECLSTACKTRACE_H
19 #include "clang/Basic/SourceLocation.h"
20 #include "llvm/Support/PrettyStackTrace.h"
28 /// PrettyDeclStackTraceEntry - If a crash occurs in the parser while
29 /// parsing something related to a declaration, include that
30 /// declaration in the stack trace.
31 class PrettyDeclStackTraceEntry : public llvm::PrettyStackTraceEntry {
38 PrettyDeclStackTraceEntry(Sema &S, Decl *D, SourceLocation Loc,
40 : S(S), TheDecl(D), Loc(Loc), Message(Msg) {}
42 void print(raw_ostream &OS) const override;