21#ifndef LLVM_CLANG_SEMA_DELAYEDDIAGNOSTIC_H
22#define LLVM_CLANG_SEMA_DELAYEDDIAGNOSTIC_H
33#include "llvm/ADT/ArrayRef.h"
34#include "llvm/ADT/SmallVector.h"
35#include "llvm/ADT/StringRef.h"
36#include "llvm/Support/Casting.h"
43class ObjCInterfaceDecl;
44class ObjCPropertyDecl;
64 Target(FoundDecl.getDecl()), NamingClass(NamingClass),
65 BaseObjectType(BaseObjectType), Diag(0, Allocator) {}
70 : Access(Access), IsMember(
false),
Target(BaseClass),
71 NamingClass(DerivedClass), Diag(0, Allocator) {}
85 assert(!IsMember);
return cast<CXXRecordDecl>(
Target);
100 assert(
isQuiet() &&
"partial diagnostic already defined");
104 assert(
isQuiet() &&
"partial diagnostic already defined");
105 assert(DiagID &&
"creating null diagnostic");
116 LLVM_PREFERRED_TYPE(
bool)
117 unsigned IsMember : 1;
144 bool ObjCPropertyAccess);
171 assert(
Kind ==
Access &&
"Not an access diagnostic.");
175 assert(
Kind ==
Access &&
"Not an access diagnostic.");
244 size_t NumSelectorLocs;
246 bool ObjCPropertyAccess;
277 Other.Diagnostics.clear();
282 Diagnostics = std::move(
Other.Diagnostics);
283 Other.Diagnostics.clear();
289 i = Diagnostics.begin(), e = Diagnostics.end(); i != e; ++i)
297 return (Diagnostics.empty() && (!
Parent ||
Parent->empty()));
302 Diagnostics.push_back(diag);
307 if (pool.Diagnostics.empty())
return;
309 if (Diagnostics.empty()) {
310 Diagnostics = std::move(pool.Diagnostics);
314 pool.Diagnostics.clear();
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
llvm::MachO::Target Target
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
Represents a C++ struct/union/class.
A POD class for pairing a NamedDecl* with an access specifier.
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
This represents a decl that may have a name.
Represents an ObjC class declaration.
Represents one property declaration in an Objective-C interface.
unsigned getDiagID() const
void Reset(unsigned DiagID=0)
Clear out this partial diagnostic, giving it a new diagnostic ID and removing all of its arguments,...
A (possibly-)qualified type.
static QualType getFromOpaquePtr(const void *Ptr)
bool shouldDelayDiagnostics()
Determines whether diagnostics should be delayed.
void add(const sema::DelayedDiagnostic &diag)
Adds a delayed diagnostic.
Encodes a location in the source.
An allocator for DiagnosticStorage objects, which uses a small cache to objects, used to reduce mallo...
A declaration being accessed, together with information about how it was accessed.
PartialDiagnostic & setDiag(unsigned DiagID)
void setDiag(const PartialDiagnostic &PDiag)
Sets a diagnostic to be performed.
CXXRecordDecl * getNamingClass() const
BaseNonce
A hierarchy (base-to-derived or derived-to-base) conversion.
AccessedEntity(PartialDiagnostic::DiagStorageAllocator &Allocator, MemberNonce _, CXXRecordDecl *NamingClass, DeclAccessPair FoundDecl, QualType BaseObjectType)
CXXRecordDecl * getBaseClass() const
const PartialDiagnostic & getDiag() const
CXXRecordDecl * getDerivedClass() const
NamedDecl * getTargetDecl() const
AccessedEntity(PartialDiagnostic::DiagStorageAllocator &Allocator, BaseNonce _, CXXRecordDecl *BaseClass, CXXRecordDecl *DerivedClass, AccessSpecifier Access)
QualType getBaseObjectType() const
Retrieves the base object type, important when accessing an instance member.
bool isMemberAccess() const
AccessSpecifier getAccess() const
MemberNonce
A member declaration found through lookup.
A collection of diagnostics which were delayed.
const DelayedDiagnosticPool * getParent() const
DelayedDiagnosticPool(DelayedDiagnosticPool &&Other)
void steal(DelayedDiagnosticPool &pool)
Steal the diagnostics from the given pool.
DelayedDiagnosticPool(const DelayedDiagnosticPool &)=delete
void add(const DelayedDiagnostic &diag)
Add a diagnostic to this pool.
DelayedDiagnosticPool & operator=(DelayedDiagnosticPool &&Other)
bool empty() const
Does this pool, or any of its ancestors, contain any diagnostics?
pool_iterator pool_end() const
SmallVectorImpl< DelayedDiagnostic >::const_iterator pool_iterator
pool_iterator pool_begin() const
DelayedDiagnosticPool(const DelayedDiagnosticPool *parent)
DelayedDiagnosticPool & operator=(const DelayedDiagnosticPool &)=delete
A diagnostic message which has been conditionally emitted pending the complete parsing of the current...
bool getObjCPropertyAccess() const
static DelayedDiagnostic makeAvailability(AvailabilityResult AR, ArrayRef< SourceLocation > Locs, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, StringRef Msg, bool ObjCPropertyAccess)
QualType getForbiddenTypeOperand() const
const ObjCInterfaceDecl * getUnknownObjCClass() const
AccessedEntity & getAccessData()
static DelayedDiagnostic makeForbiddenType(SourceLocation loc, unsigned diagnostic, QualType type, unsigned argument)
const NamedDecl * getAvailabilityOffendingDecl() const
static DelayedDiagnostic makeAccess(SourceLocation Loc, const AccessedEntity &Entity)
unsigned getForbiddenTypeDiagnostic() const
The diagnostic ID to emit.
struct AD AvailabilityData
char AccessData[sizeof(AccessedEntity)]
Access control.
const ObjCPropertyDecl * getObjCProperty() const
StringRef getAvailabilityMessage() const
struct FTD ForbiddenTypeData
ArrayRef< SourceLocation > getAvailabilitySelectorLocs() const
AvailabilityResult getAvailabilityResult() const
const NamedDecl * getAvailabilityReferringDecl() const
unsigned getForbiddenTypeArgument() const
const AccessedEntity & getAccessData() const
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
The JSON file list parser is used to communicate input to InstallAPI.
AvailabilityResult
Captures the result of checking the availability of a declaration.
@ Other
Other implicit parameter.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...