14#ifndef LLVM_CLANG_SEMA_SEMABASE_H
15#define LLVM_CLANG_SEMA_SEMABASE_H
23#include "llvm/ADT/DenseMap.h"
32class DiagnosticsEngine;
89 typename = std::enable_if_t<!std::is_lvalue_reference<T>::value>>
92 BaseDiag << std::move(
V);
154 template <
typename T>
157 if (
Diag.ImmediateDiag)
159 else if (
Diag.PartialDiagId)
160 Diag.getDeviceDeferredDiags()[
Diag.Fn][*
Diag.PartialDiagId].second
168 template <
typename T,
169 typename = std::enable_if_t<!std::is_lvalue_reference<T>::value>>
172 *ImmediateDiag << std::move(
V);
173 else if (PartialDiagId)
174 getDeviceDeferredDiags()[Fn][*PartialDiagId].second << std::move(
V);
196 llvm::DenseMap<CanonicalDeclPtr<const FunctionDecl>,
197 std::vector<PartialDiagnosticAt>>;
208 std::optional<ImmediateDiagBuilder> ImmediateDiag;
209 std::optional<unsigned> PartialDiagId;
216 bool DeferHint =
false);
220 bool DeferHint =
false);
224 bool DeferHint =
false);
Defines the Diagnostic-related interfaces.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
Defines the clang::SourceLocation class and associated facilities.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
A little helper class used to produce diagnostics.
Concrete class used by the front-end to report problems and issues.
Annotates a diagnostic with some code that should be inserted, removed, or replaced to fix the proble...
Represents a function declaration or definition.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
A generic diagnostic builder for errors which may or may not be deferred.
SemaDiagnosticBuilder(const SemaDiagnosticBuilder &)=default
@ K_Deferred
Create a deferred diagnostic, which is emitted only if the function it's attached to is codegen'ed.
@ K_ImmediateWithCallStack
Emit the diagnostic immediately, and, if it's a warning or error, also emit a call stack showing how ...
@ K_Nop
Emit no diagnostics.
@ K_Immediate
Emit the diagnostic immediately (i.e., behave like Sema::Diag()).
void AddFixItHint(const FixItHint &Hint) const
friend const SemaDiagnosticBuilder & operator<<(const SemaDiagnosticBuilder &Diag, const T &Value)
SemaDiagnosticBuilder(Kind K, SourceLocation Loc, unsigned DiagID, const FunctionDecl *Fn, Sema &S)
friend StmtResult StmtError(const SemaDiagnosticBuilder &)
llvm::DenseMap< CanonicalDeclPtr< const FunctionDecl >, std::vector< PartialDiagnosticAt > > DeferredDiagnosticsType
const SemaDiagnosticBuilder & operator<<(T &&V) const
SemaDiagnosticBuilder & operator=(const SemaDiagnosticBuilder &)=delete
friend ExprResult ExprError(const SemaDiagnosticBuilder &)
SemaDiagnosticBuilder & operator=(SemaDiagnosticBuilder &&)=delete
SemaDiagnosticBuilder(SemaDiagnosticBuilder &&D)
SemaDiagnosticBuilder DiagCompat(SourceLocation Loc, unsigned CompatDiagId, bool DeferHint=false)
Emit a compatibility diagnostic.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
PartialDiagnostic PDiag(unsigned DiagID=0)
Build a partial diagnostic.
ASTContext & getASTContext() const
const LangOptions & getLangOpts() const
DiagnosticsEngine & getDiagnostics() const
DeclContext * getCurContext() const
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
The JSON file list parser is used to communicate input to InstallAPI.
ActionResult< CXXCtorInitializer * > MemInitResult
ActionResult< Expr * > ExprResult
ActionResult< Stmt * > StmtResult
ActionResult< ParsedType > TypeResult
const FunctionProtoType * T
ActionResult< Decl * > DeclResult