clang API Documentation
#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/Sema/Initialization.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallString.h"
Go to the source code of this file.
static void AddPropertyAttrs | ( | Sema & | S, |
ObjCMethodDecl * | PropertyMethod, | ||
ObjCPropertyDecl * | Property | ||
) | [static] |
AddPropertyAttrs - Propagates attributes from a property to the implicitly-declared getter or setter for that property.
Definition at line 1891 of file SemaObjCProperty.cpp.
References clang::Decl::addAttr(), clang::Decl::attrs(), and clang::Sema::Context.
Referenced by clang::Sema::ProcessPropertyDecl().
static void checkARCPropertyDecl | ( | Sema & | S, |
ObjCPropertyDecl * | property | ||
) | [static] |
Check the internal consistency of a property declaration.
Definition at line 64 of file SemaObjCProperty.cpp.
References clang::Sema::Diag(), clang::NamedDecl::getDeclName(), getImpliedARCOwnership(), clang::Decl::getLocation(), clang::ObjCPropertyDecl::getType(), clang::Decl::isInvalidDecl(), 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 clang::Sema::ActOnProperty().
static void checkARCPropertyImpl | ( | Sema & | S, |
SourceLocation | propertyImplLoc, | ||
ObjCPropertyDecl * | property, | ||
ObjCIvarDecl * | ivar | ||
) | [static] |
Definition at line 642 of file SemaObjCProperty.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::ObjCIvarDecl::getAccessControl(), clang::NamedDecl::getDeclName(), getImpliedARCOwnership(), clang::Decl::getLocation(), clang::QualType::getObjCLifetime(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ASTContext::getQualifiedType(), clang::ValueDecl::getType(), clang::Qualifiers::hasObjCLifetime(), clang::Decl::isInvalidDecl(), clang::Type::isObjCARCImplicitlyUnretainedType(), clang::SourceLocation::isValid(), clang::ObjCPropertyDecl::OBJC_PR_assign, clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::ObjCIvarDecl::Private, clang::SplitQualType::Quals, clang::Qualifiers::setObjCLifetime(), clang::ValueDecl::setType(), and clang::QualType::split().
Referenced by clang::Sema::ActOnPropertyImplDecl().
static void CheckPropertyAgainstProtocol | ( | Sema & | S, |
ObjCPropertyDecl * | Prop, | ||
ObjCProtocolDecl * | Proto, | ||
llvm::SmallPtrSetImpl< ObjCProtocolDecl * > & | Known | ||
) | [static] |
Check this Objective-C property against a property declared in the given protocol.
Definition at line 117 of file SemaObjCProperty.cpp.
References clang::Sema::DiagnosePropertyMismatch(), clang::NamedDecl::getDeclName(), clang::NamedDecl::getIdentifier(), clang::DeclContext::lookup(), P, and clang::ObjCProtocolDecl::protocols().
Referenced by clang::Sema::ActOnProperty().
static void CollectImmediateProperties | ( | ObjCContainerDecl * | CDecl, |
ObjCContainerDecl::PropertyMap & | PropMap, | ||
ObjCContainerDecl::PropertyMap & | SuperPropMap, | ||
bool | IncludeProtocols = true |
||
) | [static] |
CollectImmediateProperties - This routine collects all properties in the class and its conforming protocols; but not those in its super class.
Definition at line 1421 of file SemaObjCProperty.cpp.
References clang::NamedDecl::getIdentifier().
Referenced by clang::Sema::DiagnoseUnimplementedProperties().
static void CollectSuperClassPropertyImplementations | ( | ObjCInterfaceDecl * | CDecl, |
ObjCInterfaceDecl::PropertyMap & | PropMap | ||
) | [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 1466 of file SemaObjCProperty.cpp.
References clang::ObjCInterfaceDecl::getSuperClass().
Referenced by clang::Sema::DefaultSynthesizeProperties(), and clang::Sema::DiagnoseUnimplementedProperties().
static unsigned deduceWeakPropertyFromType | ( | Sema & | S, |
QualType | T | ||
) | [static] |
Definition at line 105 of file SemaObjCProperty.cpp.
References clang::ObjCDeclSpec::DQ_PR_weak, clang::Sema::getLangOpts(), clang::QualType::getObjCLifetime(), clang::QualType::isObjCGCWeak(), clang::LangOptions::NonGC, and clang::Qualifiers::OCL_Weak.
Referenced by clang::Sema::ActOnProperty(), and clang::Sema::HandlePropertyInClassExtension().
static void DiagnosePropertyMismatchDeclInProtocols | ( | Sema & | S, |
SourceLocation | AtLoc, | ||
ObjCInterfaceDecl * | ClassDecl, | ||
ObjCPropertyDecl * | Property | ||
) | [static] |
DiagnosePropertyMismatchDeclInProtocols - diagnose properties declared in inherited protocols with mismatched types. Since any of them can be candidate for synthesis.
Definition at line 747 of file SemaObjCProperty.cpp.
References clang::ObjCInterfaceDecl::all_referenced_protocols(), clang::Sema::Context, clang::Sema::Diag(), clang::ASTContext::getCanonicalType(), clang::ObjCProtocolDecl::getDefinition(), clang::Decl::getLocation(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ObjCPropertyDecl::getType(), clang::Sema::isObjCPointerConversion(), clang::SourceLocation::isValid(), and clang::ASTContext::propertyTypesAreCompatible().
Referenced by clang::Sema::ActOnPropertyImplDecl().
static void DiagnoseUnimplementedAccessor | ( | Sema & | S, |
ObjCInterfaceDecl * | PrimaryClass, | ||
Selector | Method, | ||
ObjCImplDecl * | IMPDecl, | ||
ObjCContainerDecl * | CDecl, | ||
ObjCCategoryDecl * | C, | ||
ObjCPropertyDecl * | Prop, | ||
Sema::SelectorSet & | SMap | ||
) | [static] |
Definition at line 1620 of file SemaObjCProperty.cpp.
References clang::Sema::Diag(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::ObjCRuntime::isNonFragile(), clang::Sema::LangOpts, clang::ObjCInterfaceDecl::lookupPropertyAccessor(), and clang::LangOptions::ObjCRuntime.
Referenced by clang::Sema::DiagnoseUnimplementedProperties().
static Qualifiers::ObjCLifetime getImpliedARCOwnership | ( | ObjCPropertyDecl::PropertyAttributeKind | attrs, |
QualType | type | ||
) | [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 clang::Sema::ActOnPropertyImplDecl(), checkARCPropertyDecl(), checkARCPropertyImpl(), and setImpliedPropertyAttributeForReadOnlyProperty().
static unsigned getOwnershipRule | ( | unsigned | attr | ) | [static] |
Definition at line 304 of file SemaObjCProperty.cpp.
References 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, and clang::ObjCPropertyDecl::OBJC_PR_weak.
Referenced by clang::Sema::CheckObjCPropertyAttributes(), clang::Sema::DiagnosePropertyMismatch(), and clang::Sema::HandlePropertyInClassExtension().
static bool LocPropertyAttribute | ( | ASTContext & | Context, |
const char * | attrName, | ||
SourceLocation | LParenLoc, | ||
SourceLocation & | Loc | ||
) | [static] |
Definition at line 274 of file SemaObjCProperty.cpp.
References clang::SourceManager::getBufferData(), clang::SourceManager::getDecomposedLoc(), clang::ASTContext::getLangOpts(), clang::SourceManager::getLocForStartOfFile(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isMacroID(), and SM.
Referenced by clang::Sema::ActOnPropertyImplDecl().
static ObjCPropertyDecl::PropertyAttributeKind makePropertyAttributesAsWritten | ( | unsigned | Attributes | ) | [static] |
Definition at line 244 of file SemaObjCProperty.cpp.
References clang::ObjCDeclSpec::DQ_PR_assign, clang::ObjCDeclSpec::DQ_PR_atomic, clang::ObjCDeclSpec::DQ_PR_copy, 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_copy, 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.
Referenced by clang::Sema::CreatePropertyDecl(), and clang::Sema::HandlePropertyInClassExtension().
static void setImpliedPropertyAttributeForReadOnlyProperty | ( | ObjCPropertyDecl * | property, |
ObjCIvarDecl * | ivar | ||
) | [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 720 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.
Referenced by clang::Sema::ActOnPropertyImplDecl().
static bool SuperClassImplementsProperty | ( | ObjCInterfaceDecl * | IDecl, |
ObjCPropertyDecl * | Prop | ||
) | [static] |
Definition at line 1501 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.
Referenced by clang::Sema::DefaultSynthesizeProperties().