Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:50

0001 //===- clang/Basic/PrettyStackTrace.h - Pretty Crash Handling --*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 ///
0009 /// \file
0010 /// Defines the PrettyStackTraceEntry class, which is used to make
0011 /// crashes give more contextual information about what the program was doing
0012 /// when it crashed.
0013 ///
0014 //===----------------------------------------------------------------------===//
0015 
0016 #ifndef LLVM_CLANG_BASIC_PRETTYSTACKTRACE_H
0017 #define LLVM_CLANG_BASIC_PRETTYSTACKTRACE_H
0018 
0019 #include "clang/Basic/SourceLocation.h"
0020 #include "llvm/Support/PrettyStackTrace.h"
0021 
0022 namespace clang {
0023 
0024   /// If a crash happens while one of these objects are live, the message
0025   /// is printed out along with the specified source location.
0026   class PrettyStackTraceLoc : public llvm::PrettyStackTraceEntry {
0027     SourceManager &SM;
0028     SourceLocation Loc;
0029     const char *Message;
0030   public:
0031     PrettyStackTraceLoc(SourceManager &sm, SourceLocation L, const char *Msg)
0032       : SM(sm), Loc(L), Message(Msg) {}
0033     void print(raw_ostream &OS) const override;
0034   };
0035 }
0036 
0037 #endif