clang
19.0.0git
|
#include "clang/APINotes/APINotesReader.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclObjC.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/Lexer.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaObjC.h"
#include "clang/Basic/AttrList.inc"
Go to the source code of this file.
Macros | |
#define | ATTR(X) |
Functions | |
static bool | isIndirectPointerType (QualType Type) |
Determine whether this is a multi-level pointer type. More... | |
static void | applyNullability (Sema &S, Decl *D, NullabilityKind Nullability, VersionedInfoMetadata Metadata) |
Apply nullability to the given declaration. More... | |
static StringRef | ASTAllocateString (ASTContext &Ctx, StringRef String) |
Copy a string into ASTContext-allocated memory. More... | |
static AttributeCommonInfo | getPlaceholderAttrInfo () |
template<typename A > | |
static void | handleAPINotedRetainCountAttribute (Sema &S, Decl *D, bool ShouldAddAttribute, VersionedInfoMetadata Metadata) |
static void | handleAPINotedRetainCountConvention (Sema &S, Decl *D, VersionedInfoMetadata Metadata, std::optional< api_notes::RetainCountConventionKind > Convention) |
static void | ProcessAPINotes (Sema &S, Decl *D, const api_notes::CommonEntityInfo &Info, VersionedInfoMetadata Metadata) |
static void | ProcessAPINotes (Sema &S, Decl *D, const api_notes::CommonTypeInfo &Info, VersionedInfoMetadata Metadata) |
static bool | checkAPINotesReplacementType (Sema &S, SourceLocation Loc, QualType OrigType, QualType ReplacementType) |
Check that the replacement type provided by API notes is reasonable. More... | |
static void | ProcessAPINotes (Sema &S, Decl *D, const api_notes::VariableInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for a variable or property. More... | |
static void | ProcessAPINotes (Sema &S, ParmVarDecl *D, const api_notes::ParamInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for a parameter. More... | |
static void | ProcessAPINotes (Sema &S, VarDecl *D, const api_notes::GlobalVariableInfo &Info, VersionedInfoMetadata metadata) |
Process API notes for a global variable. More... | |
static void | ProcessAPINotes (Sema &S, ObjCPropertyDecl *D, const api_notes::ObjCPropertyInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for an Objective-C property. More... | |
static void | ProcessAPINotes (Sema &S, FunctionOrMethod AnyFunc, const api_notes::FunctionInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for a function or method. More... | |
static void | ProcessAPINotes (Sema &S, FunctionDecl *D, const api_notes::GlobalFunctionInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for a global function. More... | |
static void | ProcessAPINotes (Sema &S, EnumConstantDecl *D, const api_notes::EnumConstantInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for an enumerator. More... | |
static void | ProcessAPINotes (Sema &S, ObjCMethodDecl *D, const api_notes::ObjCMethodInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for an Objective-C method. More... | |
static void | ProcessAPINotes (Sema &S, TagDecl *D, const api_notes::TagInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for a tag. More... | |
static void | ProcessAPINotes (Sema &S, TypedefNameDecl *D, const api_notes::TypedefInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for a typedef. More... | |
static void | ProcessAPINotes (Sema &S, ObjCContainerDecl *D, const api_notes::ObjCContextInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for an Objective-C class or protocol. More... | |
static void | ProcessAPINotes (Sema &S, ObjCInterfaceDecl *D, const api_notes::ObjCContextInfo &Info, VersionedInfoMetadata Metadata) |
Process API notes for an Objective-C class. More... | |
template<typename SpecificInfo > | |
static void | maybeAttachUnversionedSwiftName (Sema &S, Decl *D, const api_notes::APINotesReader::VersionedInfo< SpecificInfo > Info) |
If we're applying API notes with an active, non-default version, and the versioned API notes have a SwiftName but the declaration normally wouldn't have one, add a removal attribute to make it clear that the new SwiftName attribute only applies to the active version of D , not to all versions. More... | |
template<typename SpecificDecl , typename SpecificInfo > | |
static void | ProcessVersionedAPINotes (Sema &S, SpecificDecl *D, const api_notes::APINotesReader::VersionedInfo< SpecificInfo > Info) |
Processes all versions of versioned API notes. More... | |
#define ATTR | ( | X | ) |
Definition at line 128 of file SemaAPINotes.cpp.
|
static |
Apply nullability to the given declaration.
Definition at line 51 of file SemaAPINotes.cpp.
|
static |
Copy a string into ASTContext-allocated memory.
Definition at line 111 of file SemaAPINotes.cpp.
References clang::ASTContext::Allocate(), and memcpy().
|
static |
Check that the replacement type provided by API notes is reasonable.
This is a very weak form of ABI check.
Definition at line 347 of file SemaAPINotes.cpp.
|
static |
Definition at line 117 of file SemaAPINotes.cpp.
References clang::AttributeCommonInfo::AS_GNU, and clang::AttributeCommonInfo::UnknownAttribute.
|
static |
Definition at line 195 of file SemaAPINotes.cpp.
|
static |
Definition at line 214 of file SemaAPINotes.cpp.
Determine whether this is a multi-level pointer type.
Definition at line 41 of file SemaAPINotes.cpp.
References clang::Type::getPointeeType(), clang::Type::isAnyPointerType(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), and clang::Type::isObjCObjectPointerType().
|
static |
If we're applying API notes with an active, non-default version, and the versioned API notes have a SwiftName but the declaration normally wouldn't have one, add a removal attribute to make it clear that the new SwiftName attribute only applies to the active version of D
, not to all versions.
This must be run before processing API notes for D
, because otherwise any existing SwiftName attribute will have been packaged up in a SwiftVersionedAdditionAttr.
Definition at line 716 of file SemaAPINotes.cpp.
|
static |
Definition at line 248 of file SemaAPINotes.cpp.
|
static |
Definition at line 317 of file SemaAPINotes.cpp.
|
static |
Process API notes for a variable or property.
Definition at line 361 of file SemaAPINotes.cpp.
|
static |
Process API notes for an enumerator.
Definition at line 557 of file SemaAPINotes.cpp.
|
static |
Process API notes for a global function.
Definition at line 548 of file SemaAPINotes.cpp.
|
static |
Process API notes for a function or method.
Definition at line 456 of file SemaAPINotes.cpp.
|
static |
Process API notes for an Objective-C class or protocol.
Definition at line 674 of file SemaAPINotes.cpp.
|
static |
Process API notes for an Objective-C class.
Definition at line 683 of file SemaAPINotes.cpp.
|
static |
Process API notes for an Objective-C method.
Definition at line 566 of file SemaAPINotes.cpp.
|
static |
Process API notes for an Objective-C property.
Definition at line 435 of file SemaAPINotes.cpp.
|
static |
Process API notes for a parameter.
Definition at line 407 of file SemaAPINotes.cpp.
|
static |
Process API notes for a tag.
Definition at line 587 of file SemaAPINotes.cpp.
|
static |
Process API notes for a typedef.
Definition at line 637 of file SemaAPINotes.cpp.
|
static |
Process API notes for a global variable.
Definition at line 426 of file SemaAPINotes.cpp.
|
static |
Processes all versions of versioned API notes.
Just dispatches to the various ProcessAPINotes functions in this file.
Definition at line 754 of file SemaAPINotes.cpp.