clang
22.0.0git
include
clang
AST
PrettyDeclStackTrace.h
Go to the documentation of this file.
1
//===- PrettyDeclStackTrace.h - Stack trace for decl processing -*- C++ -*-===//
2
//
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
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file defines an llvm::PrettyStackTraceEntry object for showing
10
// that a particular declaration was being processed when a crash
11
// occurred.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_CLANG_AST_PRETTYDECLSTACKTRACE_H
16
#define LLVM_CLANG_AST_PRETTYDECLSTACKTRACE_H
17
18
#include "
clang/Basic/SourceLocation.h
"
19
#include "llvm/Support/PrettyStackTrace.h"
20
21
namespace
clang
{
22
23
class
ASTContext
;
24
class
Decl
;
25
26
/// PrettyDeclStackTraceEntry - If a crash occurs in the parser while
27
/// parsing something related to a declaration, include that
28
/// declaration in the stack trace.
29
class
PrettyDeclStackTraceEntry
:
public
llvm::PrettyStackTraceEntry {
30
ASTContext
&Context;
31
Decl
*TheDecl;
32
SourceLocation
Loc;
33
const
char
*Message;
34
35
public
:
36
PrettyDeclStackTraceEntry
(
ASTContext
&Ctx,
Decl
*D,
SourceLocation
Loc,
37
const
char
*Msg)
38
: Context(Ctx), TheDecl(D), Loc(Loc), Message(Msg) {}
39
40
void
print
(raw_ostream &OS)
const override
;
41
};
42
43
}
44
45
#endif
SourceLocation.h
Defines the clang::SourceLocation class and associated facilities.
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition
ASTContext.h:188
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition
DeclBase.h:86
clang::PrettyDeclStackTraceEntry::PrettyDeclStackTraceEntry
PrettyDeclStackTraceEntry(ASTContext &Ctx, Decl *D, SourceLocation Loc, const char *Msg)
Definition
PrettyDeclStackTrace.h:36
clang::PrettyDeclStackTraceEntry::print
void print(raw_ostream &OS) const override
Definition
Decl.cpp:80
clang::SourceLocation
Encodes a location in the source.
Definition
SourceLocation.h:90
clang
The JSON file list parser is used to communicate input to InstallAPI.
Definition
CalledOnceCheck.h:17
Generated on
for clang by
1.14.0