clang
10.0.0git
|
#include "clang/Sema/SemaInternal.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Initialization.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallString.h"
Go to the source code of this file.
Functions | |
static Qualifiers::ObjCLifetime | getImpliedARCOwnership (ObjCPropertyDecl::PropertyAttributeKind attrs, QualType type) |
getImpliedARCOwnership - Given a set of property attributes and a type, infer an expected lifetime. More... | |
static void | checkPropertyDeclWithOwnership (Sema &S, ObjCPropertyDecl *property) |
Check the internal consistency of a property declaration with an explicit ownership qualifier. More... | |
static void | CheckPropertyAgainstProtocol (Sema &S, ObjCPropertyDecl *Prop, ObjCProtocolDecl *Proto, llvm::SmallPtrSetImpl< ObjCProtocolDecl *> &Known) |
Check this Objective-C property against a property declared in the given protocol. More... | |
static unsigned | deducePropertyOwnershipFromType (Sema &S, QualType T) |
static unsigned | getOwnershipRule (unsigned attr) |
static ObjCPropertyDecl::PropertyAttributeKind | makePropertyAttributesAsWritten (unsigned Attributes) |
static bool | LocPropertyAttribute (ASTContext &Context, const char *attrName, SourceLocation LParenLoc, SourceLocation &Loc) |
static void | checkAtomicPropertyMismatch (Sema &S, ObjCPropertyDecl *OldProperty, ObjCPropertyDecl *NewProperty, bool PropagateAtomicity) |
Check for a mismatch in the atomicity of the given properties. More... | |
static void | checkARCPropertyImpl (Sema &S, SourceLocation propertyImplLoc, ObjCPropertyDecl *property, ObjCIvarDecl *ivar) |
static void | setImpliedPropertyAttributeForReadOnlyProperty (ObjCPropertyDecl *property, ObjCIvarDecl *ivar) |
setImpliedPropertyAttributeForReadOnlyProperty - This routine evaludates life-time attributes for a 'readonly' property with no known lifetime of its own, using backing 'ivar's attribute, if any. More... | |
static bool | isIncompatiblePropertyAttribute (unsigned Attr1, unsigned Attr2, ObjCPropertyDecl::PropertyAttributeKind Kind) |
static bool | areIncompatiblePropertyAttributes (unsigned Attr1, unsigned Attr2, unsigned Kinds) |
static ObjCPropertyDecl * | SelectPropertyForSynthesisFromProtocols (Sema &S, SourceLocation AtLoc, ObjCInterfaceDecl *ClassDecl, ObjCPropertyDecl *Property) |
SelectPropertyForSynthesisFromProtocols - Finds the most appropriate property declaration that should be synthesised in all of the inherited protocols. More... | |
static bool | hasWrittenStorageAttribute (ObjCPropertyDecl *Prop, ObjCPropertyQueryKind QueryKind) |
Determine whether any storage attributes were written on the property. More... | |
static ObjCMethodDecl * | RedeclarePropertyAccessor (ASTContext &Context, ObjCImplementationDecl *Impl, ObjCMethodDecl *AccessorDecl, SourceLocation AtLoc, SourceLocation PropertyLoc) |
Create a synthesized property accessor stub inside the @implementation. More... | |
static void | CollectImmediateProperties (ObjCContainerDecl *CDecl, ObjCContainerDecl::PropertyMap &PropMap, ObjCContainerDecl::PropertyMap &SuperPropMap, bool CollectClassPropsOnly=false, bool IncludeProtocols=true) |
CollectImmediateProperties - This routine collects all properties in the class and its conforming protocols; but not those in its super class. More... | |
static void | CollectSuperClassPropertyImplementations (ObjCInterfaceDecl *CDecl, ObjCInterfaceDecl::PropertyMap &PropMap) |
CollectSuperClassPropertyImplementations - This routine collects list of properties to be implemented in super class(s) and also coming from their conforming protocols. More... | |
static bool | SuperClassImplementsProperty (ObjCInterfaceDecl *IDecl, ObjCPropertyDecl *Prop) |
static void | DiagnoseUnimplementedAccessor (Sema &S, ObjCInterfaceDecl *PrimaryClass, Selector Method, ObjCImplDecl *IMPDecl, ObjCContainerDecl *CDecl, ObjCCategoryDecl *C, ObjCPropertyDecl *Prop, llvm::SmallPtrSet< const ObjCMethodDecl *, 8 > &SMap) |
static void | AddPropertyAttrs (Sema &S, ObjCMethodDecl *PropertyMethod, ObjCPropertyDecl *Property) |
AddPropertyAttrs - Propagates attributes from a property to the implicitly-declared getter or setter for that property. More... | |
Variables | |
static const unsigned | OwnershipMask |
|
static |
AddPropertyAttrs - Propagates attributes from a property to the implicitly-declared getter or setter for that property.
Definition at line 2375 of file SemaObjCProperty.cpp.
Referenced by clang::Sema::ProcessPropertyDecl().
|
static |
Definition at line 836 of file SemaObjCProperty.cpp.
|
static |
Definition at line 728 of file SemaObjCProperty.cpp.
|
static |
Check for a mismatch in the atomicity of the given properties.
Definition at line 345 of file SemaObjCProperty.cpp.
Referenced by clang::Sema::DiagnosePropertyMismatch().
|
static |
Check this Objective-C property against a property declared in the given protocol.
Definition at line 109 of file SemaObjCProperty.cpp.
|
static |
Check the internal consistency of a property declaration with an explicit ownership qualifier.
Definition at line 65 of file SemaObjCProperty.cpp.
|
static |
CollectImmediateProperties - This routine collects all properties in the class and its conforming protocols; but not those in its super class.
Definition at line 1765 of file SemaObjCProperty.cpp.
References clang::NamedDecl::getIdentifier().
|
static |
CollectSuperClassPropertyImplementations - This routine collects list of properties to be implemented in super class(s) and also coming from their conforming protocols.
Definition at line 1832 of file SemaObjCProperty.cpp.
References clang::ObjCInterfaceDecl::getSuperClass().
Definition at line 130 of file SemaObjCProperty.cpp.
|
static |
Definition at line 2005 of file SemaObjCProperty.cpp.
|
static |
getImpliedARCOwnership - Given a set of property attributes and a type, infer an expected lifetime.
The type's ownership qualification is not considered.
Returns OCL_None if the attributes as stated do not imply an ownership. Never returns OCL_Autoreleasing.
Definition at line 38 of file SemaObjCProperty.cpp.
References clang::Type::isObjCRetainableType(), clang::ObjCPropertyDecl::OBJC_PR_assign, clang::ObjCPropertyDecl::OBJC_PR_copy, clang::ObjCPropertyDecl::OBJC_PR_retain, clang::ObjCPropertyDecl::OBJC_PR_strong, clang::ObjCPropertyDecl::OBJC_PR_unsafe_unretained, clang::ObjCPropertyDecl::OBJC_PR_weak, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, and clang::Qualifiers::OCL_Weak.
Referenced by setImpliedPropertyAttributeForReadOnlyProperty().
|
static |
Definition at line 163 of file SemaObjCProperty.cpp.
References clang::ObjCPropertyDecl::OBJC_PR_assign, clang::ObjCPropertyDecl::OBJC_PR_unsafe_unretained, and OwnershipMask.
Referenced by clang::Sema::CheckObjCPropertyAttributes(), and clang::Sema::DiagnosePropertyMismatch().
|
static |
Determine whether any storage attributes were written on the property.
Definition at line 1022 of file SemaObjCProperty.cpp.
References Category, clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::NamedDecl::getIdentifier(), clang::ObjCPropertyDecl::getPropertyAttributesAsWritten(), clang::ObjCPropertyDecl::isReadOnly(), and OwnershipMask.
|
static |
Definition at line 831 of file SemaObjCProperty.cpp.
|
static |
Definition at line 315 of file SemaObjCProperty.cpp.
References clang::SourceManager::getBufferData(), clang::SourceManager::getDecomposedLoc(), clang::ASTContext::getLangOpts(), clang::SourceManager::getLocForStartOfFile(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isMacroID(), SM, and clang::format::Tok.
|
static |
Definition at line 281 of file SemaObjCProperty.cpp.
References clang::ObjCDeclSpec::DQ_PR_assign, clang::ObjCDeclSpec::DQ_PR_atomic, clang::ObjCDeclSpec::DQ_PR_class, clang::ObjCDeclSpec::DQ_PR_copy, clang::ObjCDeclSpec::DQ_PR_direct, clang::ObjCDeclSpec::DQ_PR_getter, clang::ObjCDeclSpec::DQ_PR_nonatomic, clang::ObjCDeclSpec::DQ_PR_readonly, clang::ObjCDeclSpec::DQ_PR_readwrite, clang::ObjCDeclSpec::DQ_PR_retain, clang::ObjCDeclSpec::DQ_PR_setter, clang::ObjCDeclSpec::DQ_PR_strong, clang::ObjCDeclSpec::DQ_PR_unsafe_unretained, clang::ObjCDeclSpec::DQ_PR_weak, clang::ObjCPropertyDecl::OBJC_PR_assign, clang::ObjCPropertyDecl::OBJC_PR_atomic, clang::ObjCPropertyDecl::OBJC_PR_class, clang::ObjCPropertyDecl::OBJC_PR_copy, clang::ObjCPropertyDecl::OBJC_PR_direct, clang::ObjCPropertyDecl::OBJC_PR_getter, clang::ObjCPropertyDecl::OBJC_PR_nonatomic, clang::ObjCPropertyDecl::OBJC_PR_readonly, clang::ObjCPropertyDecl::OBJC_PR_readwrite, clang::ObjCPropertyDecl::OBJC_PR_retain, clang::ObjCPropertyDecl::OBJC_PR_setter, clang::ObjCPropertyDecl::OBJC_PR_strong, clang::ObjCPropertyDecl::OBJC_PR_unsafe_unretained, and clang::ObjCPropertyDecl::OBJC_PR_weak.
|
static |
Create a synthesized property accessor stub inside the @implementation.
Definition at line 1056 of file SemaObjCProperty.cpp.
References clang::ObjCMethodDecl::Create(), clang::Decl::getAttrs(), clang::ObjCMethodDecl::getBeginLoc(), clang::ObjCMethodDecl::getCmdDecl(), clang::ObjCMethodDecl::getEndLoc(), clang::ObjCMethodDecl::getImplementationControl(), clang::ObjCMethodDecl::getMethodFamily(), clang::ObjCMethodDecl::getReturnType(), clang::ObjCMethodDecl::getReturnTypeSourceInfo(), clang::ObjCMethodDecl::getSelector(), clang::ObjCMethodDecl::getSelectorLocs(), clang::ObjCMethodDecl::getSelfDecl(), clang::Decl::hasAttrs(), clang::ObjCMethodDecl::hasRelatedResultType(), clang::ObjCMethodDecl::isDefined(), clang::Decl::isImplicit(), clang::ObjCMethodDecl::isInstanceMethod(), clang::ObjCMethodDecl::isPropertyAccessor(), clang::SourceLocation::isValid(), clang::ObjCMethodDecl::isVariadic(), clang::ObjCMethodDecl::parameters(), clang::Decl::setAttrs(), clang::ObjCMethodDecl::setCmdDecl(), clang::ObjCMethodDecl::setDefined(), clang::Decl::setLexicalDeclContext(), clang::ObjCMethodDecl::setMethodParams(), and clang::ObjCMethodDecl::setSelfDecl().
|
static |
SelectPropertyForSynthesisFromProtocols - Finds the most appropriate property declaration that should be synthesised in all of the inherited protocols.
It also diagnoses properties declared in inherited protocols with mismatched types or attributes, since any of them can be candidate for synthesis.
Definition at line 847 of file SemaObjCProperty.cpp.
|
static |
setImpliedPropertyAttributeForReadOnlyProperty - This routine evaludates life-time attributes for a 'readonly' property with no known lifetime of its own, using backing 'ivar's attribute, if any.
If no backing 'ivar', property's life-time is assumed 'strong'.
Definition at line 808 of file SemaObjCProperty.cpp.
References getImpliedARCOwnership(), clang::QualType::getObjCLifetime(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ValueDecl::getType(), clang::ObjCPropertyDecl::OBJC_PR_strong, clang::ObjCPropertyDecl::OBJC_PR_weak, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, and clang::Qualifiers::OCL_Weak.
|
static |
Definition at line 1875 of file SemaObjCProperty.cpp.
References clang::ObjCPropertyDecl::getGetterName(), clang::ObjCContainerDecl::getInstanceMethod(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCPropertyDecl::getSetterName(), clang::ObjCInterfaceDecl::getSuperClass(), and clang::ObjCPropertyDecl::OBJC_PR_readonly.
|
static |
Definition at line 155 of file SemaObjCProperty.cpp.
Referenced by getOwnershipRule(), and hasWrittenStorageAttribute().