clang
13.0.0git
|
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DelayedDiagnostic.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/Sema.h"
Go to the source code of this file.
Functions | |
static const AvailabilityAttr * | getAttrForPlatform (ASTContext &Context, const Decl *D) |
static std::pair< AvailabilityResult, const NamedDecl * > | ShouldDiagnoseAvailabilityOfDecl (Sema &S, const NamedDecl *D, std::string *Message, ObjCInterfaceDecl *ClassReceiver) |
The diagnostic we should emit for D , and the declaration that originated it, or AR_Available . More... | |
static bool | ShouldDiagnoseAvailabilityInContext (Sema &S, AvailabilityResult K, VersionTuple DeclVersion, Decl *Ctx, const NamedDecl *OffendingDecl) |
whether we should emit a diagnostic for K and DeclVersion in the context of Ctx . More... | |
static bool | shouldDiagnoseAvailabilityByDefault (const ASTContext &Context, const VersionTuple &DeploymentVersion, const VersionTuple &DeclVersion) |
static NamedDecl * | findEnclosingDeclToAnnotate (Decl *OrigCtx) |
static Optional< unsigned > | tryParseObjCMethodName (StringRef Name, SmallVectorImpl< StringRef > &SlotNames, const LangOptions &LangOpts) |
Tries to parse a string as ObjC method name. More... | |
static Optional< AttributeInsertion > | createAttributeInsertion (const NamedDecl *D, const SourceManager &SM, const LangOptions &LangOpts) |
Returns a source location in which it's appropriate to insert a new attribute for the given declaration \D. More... | |
static void | DoEmitAvailabilityWarning (Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) |
Actually emit an availability diagnostic for a reference to an unavailable decl. More... | |
static void | EmitAvailabilityWarning (Sema &S, AvailabilityResult AR, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) |
|
static |
Returns a source location in which it's appropriate to insert a new attribute for the given declaration \D.
Definition at line 280 of file SemaAvailability.cpp.
References clang::Lexer::getLocForEndOfToken(), clang::SourceLocation::isInvalid(), and SM.
|
static |
Actually emit an availability diagnostic for a reference to an unavailable decl.
Ctx | The context that the reference occurred in |
ReferringDecl | The exact declaration that was referenced. |
OffendingDecl | A related decl to ReferringDecl that has an availability attribute corresponding to K attached to it. Note that this may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl and OffendingDecl is the EnumDecl. |
Definition at line 310 of file SemaAvailability.cpp.
Referenced by clang::Sema::handleDelayedAvailabilityCheck().
|
static |
Definition at line 554 of file SemaAvailability.cpp.
Referenced by clang::Sema::DiagnoseAvailabilityOfDecl().
Definition at line 203 of file SemaAvailability.cpp.
|
static |
Definition at line 26 of file SemaAvailability.cpp.
References clang::Decl::attrs(), clang::ASTContext::getLangOpts(), clang::TargetInfo::getPlatformName(), and clang::ASTContext::getTargetInfo().
|
static |
Definition at line 178 of file SemaAvailability.cpp.
References clang::ASTContext::getTargetInfo(), and clang::TargetInfo::getTriple().
|
static |
whether we should emit a diagnostic for K
and DeclVersion
in the context of Ctx
.
For example, we should emit an unavailable diagnostic in a deprecated context, but not the other way around.
Definition at line 120 of file SemaAvailability.cpp.
|
static |
The diagnostic we should emit for D
, and the declaration that originated it, or AR_Available
.
D | The declaration to check. |
Message | If non-null, this will be populated with the message from the availability attribute that is selected. |
ClassReceiver | If we're checking the the method of a class message send, the class. Otherwise nullptr. |
Definition at line 63 of file SemaAvailability.cpp.
Referenced by clang::Sema::DiagnoseAvailabilityOfDecl().
|
static |
Tries to parse a string as ObjC method name.
Name | The string to parse. Expected to originate from availability attribute argument. |
SlotNames | The vector that will be populated with slot names. In case of unsuccessful parsing can contain invalid data. |
Definition at line 247 of file SemaAvailability.cpp.