1212795Sdim//===- PrettyDeclStackTrace.h - Stack trace for decl processing -*- C++ -*-===// 2212795Sdim// 3212795Sdim// The LLVM Compiler Infrastructure 4212795Sdim// 5212795Sdim// This file is distributed under the University of Illinois Open Source 6212795Sdim// License. See LICENSE.TXT for details. 7212795Sdim// 8212795Sdim//===----------------------------------------------------------------------===// 9212795Sdim// 10212795Sdim// This file defines an llvm::PrettyStackTraceEntry object for showing 11212795Sdim// that a particular declaration was being processed when a crash 12212795Sdim// occurred. 13212795Sdim// 14212795Sdim//===----------------------------------------------------------------------===// 15212795Sdim 16212795Sdim#ifndef LLVM_CLANG_SEMA_PRETTY_DECL_STACK_TRACE_H 17212795Sdim#define LLVM_CLANG_SEMA_PRETTY_DECL_STACK_TRACE_H 18212795Sdim 19212795Sdim#include "clang/Basic/SourceLocation.h" 20212795Sdim#include "llvm/Support/PrettyStackTrace.h" 21212795Sdim 22212795Sdimnamespace clang { 23212795Sdim 24212795Sdimclass Decl; 25212795Sdimclass Sema; 26212795Sdimclass SourceManager; 27212795Sdim 28212795Sdim/// PrettyDeclStackTraceEntry - If a crash occurs in the parser while 29212795Sdim/// parsing something related to a declaration, include that 30212795Sdim/// declaration in the stack trace. 31212795Sdimclass PrettyDeclStackTraceEntry : public llvm::PrettyStackTraceEntry { 32212795Sdim Sema &S; 33212795Sdim Decl *TheDecl; 34212795Sdim SourceLocation Loc; 35212795Sdim const char *Message; 36234353Sdim 37212795Sdimpublic: 38234353Sdim PrettyDeclStackTraceEntry(Sema &S, Decl *D, SourceLocation Loc, 39234353Sdim const char *Msg) 40212795Sdim : S(S), TheDecl(D), Loc(Loc), Message(Msg) {} 41212795Sdim 42226633Sdim virtual void print(raw_ostream &OS) const; 43212795Sdim}; 44212795Sdim 45212795Sdim} 46212795Sdim 47212795Sdim#endif 48