clang 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::sema::DelayedDiagnostic Class Reference

A diagnostic message which has been conditionally emitted pending the complete parsing of the current declaration. More...

#include "clang/Sema/DelayedDiagnostic.h"

Public Types

enum  DDKind : unsigned char { Availability , Access , ForbiddenType }
 

Public Member Functions

void Destroy ()
 
AccessedEntitygetAccessData ()
 
const AccessedEntitygetAccessData () const
 
const NamedDeclgetAvailabilityReferringDecl () const
 
const NamedDeclgetAvailabilityOffendingDecl () const
 
StringRef getAvailabilityMessage () const
 
ArrayRef< SourceLocationgetAvailabilitySelectorLocs () const
 
AvailabilityResult getAvailabilityResult () const
 
unsigned getForbiddenTypeDiagnostic () const
 The diagnostic ID to emit.
 
unsigned getForbiddenTypeArgument () const
 
QualType getForbiddenTypeOperand () const
 
const ObjCInterfaceDeclgetUnknownObjCClass () const
 
const ObjCPropertyDeclgetObjCProperty () const
 
bool getObjCPropertyAccess () const
 

Static Public Member Functions

static DelayedDiagnostic makeAvailability (AvailabilityResult AR, ArrayRef< SourceLocation > Locs, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, StringRef Msg, bool ObjCPropertyAccess)
 
static DelayedDiagnostic makeAccess (SourceLocation Loc, const AccessedEntity &Entity)
 
static DelayedDiagnostic makeForbiddenType (SourceLocation loc, unsigned diagnostic, QualType type, unsigned argument)
 

Public Attributes

DDKind Kind
 
bool Triggered
 
SourceLocation Loc
 
struct AD AvailabilityData
 
struct FTD ForbiddenTypeData
 
char AccessData [sizeof(AccessedEntity)]
 Access control.
 

Detailed Description

A diagnostic message which has been conditionally emitted pending the complete parsing of the current declaration.

Definition at line 126 of file DelayedDiagnostic.h.

Member Enumeration Documentation

◆ DDKind

Enumerator
Availability 
Access 
ForbiddenType 

Definition at line 128 of file DelayedDiagnostic.h.

Member Function Documentation

◆ Destroy()

void DelayedDiagnostic::Destroy ( )

◆ getAccessData() [1/2]

AccessedEntity & clang::sema::DelayedDiagnostic::getAccessData ( )
inline

Definition at line 170 of file DelayedDiagnostic.h.

References Access, AccessData, and Kind.

Referenced by Destroy(), clang::Sema::HandleDelayedAccessCheck(), and makeAccess().

◆ getAccessData() [2/2]

const AccessedEntity & clang::sema::DelayedDiagnostic::getAccessData ( ) const
inline

Definition at line 174 of file DelayedDiagnostic.h.

References Access, AccessData, and Kind.

◆ getAvailabilityMessage()

StringRef clang::sema::DelayedDiagnostic::getAvailabilityMessage ( ) const
inline

Definition at line 188 of file DelayedDiagnostic.h.

References Availability, AvailabilityData, and Kind.

Referenced by clang::Sema::handleDelayedAvailabilityCheck().

◆ getAvailabilityOffendingDecl()

const NamedDecl * clang::sema::DelayedDiagnostic::getAvailabilityOffendingDecl ( ) const
inline

Definition at line 184 of file DelayedDiagnostic.h.

References AvailabilityData.

Referenced by clang::Sema::handleDelayedAvailabilityCheck().

◆ getAvailabilityReferringDecl()

const NamedDecl * clang::sema::DelayedDiagnostic::getAvailabilityReferringDecl ( ) const
inline

Definition at line 179 of file DelayedDiagnostic.h.

References Availability, AvailabilityData, and Kind.

Referenced by clang::Sema::handleDelayedAvailabilityCheck().

◆ getAvailabilityResult()

AvailabilityResult clang::sema::DelayedDiagnostic::getAvailabilityResult ( ) const
inline

Definition at line 199 of file DelayedDiagnostic.h.

References Availability, AvailabilityData, and Kind.

Referenced by clang::Sema::handleDelayedAvailabilityCheck().

◆ getAvailabilitySelectorLocs()

