22 #ifndef LLVM_CLANG_SEMA_DELAYEDDIAGNOSTIC_H
23 #define LLVM_CLANG_SEMA_DELAYEDDIAGNOSTIC_H
50 Target(FoundDecl.getDecl()), NamingClass(NamingClass),
51 BaseObjectType(BaseObjectType), Diag(0, Allocator) {
59 : Access(Access), IsMember(
false),
61 NamingClass(DerivedClass),
75 assert(!IsMember);
return cast<CXXRecordDecl>(Target);
90 assert(
isQuiet() &&
"partial diagnostic already defined");
94 assert(
isQuiet() &&
"partial diagnostic already defined");
95 assert(DiagID &&
"creating null diagnostic");
105 unsigned IsMember : 1;
132 bool ObjCPropertyAccess);
160 assert(
Kind ==
Access &&
"Not an access diagnostic.");
164 assert(
Kind ==
Access &&
"Not an access diagnostic.");
228 bool ObjCPropertyAccess;
257 i = Diagnostics.begin(), e = Diagnostics.end(); i != e; ++i)
262 : Parent(Other.Parent), Diagnostics(std::move(Other.Diagnostics)) {
263 Other.Diagnostics.clear();
266 Parent = Other.Parent;
267 Diagnostics = std::move(Other.Diagnostics);
268 Other.Diagnostics.clear();
276 return (Diagnostics.empty() && (!Parent || Parent->
empty()));
281 Diagnostics.push_back(diag);
286 if (pool.Diagnostics.empty())
return;
288 if (Diagnostics.empty()) {
289 Diagnostics = std::move(pool.Diagnostics);
293 pool.Diagnostics.clear();
DelayedDiagnosticPool(const DelayedDiagnosticPool *parent)
DelayedDiagnosticPool(DelayedDiagnosticPool &&Other)
A (possibly-)qualified type.
const NamedDecl * getAvailabilityOffendingDecl() const
const NamedDecl * getAvailabilityReferringDecl() const
static DelayedDiagnostic makeAvailability(AvailabilityResult AR, SourceLocation Loc, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, StringRef Msg, bool ObjCPropertyAccess)
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
void * getAsOpaquePtr() const
CXXRecordDecl * getDerivedClass() const
char AccessData[sizeof(AccessedEntity)]
Access control.
AccessedEntity & getAccessData()
void add(const DelayedDiagnostic &diag)
Add a diagnostic to this pool.
CXXRecordDecl * getBaseClass() const
void Reset(unsigned DiagID=0)
Clear out this partial diagnostic, giving it a new diagnostic ID and removing all of its arguments...
unsigned getDiagID() const
const DelayedDiagnosticPool * getParent() const
QualType getForbiddenTypeOperand() const
void steal(DelayedDiagnosticPool &pool)
Steal the diagnostics from the given pool.
pool_iterator pool_end() const
Represents an ObjC class declaration.
AvailabilityResult
Captures the result of checking the availability of a declaration.
const PartialDiagnostic & getDiag() const
CXXRecordDecl * getNamingClass() const
bool empty() const
Does this pool, or any of its ancestors, contain any diagnostics?
struct AD AvailabilityData
A declaration being accessed, together with information about how it was accessed.
static DelayedDiagnostic makeForbiddenType(SourceLocation loc, unsigned diagnostic, QualType type, unsigned argument)
An allocator for Storage objects, which uses a small cache to objects, used to reduce malloc()/free()...
unsigned getForbiddenTypeDiagnostic() const
The diagnostic ID to emit.
AccessedEntity(PartialDiagnostic::StorageAllocator &Allocator, BaseNonce _, CXXRecordDecl *BaseClass, CXXRecordDecl *DerivedClass, AccessSpecifier Access)
AvailabilityResult getAvailabilityResult() const
Encodes a location in the source.
MemberNonce
A member declaration found through lookup.
const ObjCInterfaceDecl * getUnknownObjCClass() const
bool shouldDelayDiagnostics()
Determines whether diagnostics should be delayed.
PartialDiagnostic & setDiag(unsigned DiagID)
Represents one property declaration in an Objective-C interface.
unsigned getForbiddenTypeArgument() const
DelayedDiagnosticPool & operator=(DelayedDiagnosticPool &&Other)
static QualType getFromOpaquePtr(const void *Ptr)
BaseNonce
A hierarchy (base-to-derived or derived-to-base) conversion.
bool isMemberAccess() const
A POD class for pairing a NamedDecl* with an access specifier.
const AccessedEntity & getAccessData() const
pool_iterator pool_begin() const
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
void setDiag(const PartialDiagnostic &PDiag)
Sets a diagnostic to be performed.
void add(const sema::DelayedDiagnostic &diag)
Adds a delayed diagnostic.
struct FTD ForbiddenTypeData
AccessedEntity(PartialDiagnostic::StorageAllocator &Allocator, MemberNonce _, CXXRecordDecl *NamingClass, DeclAccessPair FoundDecl, QualType BaseObjectType)
const ObjCPropertyDecl * getObjCProperty() const
AccessSpecifier getAccess() const
Represents a C++ struct/union/class.
A diagnostic message which has been conditionally emitted pending the complete parsing of the current...
NamedDecl * getTargetDecl() const
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
A collection of diagnostics which were delayed.
NamedDecl - This represents a decl with a name.
bool getObjCPropertyAccess() const
QualType getBaseObjectType() const
Retrieves the base object type, important when accessing an instance member.
StringRef getAvailabilityMessage() const
static DelayedDiagnostic makeAccess(SourceLocation Loc, const AccessedEntity &Entity)
SmallVectorImpl< DelayedDiagnostic >::const_iterator pool_iterator