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;
131 bool ObjCPropertyAccess);
159 assert(
Kind ==
Access &&
"Not an access diagnostic.");
163 assert(
Kind ==
Access &&
"Not an access diagnostic.");
169 "Not a deprecation diagnostic.");
175 "Not a deprecation diagnostic.");
219 bool ObjCPropertyAccess;
249 i = Diagnostics.begin(), e = Diagnostics.end(); i != e; ++i)
254 : Parent(Other.Parent), Diagnostics(std::move(Other.Diagnostics)) {
255 Other.Diagnostics.clear();
258 Parent = Other.Parent;
259 Diagnostics = std::move(Other.Diagnostics);
260 Other.Diagnostics.clear();
268 return (Diagnostics.empty() && (!Parent || Parent->
empty()));
273 Diagnostics.push_back(diag);
278 if (pool.Diagnostics.empty())
return;
280 if (Diagnostics.empty()) {
281 Diagnostics = std::move(pool.Diagnostics);
285 pool.Diagnostics.clear();
DelayedDiagnosticPool(const DelayedDiagnosticPool *parent)
DelayedDiagnosticPool(DelayedDiagnosticPool &&Other)
A (possibly-)qualified type.
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.
const PartialDiagnostic & getDiag() const
CXXRecordDecl * getNamingClass() const
struct DD DeprecationData
Deprecation.
static DelayedDiagnostic makeAvailability(Sema::AvailabilityDiagnostic AD, SourceLocation Loc, const NamedDecl *D, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, StringRef Msg, bool ObjCPropertyAccess)
bool empty() const
Does this pool, or any of its ancestors, contain any diagnostics?
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)
Encodes a location in the source.
MemberNonce
A member declaration found through lookup.
const ObjCInterfaceDecl * getUnknownObjCClass() const
const NamedDecl * getDeprecationDecl() const
bool shouldDelayDiagnostics()
Determines whether diagnostics should be delayed.
PartialDiagnostic & setDiag(unsigned DiagID)
StringRef getDeprecationMessage() const
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.
static DelayedDiagnostic makeAccess(SourceLocation Loc, const AccessedEntity &Entity)
SmallVectorImpl< DelayedDiagnostic >::const_iterator pool_iterator