ArrayRef< SourceLocation > clang::sema::DelayedDiagnostic::getAvailabilitySelectorLocs ( ) const
inline

Definition at line 193 of file DelayedDiagnostic.h.

References Availability, AvailabilityData, and Kind.

Referenced by clang::Sema::handleDelayedAvailabilityCheck().

◆ getForbiddenTypeArgument()

unsigned clang::sema::DelayedDiagnostic::getForbiddenTypeArgument ( ) const
inline

Definition at line 213 of file DelayedDiagnostic.h.

References ForbiddenType, ForbiddenTypeData, and Kind.

Referenced by handleDelayedForbiddenType().

◆ getForbiddenTypeDiagnostic()

unsigned clang::sema::DelayedDiagnostic::getForbiddenTypeDiagnostic ( ) const
inline

The diagnostic ID to emit.

Used like so: Diag(diag.Loc, diag.getForbiddenTypeDiagnostic()) << diag.getForbiddenTypeOperand() << diag.getForbiddenTypeArgument();

Definition at line 208 of file DelayedDiagnostic.h.

References ForbiddenType, ForbiddenTypeData, and Kind.

Referenced by handleDelayedForbiddenType(), and isForbiddenTypeAllowed().

◆ getForbiddenTypeOperand()

QualType clang::sema::DelayedDiagnostic::getForbiddenTypeOperand ( ) const
inline

◆ getObjCProperty()

const ObjCPropertyDecl * clang::sema::DelayedDiagnostic::getObjCProperty ( ) const
inline

Definition at line 227 of file DelayedDiagnostic.h.

References AvailabilityData.

Referenced by clang::Sema::handleDelayedAvailabilityCheck().

◆ getObjCPropertyAccess()

bool clang::sema::DelayedDiagnostic::getObjCPropertyAccess ( ) const
inline

Definition at line 231 of file DelayedDiagnostic.h.

References AvailabilityData.

◆ getUnknownObjCClass()

const ObjCInterfaceDecl * clang::sema::DelayedDiagnostic::getUnknownObjCClass ( ) const
inline

Definition at line 223 of file DelayedDiagnostic.h.

References AvailabilityData.

Referenced by clang::Sema::handleDelayedAvailabilityCheck().

◆ makeAccess()

static DelayedDiagnostic clang::sema::DelayedDiagnostic::makeAccess ( SourceLocation  Loc,
const AccessedEntity Entity 
)
inlinestatic

Definition at line 146 of file DelayedDiagnostic.h.

References Access, getAccessData(), Kind, Loc, and Triggered.

Referenced by CheckAccess().

◆ makeAvailability()

DelayedDiagnostic DelayedDiagnostic::makeAvailability ( AvailabilityResult  AR,
ArrayRef< SourceLocation Locs,
const NamedDecl ReferringDecl,
const NamedDecl OffendingDecl,
const ObjCInterfaceDecl UnknownObjCClass,
const ObjCPropertyDecl ObjCProperty,
StringRef  Msg,
bool  ObjCPropertyAccess 
)
static

Definition at line 24 of file DelayedDiagnostic.cpp.

References Availability, AvailabilityData, Kind, Loc, memcpy(), and Triggered.

Referenced by EmitAvailabilityWarning().

◆ makeForbiddenType()

static DelayedDiagnostic clang::sema::DelayedDiagnostic::makeForbiddenType ( SourceLocation  loc,
unsigned  diagnostic,
QualType  type,
unsigned  argument 
)
inlinestatic

Member Data Documentation

◆ AccessData

char clang::sema::DelayedDiagnostic::AccessData[sizeof(AccessedEntity)]

Access control.

Definition at line 260 of file DelayedDiagnostic.h.

Referenced by getAccessData().

◆ AvailabilityData

struct AD clang::sema::DelayedDiagnostic::AvailabilityData

◆ ForbiddenTypeData

struct FTD clang::sema::DelayedDiagnostic::ForbiddenTypeData

◆ Kind

DDKind clang::sema::DelayedDiagnostic::Kind

◆ Loc

SourceLocation clang::sema::DelayedDiagnostic::Loc

◆ Triggered

bool clang::sema::DelayedDiagnostic::Triggered

The documentation for this class was generated from the following files: