clang 22.0.0git
clang::SemaObjC Class Reference

#include "clang/Sema/SemaObjC.h"

Inheritance diagram for clang::SemaObjC:
[legend]

Classes

struct  ObjCArgInfo

Public Types

enum  ObjCSubscriptKind { OS_Array , OS_Dictionary , OS_Error }

Public Member Functions

 SemaObjC (Sema &S)
ExprResult CheckObjCForCollectionOperand (SourceLocation forLoc, Expr *collection)
StmtResult ActOnObjCForCollectionStmt (SourceLocation ForColLoc, Stmt *First, Expr *collection, SourceLocation RParenLoc)
StmtResult FinishObjCForCollectionStmt (Stmt *ForCollection, Stmt *Body)
 FinishObjCForCollectionStmt - Attach the body to a objective-C foreach statement.
StmtResult ActOnObjCAtCatchStmt (SourceLocation AtLoc, SourceLocation RParen, Decl *Parm, Stmt *Body)
StmtResult ActOnObjCAtFinallyStmt (SourceLocation AtLoc, Stmt *Body)
StmtResult ActOnObjCAtTryStmt (SourceLocation AtLoc, Stmt *Try, MultiStmtArg Catch, Stmt *Finally)
StmtResult BuildObjCAtThrowStmt (SourceLocation AtLoc, Expr *Throw)
StmtResult ActOnObjCAtThrowStmt (SourceLocation AtLoc, Expr *Throw, Scope *CurScope)
ExprResult ActOnObjCAtSynchronizedOperand (SourceLocation atLoc, Expr *operand)
StmtResult ActOnObjCAtSynchronizedStmt (SourceLocation AtLoc, Expr *SynchExpr, Stmt *SynchBody)
StmtResult ActOnObjCAutoreleasePoolStmt (SourceLocation AtLoc, Stmt *Body)
TypeResult actOnObjCProtocolQualifierType (SourceLocation lAngleLoc, ArrayRef< Decl * > protocols, ArrayRef< SourceLocation > protocolLocs, SourceLocation rAngleLoc)
 Build a an Objective-C protocol-qualified 'id' type where no base type was specified.
TypeResult actOnObjCTypeArgsAndProtocolQualifiers (Scope *S, SourceLocation Loc, ParsedType BaseType, SourceLocation TypeArgsLAngleLoc, ArrayRef< ParsedType > TypeArgs, SourceLocation TypeArgsRAngleLoc, SourceLocation ProtocolLAngleLoc, ArrayRef< Decl * > Protocols, ArrayRef< SourceLocation > ProtocolLocs, SourceLocation ProtocolRAngleLoc)
 Build a specialized and/or protocol-qualified Objective-C type.
QualType BuildObjCTypeParamType (const ObjCTypeParamDecl *Decl, SourceLocation ProtocolLAngleLoc, ArrayRef< ObjCProtocolDecl * > Protocols, ArrayRef< SourceLocation > ProtocolLocs, SourceLocation ProtocolRAngleLoc, bool FailOnError=false)
 Build an Objective-C type parameter type.
QualType BuildObjCObjectType (QualType BaseType, SourceLocation Loc, SourceLocation TypeArgsLAngleLoc, ArrayRef< TypeSourceInfo * > TypeArgs, SourceLocation TypeArgsRAngleLoc, SourceLocation ProtocolLAngleLoc, ArrayRef< ObjCProtocolDecl * > Protocols, ArrayRef< SourceLocation > ProtocolLocs, SourceLocation ProtocolRAngleLoc, bool FailOnError, bool Rebuilding)
 Build an Objective-C object pointer type.
ParsedType ActOnObjCInstanceType (SourceLocation Loc)
 The parser has parsed the context-sensitive type 'instancetype' in an Objective-C message declaration.
void checkRetainCycles (ObjCMessageExpr *msg)
 checkRetainCycles - Check whether an Objective-C message send might create an obvious retain cycle.
void checkRetainCycles (Expr *receiver, Expr *argument)
 Check a property assign to see if it's likely to cause a retain cycle.
void checkRetainCycles (VarDecl *Var, Expr *Init)
bool CheckObjCString (Expr *Arg)
 CheckObjCString - Checks that the argument to the builtin CFString constructor is correct Note: It might also make sense to do the UTF-16 conversion here (would simplify the backend).
bool CheckObjCMethodCall (ObjCMethodDecl *Method, SourceLocation loc, ArrayRef< const Expr * > Args)
void CheckObjCCircularContainer (ObjCMessageExpr *Message)
 Check whether receiver is mutable ObjC container which attempts to add itself into the container.
void ActOnObjCContainerStartDefinition (ObjCContainerDecl *IDecl)
void ActOnObjCContainerFinishDefinition ()
void ActOnObjCTemporaryExitContainerContext (ObjCContainerDecl *ObjCCtx)
 Invoked when we must temporarily exit the objective-c container scope for parsing/looking-up C constructs.
void ActOnObjCReenterContainerContext (ObjCContainerDecl *ObjCCtx)
const DeclContextgetCurObjCLexicalContext () const
ObjCProtocolDeclLookupProtocol (IdentifierInfo *II, SourceLocation IdLoc, RedeclarationKind Redecl=RedeclarationKind::NotForRedeclaration)
 Find the protocol with the given name, if any.
bool isObjCWritebackConversion (QualType FromType, QualType ToType, QualType &ConvertedType)
 Determine whether this is an Objective-C writeback conversion, used for parameter passing when performing automatic reference counting.
ObjCSubscriptKind CheckSubscriptingKind (Expr *FromE)
 CheckSubscriptingKind - This routine decide what type of indexing represented by "FromE" is being done.
void AddCFAuditedAttribute (Decl *D)
 AddCFAuditedAttribute - Check whether we're currently within '#pragma clang arc_cf_code_audited' and, if so, consider adding the appropriate attribute.
bool isCFError (RecordDecl *D)
IdentifierInfogetNSErrorIdent ()
 Retrieve the identifier "NSError".
bool GetFormatNSStringIdx (const FormatAttr *Format, unsigned &Idx)
void DiagnoseCStringFormatDirectiveInCFAPI (const NamedDecl *FDecl, Expr **Args, unsigned NumArgs)
 Diagnose use of s directive in an NSString which is being passed as formatting string to formatting method.
bool isSignedCharBool (QualType Ty)
void adornBoolConversionDiagWithTernaryFixit (const Expr *SourceExpr, const Sema::SemaDiagnosticBuilder &Builder)
void checkDictionaryLiteral (QualType TargetType, ObjCDictionaryLiteral *DictionaryLiteral)
 Check an Objective-C dictionary literal being converted to the given target type.
void checkArrayLiteral (QualType TargetType, ObjCArrayLiteral *ArrayLiteral)
 Check an Objective-C array literal being converted to the given target type.
ObjC @property and @synthesize

Implementations are in SemaObjCProperty.cpp

void CheckObjCPropertyAttributes (Decl *PropertyPtrTy, SourceLocation Loc, unsigned &Attributes, bool propertyInPrimaryClass)
 Ensure attributes are consistent with type.
void ProcessPropertyDecl (ObjCPropertyDecl *property)
 Process the specified property declaration and create decls for the setters and getters as needed.
DeclActOnProperty (Scope *S, SourceLocation AtLoc, SourceLocation LParenLoc, FieldDeclarator &FD, ObjCDeclSpec &ODS, Selector GetterSel, Selector SetterSel, tok::ObjCKeywordKind MethodImplKind, DeclContext *lexicalDC=nullptr)
DeclActOnPropertyImplDecl (Scope *S, SourceLocation AtLoc, SourceLocation PropertyLoc, bool ImplKind, IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar, SourceLocation PropertyIvarLoc, ObjCPropertyQueryKind QueryKind)
 ActOnPropertyImplDecl - This routine performs semantic checks and builds the AST node for a property implementation declaration; declared as @synthesize or @dynamic.
ObjCPropertyDeclHandlePropertyInClassExtension (Scope *S, SourceLocation AtLoc, SourceLocation LParenLoc, FieldDeclarator &FD, Selector GetterSel, SourceLocation GetterNameLoc, Selector SetterSel, SourceLocation SetterNameLoc, const bool isReadWrite, unsigned &Attributes, const unsigned AttributesAsWritten, QualType T, TypeSourceInfo *TSI, tok::ObjCKeywordKind MethodImplKind)
 Called by ActOnProperty to handle @property declarations in class extensions.
ObjCPropertyDeclCreatePropertyDecl (Scope *S, ObjCContainerDecl *CDecl, SourceLocation AtLoc, SourceLocation LParenLoc, FieldDeclarator &FD, Selector GetterSel, SourceLocation GetterNameLoc, Selector SetterSel, SourceLocation SetterNameLoc, const bool isReadWrite, const unsigned Attributes, const unsigned AttributesAsWritten, QualType T, TypeSourceInfo *TSI, tok::ObjCKeywordKind MethodImplKind, DeclContext *lexicalDC=nullptr)
 Called by ActOnProperty and HandlePropertyInClassExtension to handle creating the ObjcPropertyDecl for a category or @interface.
void DiagnosePropertyMismatch (ObjCPropertyDecl *Property, ObjCPropertyDecl *SuperProperty, const IdentifierInfo *Name, bool OverridingProtocolProperty)
 DiagnosePropertyMismatch - Compares two properties for their attributes and types and warns on a variety of inconsistencies.
bool DiagnosePropertyAccessorMismatch (ObjCPropertyDecl *PD, ObjCMethodDecl *Getter, SourceLocation Loc)
void DiagnoseUnimplementedProperties (Scope *S, ObjCImplDecl *IMPDecl, ObjCContainerDecl *CDecl, bool SynthesizeProperties)
 DiagnoseUnimplementedProperties - This routine warns on those properties which must be implemented by this implementation.
void diagnoseNullResettableSynthesizedSetters (const ObjCImplDecl *impDecl)
 Diagnose any null-resettable synthesized setters.
void DefaultSynthesizeProperties (Scope *S, ObjCImplDecl *IMPDecl, ObjCInterfaceDecl *IDecl, SourceLocation AtEnd)
 DefaultSynthesizeProperties - This routine default synthesizes all properties which must be synthesized in the class's @implementation.
void DefaultSynthesizeProperties (Scope *S, Decl *D, SourceLocation AtEnd)
bool IvarBacksCurrentMethodAccessor (ObjCInterfaceDecl *IFace, ObjCMethodDecl *Method, ObjCIvarDecl *IV)
 IvarBacksCurrentMethodAccessor - This routine returns 'true' if 'IV' is an ivar synthesized for 'Method' and 'Method' is a property accessor declared in class 'IFace'.
void DiagnoseOwningPropertyGetterSynthesis (const ObjCImplementationDecl *D)
void DiagnoseMissingDesignatedInitOverrides (const ObjCImplementationDecl *ImplD, const ObjCInterfaceDecl *IFD)
void AtomicPropertySetterGetterRules (ObjCImplDecl *IMPDecl, ObjCInterfaceDecl *IDecl)
 AtomicPropertySetterGetterRules - This routine enforces the rule (via warning) when atomic property has one but not the other user-declared setter or getter.
ObjC Attributes

Implementations are in SemaObjC.cpp

bool isNSStringType (QualType T, bool AllowNSAttributedString=false)
bool isCFStringType (QualType T)
void handleIBOutlet (Decl *D, const ParsedAttr &AL)
void handleIBOutletCollection (Decl *D, const ParsedAttr &AL)
void handleSuppresProtocolAttr (Decl *D, const ParsedAttr &AL)
void handleDirectAttr (Decl *D, const ParsedAttr &AL)
void handleDirectMembersAttr (Decl *D, const ParsedAttr &AL)
void handleMethodFamilyAttr (Decl *D, const ParsedAttr &AL)
void handleNSObject (Decl *D, const ParsedAttr &AL)
void handleIndependentClass (Decl *D, const ParsedAttr &AL)
void handleBlocksAttr (Decl *D, const ParsedAttr &AL)
void handleReturnsInnerPointerAttr (Decl *D, const ParsedAttr &Attrs)
void handleXReturnsXRetainedAttr (Decl *D, const ParsedAttr &AL)
void handleRequiresSuperAttr (Decl *D, const ParsedAttr &Attrs)
void handleNSErrorDomain (Decl *D, const ParsedAttr &Attr)
void handleBridgeAttr (Decl *D, const ParsedAttr &AL)
void handleBridgeMutableAttr (Decl *D, const ParsedAttr &AL)
void handleBridgeRelatedAttr (Decl *D, const ParsedAttr &AL)
void handleDesignatedInitializer (Decl *D, const ParsedAttr &AL)
void handleRuntimeName (Decl *D, const ParsedAttr &AL)
void handleBoxable (Decl *D, const ParsedAttr &AL)
void handleOwnershipAttr (Decl *D, const ParsedAttr &AL)
void handlePreciseLifetimeAttr (Decl *D, const ParsedAttr &AL)
void handleExternallyRetainedAttr (Decl *D, const ParsedAttr &AL)
void AddXConsumedAttr (Decl *D, const AttributeCommonInfo &CI, Sema::RetainOwnershipKind K, bool IsTemplateInstantiation)
bool isValidOSObjectOutParameter (const Decl *D)
bool checkNSReturnsRetainedReturnType (SourceLocation loc, QualType type)
Sema::RetainOwnershipKind parsedAttrToRetainOwnershipKind (const ParsedAttr &AL)
Public Member Functions inherited from clang::SemaBase
 SemaBase (Sema &S)
ASTContextgetASTContext () const
DiagnosticsEnginegetDiagnostics () const
const LangOptionsgetLangOpts () const
DeclContextgetCurContext () const
SemaDiagnosticBuilder Diag (SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
 Emit a diagnostic.
SemaDiagnosticBuilder Diag (SourceLocation Loc, const PartialDiagnostic &PD, bool DeferHint=false)
 Emit a partial diagnostic.
SemaDiagnosticBuilder DiagCompat (SourceLocation Loc, unsigned CompatDiagId, bool DeferHint=false)
 Emit a compatibility diagnostic.
PartialDiagnostic PDiag (unsigned DiagID=0)
 Build a partial diagnostic.

Public Attributes

RecordDeclCFError = nullptr
 The struct behind the CFErrorRef pointer.
Public Attributes inherited from clang::SemaBase
SemaSemaRef

ObjC Declarations

Implementations are in SemaDeclObjC.cpp

enum  ObjCSpecialMethodKind {
  OSMK_None , OSMK_Alloc , OSMK_New , OSMK_Copy ,
  OSMK_RetainingInit , OSMK_NonRetainingInit
}
enum  MethodMatchStrategy { MMS_loose , MMS_strict }
enum  ObjCContainerKind {
  OCK_None = -1 , OCK_Interface = 0 , OCK_Protocol , OCK_Category ,
  OCK_ClassExtension , OCK_Implementation , OCK_CategoryImplementation
}
enum  ResultTypeCompatibilityKind { RTC_Compatible , RTC_Incompatible , RTC_Unknown }
 Describes the compatibility of a result type with its method. More...
using GlobalMethodPool
typedef llvm::SmallPtrSet< Selector, 8 > SelectorSet
using DeclGroupPtrTy = OpaquePtr<DeclGroupRef>
llvm::MapVector< Selector, SourceLocationReferencedSelectors
 Method selectors used in a @selector expression.
GlobalMethodPool MethodPool
 Method Pool - allows efficient lookup when typechecking messages to "id".
ObjCContainerKind getObjCContainerKind () const
DeclResult actOnObjCTypeParam (Scope *S, ObjCTypeParamVariance variance, SourceLocation varianceLoc, unsigned index, IdentifierInfo *paramName, SourceLocation paramLoc, SourceLocation colonLoc, ParsedType typeBound)
ObjCTypeParamListactOnObjCTypeParamList (Scope *S, SourceLocation lAngleLoc, ArrayRef< Decl * > typeParams, SourceLocation rAngleLoc)
void popObjCTypeParamList (Scope *S, ObjCTypeParamList *typeParamList)
ObjCInterfaceDeclActOnStartClassInterface (Scope *S, SourceLocation AtInterfaceLoc, IdentifierInfo *ClassName, SourceLocation ClassLoc, ObjCTypeParamList *typeParamList, IdentifierInfo *SuperName, SourceLocation SuperLoc, ArrayRef< ParsedType > SuperTypeArgs, SourceRange SuperTypeArgsRange, Decl *const *ProtoRefs, unsigned NumProtoRefs, const SourceLocation *ProtoLocs, SourceLocation EndProtoLoc, const ParsedAttributesView &AttrList, SkipBodyInfo *SkipBody)
void ActOnSuperClassOfClassInterface (Scope *S, SourceLocation AtInterfaceLoc, ObjCInterfaceDecl *IDecl, IdentifierInfo *ClassName, SourceLocation ClassLoc, IdentifierInfo *SuperName, SourceLocation SuperLoc, ArrayRef< ParsedType > SuperTypeArgs, SourceRange SuperTypeArgsRange)
void ActOnTypedefedProtocols (SmallVectorImpl< Decl * > &ProtocolRefs, SmallVectorImpl< SourceLocation > &ProtocolLocs, IdentifierInfo *SuperName, SourceLocation SuperLoc)
 ActOnTypedefedProtocols - this action finds protocol list as part of the typedef'ed use for a qualified super class and adds them to the list of the protocols.
DeclActOnCompatibilityAlias (SourceLocation AtCompatibilityAliasLoc, IdentifierInfo *AliasName, SourceLocation AliasLocation, IdentifierInfo *ClassName, SourceLocation ClassLocation)
 ActOnCompatibilityAlias - this action is called after complete parsing of a @compatibility_alias declaration.
bool CheckForwardProtocolDeclarationForCircularDependency (IdentifierInfo *PName, SourceLocation &PLoc, SourceLocation PrevLoc, const ObjCList< ObjCProtocolDecl > &PList)
ObjCProtocolDeclActOnStartProtocolInterface (SourceLocation AtProtoInterfaceLoc, IdentifierInfo *ProtocolName, SourceLocation ProtocolLoc, Decl *const *ProtoRefNames, unsigned NumProtoRefs, const SourceLocation *ProtoLocs, SourceLocation EndProtoLoc, const ParsedAttributesView &AttrList, SkipBodyInfo *SkipBody)
ObjCCategoryDeclActOnStartCategoryInterface (SourceLocation AtInterfaceLoc, const IdentifierInfo *ClassName, SourceLocation ClassLoc, ObjCTypeParamList *typeParamList, const IdentifierInfo *CategoryName, SourceLocation CategoryLoc, Decl *const *ProtoRefs, unsigned NumProtoRefs, const SourceLocation *ProtoLocs, SourceLocation EndProtoLoc, const ParsedAttributesView &AttrList)
ObjCImplementationDeclActOnStartClassImplementation (SourceLocation AtClassImplLoc, const IdentifierInfo *ClassName, SourceLocation ClassLoc, const IdentifierInfo *SuperClassname, SourceLocation SuperClassLoc, const ParsedAttributesView &AttrList)
ObjCCategoryImplDeclActOnStartCategoryImplementation (SourceLocation AtCatImplLoc, const IdentifierInfo *ClassName, SourceLocation ClassLoc, const IdentifierInfo *CatName, SourceLocation CatLoc, const ParsedAttributesView &AttrList)
 ActOnStartCategoryImplementation - Perform semantic checks on the category implementation declaration and build an ObjCCategoryImplDecl object.
DeclGroupPtrTy ActOnFinishObjCImplementation (Decl *ObjCImpDecl, ArrayRef< Decl * > Decls)
DeclGroupPtrTy ActOnForwardProtocolDeclaration (SourceLocation AtProtoclLoc, ArrayRef< IdentifierLoc > IdentList, const ParsedAttributesView &attrList)
 ActOnForwardProtocolDeclaration - Handle @protocol foo;.
void FindProtocolDeclaration (bool WarnOnDeclarations, bool ForObjCContainer, ArrayRef< IdentifierLoc > ProtocolId, SmallVectorImpl< Decl * > &Protocols)
 FindProtocolDeclaration - This routine looks up protocols and issues an error if they are not declared.
void DiagnoseTypeArgsAndProtocols (IdentifierInfo *ProtocolId, SourceLocation ProtocolLoc, IdentifierInfo *TypeArgId, SourceLocation TypeArgLoc, bool SelectProtocolFirst=false)
void actOnObjCTypeArgsOrProtocolQualifiers (Scope *S, ParsedType baseType, SourceLocation lAngleLoc, ArrayRef< IdentifierInfo * > identifiers, ArrayRef< SourceLocation > identifierLocs, SourceLocation rAngleLoc, SourceLocation &typeArgsLAngleLoc, SmallVectorImpl< ParsedType > &typeArgs, SourceLocation &typeArgsRAngleLoc, SourceLocation &protocolLAngleLoc, SmallVectorImpl< Decl * > &protocols, SourceLocation &protocolRAngleLoc, bool warnOnIncompleteProtocols)
 Given a list of identifiers (and their locations), resolve the names to either Objective-C protocol qualifiers or type arguments, as appropriate.
void DiagnoseClassExtensionDupMethods (ObjCCategoryDecl *CAT, ObjCInterfaceDecl *ID)
 DiagnoseClassExtensionDupMethods - Check for duplicate declaration of a class method in its extension.
DeclActOnAtEnd (Scope *S, SourceRange AtEnd, ArrayRef< Decl * > allMethods={}, ArrayRef< DeclGroupPtrTy > allTUVars={})
ParmVarDeclActOnMethodParmDeclaration (Scope *S, ObjCArgInfo &ArgInfo, int ParamIndex, bool MethodDefinition)
DeclActOnMethodDeclaration (Scope *S, SourceLocation BeginLoc, SourceLocation EndLoc, tok::TokenKind MethodType, ObjCDeclSpec &ReturnQT, ParsedType ReturnType, ArrayRef< SourceLocation > SelectorLocs, Selector Sel, ParmVarDecl **ArgInfo, DeclaratorChunk::ParamInfo *CParamInfo, unsigned CNumArgs, const ParsedAttributesView &AttrList, tok::ObjCKeywordKind MethodImplKind, bool isVariadic, bool MethodDefinition)
bool CheckARCMethodDecl (ObjCMethodDecl *method)
 Check a method declaration for compatibility with the Objective-C ARC conventions.
bool checkInitMethod (ObjCMethodDecl *method, QualType receiverTypeIfCall)
 Check whether the given method, which must be in the 'init' family, is a valid member of that family.
void CheckObjCMethodOverride (ObjCMethodDecl *NewMethod, const ObjCMethodDecl *Overridden)
 Check whether the given new method is a valid override of the given overridden method, and set any properties that should be inherited.
void CheckObjCMethodDirectOverrides (ObjCMethodDecl *method, ObjCMethodDecl *overridden)
void CheckObjCMethodOverrides (ObjCMethodDecl *ObjCMethod, ObjCInterfaceDecl *CurrentClass, ResultTypeCompatibilityKind RTC)
void AddAnyMethodToGlobalPool (Decl *D)
 AddAnyMethodToGlobalPool - Add any method, instance or factory to global pool.
void ActOnStartOfObjCMethodDef (Scope *S, Decl *D)
 ActOnStartOfObjCMethodDef - This routine sets up parameters; invisible and user declared, in the method definition's AST.
bool isObjCMethodDecl (Decl *D)
void CheckImplementationIvars (ObjCImplementationDecl *ImpDecl, ObjCIvarDecl **Fields, unsigned nIvars, SourceLocation Loc)
 CheckImplementationIvars - This routine checks if the instance variables listed in the implelementation match those listed in the interface.
void WarnConflictingTypedMethods (ObjCMethodDecl *Method, ObjCMethodDecl *MethodDecl, bool IsProtocolMethodDecl)
void CheckConflictingOverridingMethod (ObjCMethodDecl *Method, ObjCMethodDecl *Overridden, bool IsProtocolMethodDecl)
void WarnExactTypedMethods (ObjCMethodDecl *Method, ObjCMethodDecl *MethodDecl, bool IsProtocolMethodDecl)
 WarnExactTypedMethods - This routine issues a warning if method implementation declaration matches exactly that of its declaration.
void MatchAllMethodDeclarations (const SelectorSet &InsMap, const SelectorSet &ClsMap, SelectorSet &InsMapSeen, SelectorSet &ClsMapSeen, ObjCImplDecl *IMPDecl, ObjCContainerDecl *IDecl, bool &IncompleteImpl, bool ImmediateClass, bool WarnCategoryMethodImpl=false)
 MatchAllMethodDeclarations - Check methods declaraed in interface or or protocol against those declared in their implementations.
void CheckCategoryVsClassMethodMatches (ObjCCategoryImplDecl *CatIMP)
 CheckCategoryVsClassMethodMatches - Checks that methods implemented in category matches with those implemented in its primary class and warns each time an exact match is found.
void ImplMethodsVsClassMethods (Scope *S, ObjCImplDecl *IMPDecl, ObjCContainerDecl *IDecl, bool IncompleteImpl=false)
 ImplMethodsVsClassMethods - This is main routine to warn if any method remains unimplemented in the class or category @implementation.
DeclGroupPtrTy ActOnForwardClassDeclaration (SourceLocation Loc, IdentifierInfo **IdentList, SourceLocation *IdentLocs, ArrayRef< ObjCTypeParamList * > TypeParamLists, unsigned NumElts)
bool MatchTwoMethodDeclarations (const ObjCMethodDecl *Method, const ObjCMethodDecl *PrevMethod, MethodMatchStrategy strategy=MMS_strict)
 MatchTwoMethodDeclarations - Checks if two methods' type match and returns true, or false, accordingly.
void addMethodToGlobalList (ObjCMethodList *List, ObjCMethodDecl *Method)
 Add the given method to the list of globally-known methods.
void ReadMethodPool (Selector Sel)
 Read the contents of the method pool for a given selector from external storage.
void updateOutOfDateSelector (Selector Sel)
bool CollectMultipleMethodsInGlobalPool (Selector Sel, SmallVectorImpl< ObjCMethodDecl * > &Methods, bool InstanceFirst, bool CheckTheOther, const ObjCObjectType *TypeBound=nullptr)
 We first select the type of the method: Instance or Factory, then collect all methods with that type.
bool AreMultipleMethodsInGlobalPool (Selector Sel, ObjCMethodDecl *BestMethod, SourceRange R, bool receiverIdOrClass, SmallVectorImpl< ObjCMethodDecl * > &Methods)
void DiagnoseMultipleMethodInGlobalPool (SmallVectorImpl< ObjCMethodDecl * > &Methods, Selector Sel, SourceRange R, bool receiverIdOrClass)
const ObjCMethodDeclSelectorsForTypoCorrection (Selector Sel, QualType ObjectType=QualType())
ObjCMethodDeclLookupImplementedMethodInGlobalPool (Selector Sel)
 LookupImplementedMethodInGlobalPool - Returns the method which has an implementation.
void DiagnoseDuplicateIvars (ObjCInterfaceDecl *ID, ObjCInterfaceDecl *SID)
 DiagnoseDuplicateIvars - Check for duplicate ivars in the entire class at the start of @implementation.
bool CheckObjCDeclScope (Decl *D)
 Checks that the Objective-C declaration is declared in the global scope.
void ActOnDefs (Scope *S, Decl *TagD, SourceLocation DeclStart, const IdentifierInfo *ClassName, SmallVectorImpl< Decl * > &Decls)
 Called whenever @defs(ClassName) is encountered in the source.
VarDeclBuildObjCExceptionDecl (TypeSourceInfo *TInfo, QualType ExceptionType, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, bool Invalid=false)
 Build a type-check a new Objective-C exception variable declaration.
DeclActOnObjCExceptionDecl (Scope *S, Declarator &D)
void CollectIvarsToConstructOrDestruct (ObjCInterfaceDecl *OI, SmallVectorImpl< ObjCIvarDecl * > &Ivars)
 CollectIvarsToConstructOrDestruct - Collect those ivars which require initialization.
void DiagnoseUseOfUnimplementedSelectors ()
void DiagnoseUnusedBackingIvarInAccessor (Scope *S, const ObjCImplementationDecl *ImplD)
 DiagnoseUnusedBackingIvarInAccessor - Issue an 'unused' warning if ivar which backs the property is not used in the property's accessor.
ObjCIvarDeclGetIvarBackingPropertyAccessor (const ObjCMethodDecl *Method, const ObjCPropertyDecl *&PDecl) const
 GetIvarBackingPropertyAccessor - If method is a property setter/getter and it property has a backing ivar, returns this ivar; otherwise, returns NULL.
void AddInstanceMethodToGlobalPool (ObjCMethodDecl *Method, bool impl=false)
 AddInstanceMethodToGlobalPool - All instance methods in a translation unit are added to a global pool.
void AddFactoryMethodToGlobalPool (ObjCMethodDecl *Method, bool impl=false)
 AddFactoryMethodToGlobalPool - Same as above, but for factory methods.
QualType AdjustParameterTypeForObjCAutoRefCount (QualType T, SourceLocation NameLoc, TypeSourceInfo *TSInfo)
ObjCInterfaceDeclgetObjCInterfaceDecl (const IdentifierInfo *&Id, SourceLocation IdLoc, bool TypoCorrection=false)
 Look for an Objective-C class in the translation unit.
bool inferObjCARCLifetime (ValueDecl *decl)
void SetIvarInitializers (ObjCImplementationDecl *ObjCImplementation)
 SetIvarInitializers - This routine builds initialization ASTs for the Objective-C implementation whose ivars need be initialized.
DeclActOnIvar (Scope *S, SourceLocation DeclStart, Declarator &D, Expr *BitWidth, tok::ObjCKeywordKind visibility)
 ActOnIvar - Each ivar field of an objective-c class is passed into this in order to create an IvarDecl object for it.
ObjCContainerDeclgetObjCDeclContext () const

ObjC Expressions

Implementations are in SemaExprObjC.cpp

enum  ObjCMessageKind { ObjCSuperMessage , ObjCInstanceMessage , ObjCClassMessage }
 Describes the kind of message expression indicated by a message send that starts with an identifier. More...
enum  ARCConversionResult { ACR_okay , ACR_unbridged , ACR_error }
enum  ObjCLiteralKind {
  LK_Array , LK_Dictionary , LK_Numeric , LK_Boxed ,
  LK_String , LK_Block , LK_None
}
std::unique_ptr< NSAPINSAPIObj
 Caches identifiers/selectors for NSFoundation APIs.
ObjCInterfaceDeclNSNumberDecl
 The declaration of the Objective-C NSNumber class.
ObjCInterfaceDeclNSValueDecl
 The declaration of the Objective-C NSValue class.
QualType NSNumberPointer
 Pointer to NSNumber type (NSNumber *).
QualType NSValuePointer
 Pointer to NSValue type (NSValue *).
ObjCMethodDeclNSNumberLiteralMethods [NSAPI::NumNSNumberLiteralMethods]
 The Objective-C NSNumber methods used to create NSNumber literals.
ObjCInterfaceDeclNSStringDecl
 The declaration of the Objective-C NSString class.
QualType NSStringPointer
 Pointer to NSString type (NSString *).
ObjCMethodDeclStringWithUTF8StringMethod
 The declaration of the stringWithUTF8String: method.
ObjCMethodDeclValueWithBytesObjCTypeMethod
 The declaration of the valueWithBytes:objCType: method.
ObjCInterfaceDeclNSArrayDecl
 The declaration of the Objective-C NSArray class.
ObjCMethodDeclArrayWithObjectsMethod
 The declaration of the arrayWithObjects:count: method.
ObjCInterfaceDeclNSDictionaryDecl
 The declaration of the Objective-C NSDictionary class.
ObjCMethodDeclDictionaryWithObjectsMethod
 The declaration of the dictionaryWithObjects:forKeys:count: method.
QualType QIDNSCopying
 id<NSCopying> type.
Selector RespondsToSelectorSel
 will hold 'respondsToSelector:'
ExprResult HandleExprPropertyRefExpr (const ObjCObjectPointerType *OPT, Expr *BaseExpr, SourceLocation OpLoc, DeclarationName MemberName, SourceLocation MemberLoc, SourceLocation SuperLoc, QualType SuperType, bool Super)
 HandleExprPropertyRefExpr - Handle foo.bar where foo is a pointer to an objective C interface.
ExprResult ActOnClassPropertyRefExpr (const IdentifierInfo &receiverName, const IdentifierInfo &propertyName, SourceLocation receiverNameLoc, SourceLocation propertyNameLoc)
ExprResult ParseObjCStringLiteral (SourceLocation *AtLocs, ArrayRef< Expr * > Strings)
ExprResult BuildObjCStringLiteral (SourceLocation AtLoc, StringLiteral *S)
ExprResult BuildObjCNumericLiteral (SourceLocation AtLoc, Expr *Number)
 BuildObjCNumericLiteral - builds an ObjCBoxedExpr AST node for the numeric literal expression.
ExprResult ActOnObjCBoolLiteral (SourceLocation AtLoc, SourceLocation ValueLoc, bool Value)
ExprResult BuildObjCArrayLiteral (SourceRange SR, MultiExprArg Elements)
ExprResult BuildObjCBoxedExpr (SourceRange SR, Expr *ValueExpr)
 BuildObjCBoxedExpr - builds an ObjCBoxedExpr AST node for the '@' prefixed parenthesized expression.
ExprResult BuildObjCSubscriptExpression (SourceLocation RB, Expr *BaseExpr, Expr *IndexExpr, ObjCMethodDecl *getterMethod, ObjCMethodDecl *setterMethod)
 Build an ObjC subscript pseudo-object expression, given that that's supported by the runtime.
ExprResult BuildObjCDictionaryLiteral (SourceRange SR, MutableArrayRef< ObjCDictionaryElement > Elements)
ExprResult BuildObjCEncodeExpression (SourceLocation AtLoc, TypeSourceInfo *EncodedTypeInfo, SourceLocation RParenLoc)
ExprResult ParseObjCEncodeExpression (SourceLocation AtLoc, SourceLocation EncodeLoc, SourceLocation LParenLoc, ParsedType Ty, SourceLocation RParenLoc)
ExprResult ParseObjCSelectorExpression (Selector Sel, SourceLocation AtLoc, SourceLocation SelLoc, SourceLocation LParenLoc, SourceLocation RParenLoc, bool WarnMultipleSelectors)
 ParseObjCSelectorExpression - Build selector expression for @selector.
ExprResult ParseObjCProtocolExpression (IdentifierInfo *ProtocolName, SourceLocation AtLoc, SourceLocation ProtoLoc, SourceLocation LParenLoc, SourceLocation ProtoIdLoc, SourceLocation RParenLoc)
 ParseObjCProtocolExpression - Build protocol expression for @protocol.
ObjCMethodDecltryCaptureObjCSelf (SourceLocation Loc)
 Try to capture an implicit reference to 'self'.
ObjCMessageKind getObjCMessageKind (Scope *S, IdentifierInfo *Name, SourceLocation NameLoc, bool IsSuper, bool HasTrailingDot, ParsedType &ReceiverType)
ExprResult ActOnSuperMessage (Scope *S, SourceLocation SuperLoc, Selector Sel, SourceLocation LBracLoc, ArrayRef< SourceLocation > SelectorLocs, SourceLocation RBracLoc, MultiExprArg Args)
ExprResult BuildClassMessage (TypeSourceInfo *ReceiverTypeInfo, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef< SourceLocation > SelectorLocs, SourceLocation RBracLoc, MultiExprArg Args, bool isImplicit=false)
 Build an Objective-C class message expression.
ExprResult BuildClassMessageImplicit (QualType ReceiverType, bool isSuperReceiver, SourceLocation Loc, Selector Sel, ObjCMethodDecl *Method, MultiExprArg Args)
ExprResult ActOnClassMessage (Scope *S, ParsedType Receiver, Selector Sel, SourceLocation LBracLoc, ArrayRef< SourceLocation > SelectorLocs, SourceLocation RBracLoc, MultiExprArg Args)
ExprResult BuildInstanceMessage (Expr *Receiver, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef< SourceLocation > SelectorLocs, SourceLocation RBracLoc, MultiExprArg Args, bool isImplicit=false)
 Build an Objective-C instance message expression.
ExprResult BuildInstanceMessageImplicit (Expr *Receiver, QualType ReceiverType, SourceLocation Loc, Selector Sel, ObjCMethodDecl *Method, MultiExprArg Args)
ExprResult ActOnInstanceMessage (Scope *S, Expr *Receiver, Selector Sel, SourceLocation LBracLoc, ArrayRef< SourceLocation > SelectorLocs, SourceLocation RBracLoc, MultiExprArg Args)
ExprResult BuildObjCBridgedCast (SourceLocation LParenLoc, ObjCBridgeCastKind Kind, SourceLocation BridgeKeywordLoc, TypeSourceInfo *TSInfo, Expr *SubExpr)
ExprResult ActOnObjCBridgedCast (Scope *S, SourceLocation LParenLoc, ObjCBridgeCastKind Kind, SourceLocation BridgeKeywordLoc, ParsedType Type, SourceLocation RParenLoc, Expr *SubExpr)
void CheckTollFreeBridgeCast (QualType castType, Expr *castExpr)
void CheckObjCBridgeRelatedCast (QualType castType, Expr *castExpr)
bool CheckTollFreeBridgeStaticCast (QualType castType, Expr *castExpr, CastKind &Kind)
bool checkObjCBridgeRelatedComponents (SourceLocation Loc, QualType DestType, QualType SrcType, ObjCInterfaceDecl *&RelatedClass, ObjCMethodDecl *&ClassMethod, ObjCMethodDecl *&InstanceMethod, TypedefNameDecl *&TDNDecl, bool CfToNs, bool Diagnose=true)
bool CheckObjCBridgeRelatedConversions (SourceLocation Loc, QualType DestType, QualType SrcType, Expr *&SrcExpr, bool Diagnose=true)
bool isSelfExpr (Expr *RExpr)
 Private Helper predicate to check for 'self'.
bool isSelfExpr (Expr *RExpr, const ObjCMethodDecl *Method)
ObjCMethodDeclLookupMethodInQualifiedType (Selector Sel, const ObjCObjectPointerType *OPT, bool IsInstance)
 LookupMethodInQualifiedType - Lookups up a method in protocol qualifier list of a qualified objective pointer type.
ObjCMethodDeclLookupMethodInObjectType (Selector Sel, QualType Ty, bool IsInstance)
 LookupMethodInType - Look up a method in an ObjCObjectType.
bool isKnownName (StringRef name)
ARCConversionResult CheckObjCConversion (SourceRange castRange, QualType castType, Expr *&op, CheckedConversionKind CCK, bool Diagnose=true, bool DiagnoseCFAudited=false, BinaryOperatorKind Opc=BO_PtrMemD, bool IsReinterpretCast=false)
 Checks for invalid conversions and casts between retainable pointers and other pointer kinds for ARC and Weak.
ExprstripARCUnbridgedCast (Expr *e)
 stripARCUnbridgedCast - Given an expression of ARCUnbridgedCast type, remove the placeholder cast.
void diagnoseARCUnbridgedCast (Expr *e)
 Given that we saw an expression with the ARCUnbridgedCastTy placeholder type, complain bitterly.
bool CheckObjCARCUnavailableWeakConversion (QualType castType, QualType ExprType)
bool CheckMessageArgumentTypes (const Expr *Receiver, QualType ReceiverType, MultiExprArg Args, Selector Sel, ArrayRef< SourceLocation > SelectorLocs, ObjCMethodDecl *Method, bool isClassMessage, bool isSuperMessage, SourceLocation lbrac, SourceLocation rbrac, SourceRange RecRange, QualType &ReturnType, ExprValueKind &VK)
 CheckMessageArgumentTypes - Check types in an Obj-C message send.
QualType getMessageSendResultType (const Expr *Receiver, QualType ReceiverType, ObjCMethodDecl *Method, bool isClassMessage, bool isSuperMessage)
 Determine the result of a message send expression based on the type of the receiver, the method expected to receive the message, and the form of the message send.
void EmitRelatedResultTypeNote (const Expr *E)
 If the given expression involves a message send to a method with a related result type, emit a note describing what happened.
void EmitRelatedResultTypeNoteForReturn (QualType destType)
 Given that we had incompatible pointer types in a return statement, check whether we're in a method with a related result type, and if so, emit a note describing what happened.
ObjCMethodDeclLookupInstanceMethodInGlobalPool (Selector Sel, SourceRange R, bool receiverIdOrClass=false)
 LookupInstanceMethodInGlobalPool - Returns the method and warns if there are multiple signatures.
ObjCMethodDeclLookupFactoryMethodInGlobalPool (Selector Sel, SourceRange R, bool receiverIdOrClass=false)
 LookupFactoryMethodInGlobalPool - Returns the method and warns if there are multiple signatures.
DeclResult LookupIvarInObjCMethod (LookupResult &Lookup, Scope *S, IdentifierInfo *II)
 The parser has read a name in, and Sema has detected that we're currently inside an ObjC method.
ExprResult LookupInObjCMethod (LookupResult &LookUp, Scope *S, IdentifierInfo *II, bool AllowBuiltinCreation=false)
 The parser has read a name in, and Sema has detected that we're currently inside an ObjC method.
ExprResult BuildIvarRefExpr (Scope *S, SourceLocation Loc, ObjCIvarDecl *IV)
QualType FindCompositeObjCPointerType (ExprResult &LHS, ExprResult &RHS, SourceLocation QuestionLoc)
 FindCompositeObjCPointerType - Helper method to find composite type of two objective-c pointer types of the two input expressions.
bool CheckConversionToObjCLiteral (QualType DstType, Expr *&SrcExpr, bool Diagnose=true)
ExprResult ActOnObjCBoolLiteral (SourceLocation OpLoc, tok::TokenKind Kind)
 ActOnObjCBoolLiteral - Parse {__objc_yes,__objc_no} literals.
ExprResult ActOnObjCAvailabilityCheckExpr (llvm::ArrayRef< AvailabilitySpec > AvailSpecs, SourceLocation AtLoc, SourceLocation RParen)
CastKind PrepareCastToObjCObjectPointer (ExprResult &E)
 Prepare a conversion of the given expression to an ObjC object pointer type.
ObjCLiteralKind CheckLiteralKind (Expr *FromE)

Detailed Description

Definition at line 52 of file SemaObjC.h.

Member Typedef Documentation

◆ DeclGroupPtrTy

◆ GlobalMethodPool

Initial value:
llvm::DenseMap<Selector, std::pair<ObjCMethodList, ObjCMethodList>>

Definition at line 211 of file SemaObjC.h.

◆ SelectorSet

Definition at line 222 of file SemaObjC.h.

Member Enumeration Documentation

◆ ARCConversionResult

Enumerator
ACR_okay 
ACR_unbridged 
ACR_error 

Definition at line 806 of file SemaObjC.h.

◆ MethodMatchStrategy

Enumerator
MMS_loose 
MMS_strict 

Definition at line 224 of file SemaObjC.h.

◆ ObjCContainerKind

Enumerator
OCK_None 
OCK_Interface 
OCK_Protocol 
OCK_Category 
OCK_ClassExtension 
OCK_Implementation 
OCK_CategoryImplementation 

Definition at line 226 of file SemaObjC.h.

◆ ObjCLiteralKind

Enumerator
LK_Array 
LK_Dictionary 
LK_Numeric 
LK_Boxed 
LK_String 
LK_Block 
LK_None 

Definition at line 910 of file SemaObjC.h.

◆ ObjCMessageKind

Describes the kind of message expression indicated by a message send that starts with an identifier.

Enumerator
ObjCSuperMessage 

The message is sent to 'super'.

ObjCInstanceMessage 

The message is an instance message.

ObjCClassMessage 

The message is a class message, and the identifier is a type name.

Definition at line 708 of file SemaObjC.h.

◆ ObjCSpecialMethodKind

Enumerator
OSMK_None 
OSMK_Alloc 
OSMK_New 
OSMK_Copy 
OSMK_RetainingInit 
OSMK_NonRetainingInit 

Definition at line 198 of file SemaObjC.h.

◆ ObjCSubscriptKind

Enumerator
OS_Array 
OS_Dictionary 
OS_Error 

Definition at line 149 of file SemaObjC.h.

◆ ResultTypeCompatibilityKind

Describes the compatibility of a result type with its method.

Enumerator
RTC_Compatible 
RTC_Incompatible 
RTC_Unknown 

Definition at line 381 of file SemaObjC.h.

Constructor & Destructor Documentation

◆ SemaObjC()

Member Function Documentation

◆ ActOnAtEnd()

Decl * SemaObjC::ActOnAtEnd ( Scope * S,
SourceRange AtEnd,
ArrayRef< Decl * > allMethods = {},
ArrayRef< DeclGroupPtrTy > allTUVars = {} )

◆ ActOnClassMessage()

ExprResult SemaObjC::ActOnClassMessage ( Scope * S,
ParsedType Receiver,
Selector Sel,
SourceLocation LBracLoc,
ArrayRef< SourceLocation > SelectorLocs,
SourceLocation RBracLoc,
MultiExprArg Args )

◆ ActOnClassPropertyRefExpr()

◆ ActOnCompatibilityAlias()

Decl * SemaObjC::ActOnCompatibilityAlias ( SourceLocation AtLoc,
IdentifierInfo * AliasName,
SourceLocation AliasLocation,
IdentifierInfo * ClassName,
SourceLocation ClassLocation )

ActOnCompatibilityAlias - this action is called after complete parsing of a @compatibility_alias declaration.

It sets up the alias relationships.

Definition at line 1143 of file SemaDeclObjC.cpp.

References clang::AliasDecl, CheckObjCDeclScope(), clang::ObjCCompatibleAliasDecl::Create(), clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::Decl::getLocation(), clang::Sema::LookupOrdinaryName, clang::SemaBase::SemaRef, and clang::T.

◆ ActOnDefs()

void SemaObjC::ActOnDefs ( Scope * S,
Decl * TagD,
SourceLocation DeclStart,
const IdentifierInfo * ClassName,
SmallVectorImpl< Decl * > & Decls )

Called whenever @defs(ClassName) is encountered in the source.

Inserts the instance variables of ClassName into Decls.

Definition at line 5118 of file SemaDeclObjC.cpp.

References clang::cast(), clang::Class, clang::CPlusPlus, clang::ObjCAtDefsFieldDecl::Create(), clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::SemaBase::getLangOpts(), getObjCInterfaceDecl(), clang::ObjCRuntime::isNonFragile(), and clang::SemaBase::SemaRef.

◆ ActOnFinishObjCImplementation()

◆ ActOnForwardClassDeclaration()

◆ ActOnForwardProtocolDeclaration()

SemaObjC::DeclGroupPtrTy SemaObjC::ActOnForwardProtocolDeclaration ( SourceLocation AtProtoclLoc,
ArrayRef< IdentifierLoc > IdentList,
const ParsedAttributesView & attrList )

ActOnForwardProtocolDeclaration - Handle @protocol foo;.

Definition at line 1790 of file SemaDeclObjC.cpp.

References CheckObjCDeclScope(), clang::ObjCProtocolDecl::Create(), clang::SemaBase::getASTContext(), LookupProtocol(), and clang::SemaBase::SemaRef.

◆ ActOnInstanceMessage()

◆ ActOnIvar()

◆ ActOnMethodDeclaration()

Decl * SemaObjC::ActOnMethodDeclaration ( Scope * S,
SourceLocation BeginLoc,
SourceLocation EndLoc,
tok::TokenKind MethodType,
ObjCDeclSpec & ReturnQT,
ParsedType ReturnType,
ArrayRef< SourceLocation > SelectorLocs,
Selector Sel,
ParmVarDecl ** ArgInfo,
DeclaratorChunk::ParamInfo * CParamInfo,
unsigned CNumArgs,
const ParsedAttributesView & AttrList,
tok::ObjCKeywordKind MethodImplKind,
bool isVariadic,
bool MethodDefinition )

Definition at line 4783 of file SemaDeclObjC.cpp.

References clang::Decl::addAttr(), clang::C, clang::cast(), CheckARCMethodDecl(), checkObjCDirectMethodClashes(), CheckObjCMethodOverrides(), checkObjCMethodX86VectorTypes(), CheckRelatedResultTypeCompatibility(), clang::ObjCMethodDecl::Create(), clang::ObjCMethodDecl::createImplicitParams(), clang::FixItHint::CreateInsertion(), CvtQTToAstBitMask(), clang::ast_matchers::decl, clang::SemaBase::Diag(), diagnoseNoescape(), clang::Decl::dropAttr(), clang::Selector::getAsString(), clang::SemaBase::getASTContext(), clang::Decl::getAttr(), clang::ObjCMethodDecl::getCanonicalDecl(), clang::ObjCMethodDecl::getClassInterface(), clang::NamedDecl::getDeclName(), clang::SemaBase::getLangOpts(), clang::Decl::getLocation(), clang::ObjCMethodDecl::getMethodFamily(), clang::Selector::getMethodFamily(), clang::Selector::getNumArgs(), clang::ObjCDeclSpec::getObjCDeclQualifier(), clang::ObjCMethodDecl::getReturnType(), clang::ObjCMethodDecl::getSelector(), clang::ObjCMethodDecl::hasRelatedResultType(), clang::isa(), clang::ObjCMethodDecl::isClassMethod(), clang::ObjCMethodDecl::isDirectMethod(), clang::ObjCMethodDecl::isInstanceMethod(), clang::Type::isObjCIndependentClassType(), mergeInterfaceMethodToImpl(), mergeObjCDirectMembers(), clang::OMF_alloc, clang::OMF_autorelease, clang::OMF_copy, clang::OMF_dealloc, clang::OMF_finalize, clang::OMF_init, clang::OMF_initialize, clang::OMF_mutableCopy, clang::OMF_new, clang::OMF_None, clang::OMF_performSelector, clang::OMF_release, clang::OMF_retain, clang::OMF_retainCount, clang::OMF_self, clang::Optional, clang::ObjCMethodDecl::param_begin(), clang::ObjCMethodDecl::parameters(), clang::Required, RTC_Compatible, clang::SemaBase::SemaRef, clang::Decl::setDeclContext(), clang::Decl::setInvalidDecl(), clang::ObjCMethodDecl::setMethodParams(), clang::ObjCMethodDecl::setObjCDeclQualifier(), and clang::ObjCMethodDecl::setRelatedResultType().

◆ ActOnMethodParmDeclaration()

◆ ActOnObjCAtCatchStmt()

StmtResult clang::SemaObjC::ActOnObjCAtCatchStmt ( SourceLocation AtLoc,
SourceLocation RParen,
Decl * Parm,
Stmt * Body )

◆ ActOnObjCAtFinallyStmt()

StmtResult clang::SemaObjC::ActOnObjCAtFinallyStmt ( SourceLocation AtLoc,
Stmt * Body )

◆ ActOnObjCAtSynchronizedOperand()

◆ ActOnObjCAtSynchronizedStmt()

StmtResult clang::SemaObjC::ActOnObjCAtSynchronizedStmt ( SourceLocation AtLoc,
Expr * SynchExpr,
Stmt * SynchBody )

◆ ActOnObjCAtThrowStmt()

StmtResult clang::SemaObjC::ActOnObjCAtThrowStmt ( SourceLocation AtLoc,
Expr * Throw,
Scope * CurScope )

◆ ActOnObjCAtTryStmt()

◆ ActOnObjCAutoreleasePoolStmt()

StmtResult clang::SemaObjC::ActOnObjCAutoreleasePoolStmt ( SourceLocation AtLoc,
Stmt * Body )

◆ ActOnObjCAvailabilityCheckExpr()

◆ ActOnObjCBoolLiteral() [1/2]

◆ ActOnObjCBoolLiteral() [2/2]

ExprResult SemaObjC::ActOnObjCBoolLiteral ( SourceLocation OpLoc,
tok::TokenKind Kind )

ActOnObjCBoolLiteral - Parse {__objc_yes,__objc_no} literals.

Definition at line 5130 of file SemaExprObjC.cpp.

References clang::SemaBase::getASTContext(), clang::Sema::LookupOrdinaryName, clang::Result, and clang::SemaBase::SemaRef.

◆ ActOnObjCBridgedCast()

ExprResult SemaObjC::ActOnObjCBridgedCast ( Scope * S,
SourceLocation LParenLoc,
ObjCBridgeCastKind Kind,
SourceLocation BridgeKeywordLoc,
ParsedType Type,
SourceLocation RParenLoc,
Expr * SubExpr )

◆ ActOnObjCContainerFinishDefinition()

void clang::SemaObjC::ActOnObjCContainerFinishDefinition ( )

Definition at line 1279 of file SemaObjC.cpp.

References clang::SemaBase::SemaRef.

Referenced by ActOnAtEnd(), and ActOnObjCTemporaryExitContainerContext().

◆ ActOnObjCContainerStartDefinition()

◆ ActOnObjCExceptionDecl()

◆ ActOnObjCForCollectionStmt()

◆ ActOnObjCInstanceType()

ParsedType clang::SemaObjC::ActOnObjCInstanceType ( SourceLocation Loc)

The parser has parsed the context-sensitive type 'instancetype' in an Objective-C message declaration.

Return the appropriate type.

Definition at line 740 of file SemaObjC.cpp.

References clang::SemaBase::getASTContext(), clang::SemaBase::SemaRef, and clang::T.

◆ actOnObjCProtocolQualifierType()

TypeResult clang::SemaObjC::actOnObjCProtocolQualifierType ( SourceLocation lAngleLoc,
ArrayRef< Decl * > protocols,
ArrayRef< SourceLocation > protocolLocs,
SourceLocation rAngleLoc )

◆ ActOnObjCReenterContainerContext()

void clang::SemaObjC::ActOnObjCReenterContainerContext ( ObjCContainerDecl * ObjCCtx)

Definition at line 1291 of file SemaObjC.cpp.

References ActOnObjCContainerStartDefinition(), and clang::SemaBase::SemaRef.

◆ ActOnObjCTemporaryExitContainerContext()

void clang::SemaObjC::ActOnObjCTemporaryExitContainerContext ( ObjCContainerDecl * ObjCCtx)

Invoked when we must temporarily exit the objective-c container scope for parsing/looking-up C constructs.

Must be followed by a call to

See also
ActOnObjCReenterContainerContext

Definition at line 1284 of file SemaObjC.cpp.

References ActOnObjCContainerFinishDefinition(), and clang::SemaBase::SemaRef.

◆ actOnObjCTypeArgsAndProtocolQualifiers()

TypeResult clang::SemaObjC::actOnObjCTypeArgsAndProtocolQualifiers ( Scope * S,
SourceLocation Loc,
ParsedType BaseType,
SourceLocation TypeArgsLAngleLoc,
ArrayRef< ParsedType > TypeArgs,
SourceLocation TypeArgsRAngleLoc,
SourceLocation ProtocolLAngleLoc,
ArrayRef< Decl * > Protocols,
ArrayRef< SourceLocation > ProtocolLocs,
SourceLocation ProtocolRAngleLoc )

◆ actOnObjCTypeArgsOrProtocolQualifiers()

void SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers ( Scope * S,
ParsedType baseType,
SourceLocation lAngleLoc,
ArrayRef< IdentifierInfo * > identifiers,
ArrayRef< SourceLocation > identifierLocs,
SourceLocation rAngleLoc,
SourceLocation & typeArgsLAngleLoc,
SmallVectorImpl< ParsedType > & typeArgs,
SourceLocation & typeArgsRAngleLoc,
SourceLocation & protocolLAngleLoc,
SmallVectorImpl< Decl * > & protocols,
SourceLocation & protocolRAngleLoc,
bool warnOnIncompleteProtocols )

◆ actOnObjCTypeParam()

◆ actOnObjCTypeParamList()

ObjCTypeParamList * SemaObjC::actOnObjCTypeParamList ( Scope * S,
SourceLocation lAngleLoc,
ArrayRef< Decl * > typeParams,
SourceLocation rAngleLoc )

◆ ActOnProperty()

◆ ActOnPropertyImplDecl()

Decl * SemaObjC::ActOnPropertyImplDecl ( Scope * S,
SourceLocation AtLoc,
SourceLocation PropertyLoc,
bool ImplKind,
IdentifierInfo * PropertyId,
IdentifierInfo * PropertyIvar,
SourceLocation PropertyIvarLoc,
ObjCPropertyQueryKind QueryKind )

ActOnPropertyImplDecl - This routine performs semantic checks and builds the AST node for a property implementation declaration; declared as @synthesize or @dynamic.

Definition at line 1063 of file SemaObjCProperty.cpp.

References clang::Sema::AbstractSynthesizedIvarType, clang::DeclContext::addDecl(), clang::Qualifiers::addObjCLifetime(), clang::ObjCImplDecl::addPropertyImplementation(), clang::ast_matchers::callExpr, clang::Type::castAs(), checkARCPropertyImpl(), clang::CPlusPlus, clang::ImplicitCastExpr::Create(), clang::ObjCIvarDecl::Create(), clang::ObjCPropertyImplDecl::Create(), clang::FixItHint::CreateReplacement(), clang::declaresSameEntity(), clang::SemaBase::Diag(), clang::ObjCPropertyImplDecl::Dynamic, clang::DeclContextLookupResult::find_first(), clang::ObjCInterfaceDecl::FindCategoryDeclaration(), clang::ObjCContainerDecl::FindPropertyDeclaration(), clang::ObjCImplDecl::FindPropertyImplDecl(), clang::ObjCImplDecl::FindPropertyImplIvarDecl(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Type::getAs(), clang::Type::getAsRecordDecl(), clang::SemaBase::getASTContext(), clang::Decl::getBeginLoc(), clang::QualType::getCanonicalType(), clang::ObjCImplDecl::getClassInterface(), clang::NamedDecl::getDeclName(), clang::NamedDecl::getIdentifier(), getImpliedARCOwnership(), clang::SemaBase::getLangOpts(), clang::Decl::getLocation(), clang::SourceLocation::getLocWithOffset(), clang::ObjCContainerDecl::getMethod(), clang::NamedDecl::getName(), clang::QualType::getNonReferenceType(), clang::QualType::getObjCLifetime(), clang::QualType::getPointerAuth(), clang::ObjCPropertyDecl::getPropertyAttributesAsWritten(), clang::ObjCPropertyImplDecl::getPropertyDecl(), clang::ObjCPropertyImplDecl::getPropertyImplementation(), clang::ObjCIvarDecl::getSynthesize(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::QualType::getUnqualifiedType(), clang::ObjCIvarDecl::getUsageType(), clang::RecordDecl::hasFlexibleArrayMember(), hasWrittenStorageAttribute(), clang::InitializedEntity::InitializeResult(), clang::isa(), clang::ObjCInterfaceDecl::isArcWeakrefUnavailable(), clang::Type::isArithmeticType(), clang::ObjCPropertyDecl::isDirectProperty(), clang::ObjCRuntime::isFragile(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::SourceLocation::isInvalid(), clang::ObjCRuntime::isNonFragile(), clang::QualType::isObjCGCStrong(), clang::QualType::isObjCGCWeak(), clang::ObjCInterfaceDecl::isObjCRequiresPropertyDefs(), clang::Type::isObjCRetainableType(), clang::Type::isRecordType(), clang::SourceLocation::isValid(), clang::ObjCPropertyAttribute::kind_atomic, clang::ObjCPropertyAttribute::kind_nonatomic, clang::ObjCPropertyAttribute::kind_readonly, clang::ObjCPropertyAttribute::kind_readwrite, clang::ObjCPropertyAttribute::kind_strong, clang::ObjCPropertyAttribute::kind_weak, clang::ObjCInterfaceDecl::known_extensions(), LocPropertyAttribute(), clang::ObjCInterfaceDecl::lookupInstanceVariable(), clang::DeclContext::makeDeclVisibleInContext(), clang::LangOptionsBase::NonGC, clang::OMF_autorelease, clang::OMF_release, clang::OMF_retain, clang::OMF_retainCount, clang::ObjCIvarDecl::Private, RedeclarePropertyAccessor(), SelectPropertyForSynthesisFromProtocols(), clang::SemaBase::SemaRef, clang::ObjCPropertyImplDecl::setGetterCXXConstructor(), clang::ObjCPropertyImplDecl::setGetterMethodDecl(), setImpliedPropertyAttributeForReadOnlyProperty(), clang::Decl::setInvalidDecl(), clang::ObjCPropertyImplDecl::setSetterCXXAssignment(), clang::ObjCPropertyImplDecl::setSetterMethodDecl(), clang::ObjCPropertyImplDecl::Synthesize, clang::T, clang::VK_LValue, clang::VK_PRValue, and clang::Qualifiers::Weak.

Referenced by DefaultSynthesizeProperties().

◆ ActOnStartCategoryImplementation()

ObjCCategoryImplDecl * SemaObjC::ActOnStartCategoryImplementation ( SourceLocation AtCatImplLoc,
const IdentifierInfo * ClassName,
SourceLocation ClassLoc,
const IdentifierInfo * CatName,
SourceLocation CatLoc,
const ParsedAttributesView & AttrList )

◆ ActOnStartCategoryInterface()

◆ ActOnStartClassImplementation()

◆ ActOnStartClassInterface()

ObjCInterfaceDecl * SemaObjC::ActOnStartClassInterface ( Scope * S,
SourceLocation AtInterfaceLoc,
IdentifierInfo * ClassName,
SourceLocation ClassLoc,
ObjCTypeParamList * typeParamList,
IdentifierInfo * SuperName,
SourceLocation SuperLoc,
ArrayRef< ParsedType > SuperTypeArgs,
SourceRange SuperTypeArgsRange,
Decl *const * ProtoRefs,
unsigned NumProtoRefs,
const SourceLocation * ProtoLocs,
SourceLocation EndProtoLoc,
const ParsedAttributesView & AttrList,
SkipBodyInfo * SkipBody )

◆ ActOnStartOfObjCMethodDef()

◆ ActOnStartProtocolInterface()

◆ ActOnSuperClassOfClassInterface()

◆ ActOnSuperMessage()

◆ ActOnTypedefedProtocols()

void SemaObjC::ActOnTypedefedProtocols ( SmallVectorImpl< Decl * > & ProtocolRefs,
SmallVectorImpl< SourceLocation > & ProtocolLocs,
IdentifierInfo * SuperName,
SourceLocation SuperLoc )

ActOnTypedefedProtocols - this action finds protocol list as part of the typedef'ed use for a qualified super class and adds them to the list of the protocols.

Definition at line 1116 of file SemaDeclObjC.cpp.

References clang::Sema::LookupOrdinaryName, clang::SemaBase::SemaRef, and clang::T.

◆ AddAnyMethodToGlobalPool()

void SemaObjC::AddAnyMethodToGlobalPool ( Decl * D)

AddAnyMethodToGlobalPool - Add any method, instance or factory to global pool.

Definition at line 335 of file SemaDeclObjC.cpp.

References AddFactoryMethodToGlobalPool(), AddInstanceMethodToGlobalPool(), and clang::ObjCMethodDecl::isInstanceMethod().

◆ AddCFAuditedAttribute()

void clang::SemaObjC::AddCFAuditedAttribute ( Decl * D)

AddCFAuditedAttribute - Check whether we're currently within '#pragma clang arc_cf_code_audited' and, if so, consider adding the appropriate attribute.

Definition at line 1444 of file SemaObjC.cpp.

References clang::Decl::addAttr(), clang::SemaBase::getASTContext(), clang::Decl::hasAttr(), clang::AttributeCommonInfo::Form::Pragma(), and clang::SemaBase::SemaRef.

Referenced by clang::Sema::ActOnFunctionDeclarator().

◆ AddFactoryMethodToGlobalPool()

void clang::SemaObjC::AddFactoryMethodToGlobalPool ( ObjCMethodDecl * Method,
bool impl = false )
inline

AddFactoryMethodToGlobalPool - Same as above, but for factory methods.

Definition at line 530 of file SemaObjC.h.

References clang::Method.

Referenced by ActOnAtEnd(), AddAnyMethodToGlobalPool(), and ProcessPropertyDecl().

◆ AddInstanceMethodToGlobalPool()

void clang::SemaObjC::AddInstanceMethodToGlobalPool ( ObjCMethodDecl * Method,
bool impl = false )
inline

AddInstanceMethodToGlobalPool - All instance methods in a translation unit are added to a global pool.

This allows us to efficiently associate a selector with a method declaraation for purposes of typechecking messages sent to "id" (where the class of the object is unknown).

Definition at line 524 of file SemaObjC.h.

References clang::Method.

Referenced by ActOnAtEnd(), AddAnyMethodToGlobalPool(), and ProcessPropertyDecl().

◆ addMethodToGlobalList()

◆ AddXConsumedAttr()

◆ AdjustParameterTypeForObjCAutoRefCount()

◆ adornBoolConversionDiagWithTernaryFixit()

void clang::SemaObjC::adornBoolConversionDiagWithTernaryFixit ( const Expr * SourceExpr,
const Sema::SemaDiagnosticBuilder & Builder )

◆ AreMultipleMethodsInGlobalPool()

bool SemaObjC::AreMultipleMethodsInGlobalPool ( Selector Sel,
ObjCMethodDecl * BestMethod,
SourceRange R,
bool receiverIdOrClass,
SmallVectorImpl< ObjCMethodDecl * > & Methods )

◆ AtomicPropertySetterGetterRules()

◆ BuildClassMessage()

ExprResult SemaObjC::BuildClassMessage ( TypeSourceInfo * ReceiverTypeInfo,
QualType ReceiverType,
SourceLocation SuperLoc,
Selector Sel,
ObjCMethodDecl * Method,
SourceLocation LBracLoc,
ArrayRef< SourceLocation > SelectorLocs,
SourceLocation RBracLoc,
MultiExprArg ArgsIn,
bool isImplicit = false )

Build an Objective-C class message expression.

This routine takes care of both normal class messages and class messages to the superclass.

Parameters
ReceiverTypeInfoType source information that describes the receiver of this message. This may be NULL, in which case we are sending to the superclass and SuperLoc must be a valid source location.
ReceiverTypeThe type of the object receiving the message. When ReceiverTypeInfo is non-NULL, this is the same type as that refers to. For a superclass send, this is the type of the superclass.
SuperLocThe location of the "super" keyword in a superclass message.
SelThe selector to which the message is being sent.
MethodThe method that this class message is invoking, if already known.
LBracLocThe location of the opening square bracket ']'.
RBracLocThe location of the closing square bracket ']'.
ArgsInThe message arguments.

Definition at line 2606 of file SemaExprObjC.cpp.

References checkCocoaAPI(), checkFoundationAPI(), CheckMessageArgumentTypes(), clang::Class, clang::CPlusPlus, clang::ObjCMessageExpr::Create(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), DiagnoseCStringFormatDirectiveInObjCAPI(), clang::ExprError(), clang::Type::getAs(), clang::SemaBase::getASTContext(), clang::SourceRange::getBegin(), clang::SemaBase::getLangOpts(), clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getTypeLoc(), clang::Type::isDependentType(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), LookupFactoryMethodInGlobalPool(), clang::Method, clang::OMF_initialize, clang::Result, clang::SemaBase::SemaRef, and clang::VK_PRValue.

Referenced by ActOnClassMessage(), ActOnSuperMessage(), and BuildClassMessageImplicit().

◆ BuildClassMessageImplicit()

ExprResult SemaObjC::BuildClassMessageImplicit ( QualType ReceiverType,
bool isSuperReceiver,
SourceLocation Loc,
Selector Sel,
ObjCMethodDecl * Method,
MultiExprArg Args )

◆ BuildInstanceMessage()

ExprResult SemaObjC::BuildInstanceMessage ( Expr * Receiver,
QualType ReceiverType,
SourceLocation SuperLoc,
Selector Sel,
ObjCMethodDecl * Method,
SourceLocation LBracLoc,
ArrayRef< SourceLocation > SelectorLocs,
SourceLocation RBracLoc,
MultiExprArg ArgsIn,
bool isImplicit = false )

Build an Objective-C instance message expression.

This routine takes care of both normal instance messages and instance messages to the superclass instance.

Parameters
ReceiverThe expression that computes the object that will receive this message. This may be empty, in which case we are sending to the superclass instance and SuperLoc must be a valid source location.
ReceiverTypeThe (static) type of the object receiving the message. When a Receiver expression is provided, this is the same type as that expression. For a superclass instance send, this is a pointer to the type of the superclass.
SuperLocThe location of the "super" keyword in a superclass instance message.
SelThe selector to which the message is being sent.
MethodThe method that this instance message is invoking, if already known.
LBracLocThe location of the opening square bracket ']'.
RBracLocThe location of the closing square bracket ']'.
ArgsInThe message arguments.

Definition at line 2831 of file SemaExprObjC.cpp.

References AreMultipleMethodsInGlobalPool(), checkCocoaAPI(), checkFoundationAPI(), checkInitMethod(), CheckMessageArgumentTypes(), CheckObjCCircularContainer(), checkRetainCycles(), CollectMultipleMethodsInGlobalPool(), clang::CPlusPlus, clang::ObjCMessageExpr::Create(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), DiagnoseCStringFormatDirectiveInObjCAPI(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Type::getAsObjCInterfacePointerType(), clang::Type::getAsObjCQualifiedClassType(), clang::Type::getAsObjCQualifiedIdType(), clang::SemaBase::getASTContext(), clang::Stmt::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::SemaBase::getDiagnostics(), clang::Expr::getExprLoc(), clang::SemaBase::getLangOpts(), clang::Decl::getLocation(), clang::ObjCMethodDecl::getMethodFamily(), clang::Selector::getMethodFamily(), clang::QualType::getObjCLifetime(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::Expr::hasPlaceholderType(), clang::Type::isBlockPointerType(), clang::Type::isIntegerType(), clang::SourceLocation::isInvalid(), isMethodDeclaredInRootProtocol(), IsNull, clang::Expr::isNullPointerConstant(), clang::Type::isObjCClassOrClassKindOfType(), clang::Type::isObjCClassType(), clang::Type::isObjCIdOrObjectKindOfType(), clang::Type::isObjCIdType(), clang::Type::isObjCQualifiedClassType(), clang::Type::isObjCRetainableType(), clang::Expr::isObjCSelfExpr(), clang::Type::isPointerType(), isSelfExpr(), clang::Expr::isTypeDependent(), clang::Selector::isUnarySelector(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::SourceLocation::isValid(), clang::ObjCPropertyAttribute::kind_weak, LookupFactoryMethodInGlobalPool(), clang::ObjCInterfaceDecl::lookupInstanceMethod(), LookupInstanceMethodInGlobalPool(), LookupMethodInQualifiedType(), clang::ObjCInterfaceDecl::lookupPrivateMethod(), clang::Method, clang::Expr::NPC_ValueDependentIsNull, clang::sema::FunctionScopeInfo::ObjCIsDesignatedInit, clang::sema::FunctionScopeInfo::ObjCIsSecondaryInit, clang::sema::FunctionScopeInfo::ObjCWarnForNoDesignatedInitChain, clang::sema::FunctionScopeInfo::ObjCWarnForNoInitDelegation, clang::Qualifiers::OCL_Weak, clang::OMF_alloc, clang::OMF_autorelease, clang::OMF_copy, clang::OMF_dealloc, clang::OMF_finalize, clang::OMF_init, clang::OMF_initialize, clang::OMF_mutableCopy, clang::OMF_new, clang::OMF_None, clang::OMF_performSelector, clang::OMF_release, clang::OMF_retain, clang::OMF_retainCount, clang::OMF_self, clang::Result, clang::SemaBase::SemaRef, and clang::VK_PRValue.

Referenced by ActOnInstanceMessage(), ActOnSuperMessage(), and BuildInstanceMessageImplicit().

◆ BuildInstanceMessageImplicit()

ExprResult SemaObjC::BuildInstanceMessageImplicit ( Expr * Receiver,
QualType ReceiverType,
SourceLocation Loc,
Selector Sel,
ObjCMethodDecl * Method,
MultiExprArg Args )

Definition at line 2775 of file SemaExprObjC.cpp.

References BuildInstanceMessage(), and clang::Method.

Referenced by CheckObjCBridgeRelatedConversions().

◆ BuildIvarRefExpr()

◆ BuildObjCArrayLiteral()

◆ BuildObjCAtThrowStmt()

◆ BuildObjCBoxedExpr()

ExprResult SemaObjC::BuildObjCBoxedExpr ( SourceRange SR,
Expr * ValueExpr )

BuildObjCBoxedExpr - builds an ObjCBoxedExpr AST node for the '@' prefixed parenthesized expression.

The type of the expression will either be "NSNumber *", "NSString *" or "NSValue *" depending on the type of ValueType, which is allowed to be a built-in numeric type, "char *", "const char *" or C structure with attribute 'objc_boxable'.

Definition at line 507 of file SemaExprObjC.cpp.

References clang::Ascii, bytes(), clang::ObjCMethodDecl::Create(), clang::ParmVarDecl::Create(), clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::SemaBase::getASTContext(), clang::SourceRange::getBegin(), clang::Expr::getExprLoc(), clang::SemaBase::getLangOpts(), getNSNumberFactoryMethod(), clang::Type::getNullability(), clang::Type::getPointeeType(), clang::ObjCMethodDecl::getReturnType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreParens(), clang::InitializedEntity::InitializeParameter(), clang::InitializedEntity::InitializeTemporary(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), LK_Boxed, LK_String, LookupObjCInterfaceDeclForLiteral(), clang::NonNull, NSNumberPointer, NSStringDecl, NSStringPointer, NSValueDecl, NSValuePointer, clang::ObjCMethodDecl::parameters(), clang::Required, clang::SC_None, clang::SemaBase::SemaRef, clang::ObjCMethodDecl::setMethodParams(), StringWithUTF8StringMethod, clang::ast_matchers::type, clang::UTF16, clang::UTF32, clang::UTF8, validateBoxingMethod(), ValueWithBytesObjCTypeMethod, clang::Wide, and clang::QualType::withConst().

Referenced by clang::TreeTransform< AdjustConstraintDepth >::RebuildObjCBoxedExpr().

◆ BuildObjCBridgedCast()

◆ BuildObjCDictionaryLiteral()

◆ BuildObjCEncodeExpression()

◆ BuildObjCExceptionDecl()

◆ BuildObjCNumericLiteral()

◆ BuildObjCObjectType()

QualType clang::SemaObjC::BuildObjCObjectType ( QualType BaseType,
SourceLocation Loc,
SourceLocation TypeArgsLAngleLoc,
ArrayRef< TypeSourceInfo * > TypeArgs,
SourceLocation TypeArgsRAngleLoc,
SourceLocation ProtocolLAngleLoc,
ArrayRef< ObjCProtocolDecl * > Protocols,
ArrayRef< SourceLocation > ProtocolLocs,
SourceLocation ProtocolRAngleLoc,
bool FailOnError,
bool Rebuilding )

◆ BuildObjCStringLiteral()

◆ BuildObjCSubscriptExpression()

ExprResult SemaObjC::BuildObjCSubscriptExpression ( SourceLocation RB,
Expr * BaseExpr,
Expr * IndexExpr,
ObjCMethodDecl * getterMethod,
ObjCMethodDecl * setterMethod )

◆ BuildObjCTypeParamType()

QualType clang::SemaObjC::BuildObjCTypeParamType ( const ObjCTypeParamDecl * Decl,
SourceLocation ProtocolLAngleLoc,
ArrayRef< ObjCProtocolDecl * > Protocols,
ArrayRef< SourceLocation > ProtocolLocs,
SourceLocation ProtocolRAngleLoc,
bool FailOnError = false )

Build an Objective-C type parameter type.

Definition at line 480 of file SemaObjC.cpp.

References clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), and clang::Result.

◆ CheckARCMethodDecl()

◆ checkArrayLiteral()

void clang::SemaObjC::checkArrayLiteral ( QualType TargetType,
ObjCArrayLiteral * ArrayLiteral )

◆ CheckCategoryVsClassMethodMatches()

void SemaObjC::CheckCategoryVsClassMethodMatches ( ObjCCategoryImplDecl * CatIMP)

CheckCategoryVsClassMethodMatches - Checks that methods implemented in category matches with those implemented in its primary class and warns each time an exact match is found.

Definition at line 2952 of file SemaDeclObjC.cpp.

References clang::ObjCContainerDecl::class_methods(), clang::ObjCCategoryImplDecl::getCategoryDecl(), clang::ObjCCategoryDecl::getClassInterface(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ObjCContainerDecl::instance_methods(), clang::ObjCInterfaceDecl::lookupMethod(), and MatchAllMethodDeclarations().

Referenced by ImplMethodsVsClassMethods().

◆ CheckConflictingOverridingMethod()

◆ CheckConversionToObjCLiteral()

◆ checkDictionaryLiteral()

void clang::SemaObjC::checkDictionaryLiteral ( QualType TargetType,
ObjCDictionaryLiteral * DictionaryLiteral )

◆ CheckForwardProtocolDeclarationForCircularDependency()

◆ CheckImplementationIvars()

◆ checkInitMethod()

bool SemaObjC::checkInitMethod ( ObjCMethodDecl * method,
QualType receiverTypeIfCall )

Check whether the given method, which must be in the 'init' family, is a valid member of that family.

Parameters
receiverTypeIfCall- if null, check this as if declaring it; if non-null, check this as if making a call to it with the given receiver type
Returns
true to indicate that there was an error and appropriate actions were taken

Definition at line 44 of file SemaDeclObjC.cpp.

References clang::Decl::addAttr(), clang::Type::castAs(), clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::ObjCMethodDecl::getClassInterface(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), getObjectType(), clang::ObjCMethodDecl::getReturnType(), clang::ObjCInterfaceDecl::hasDefinition(), clang::isa(), clang::Decl::isInvalidDecl(), clang::QualType::isNull(), clang::ObjCInterfaceDecl::isSuperClassOf(), clang::SemaBase::SemaRef, and clang::Decl::setInvalidDecl().

Referenced by BuildInstanceMessage(), and CheckARCMethodDecl().

◆ CheckLiteralKind()

◆ CheckMessageArgumentTypes()

bool SemaObjC::CheckMessageArgumentTypes ( const Expr * Receiver,
QualType ReceiverType,
MultiExprArg Args,
Selector Sel,
ArrayRef< SourceLocation > SelectorLocs,
ObjCMethodDecl * Method,
bool isClassMessage,
bool isSuperMessage,
SourceLocation lbrac,
SourceLocation rbrac,
SourceRange RecRange,
QualType & ReturnType,
ExprValueKind & VK )

◆ checkNSReturnsRetainedReturnType()

bool clang::SemaObjC::checkNSReturnsRetainedReturnType ( SourceLocation loc,
QualType type )

◆ CheckObjCARCUnavailableWeakConversion()

◆ CheckObjCBridgeRelatedCast()

void SemaObjC::CheckObjCBridgeRelatedCast ( QualType castType,
Expr * castExpr )

◆ checkObjCBridgeRelatedComponents()

◆ CheckObjCBridgeRelatedConversions()

◆ CheckObjCCircularContainer()

void clang::SemaObjC::CheckObjCCircularContainer ( ObjCMessageExpr * Message)

◆ CheckObjCConversion()

◆ CheckObjCDeclScope()

bool SemaObjC::CheckObjCDeclScope ( Decl * D)

Checks that the Objective-C declaration is declared in the global scope.

Emits an error and marks the declaration as invalid if it's not declared in the global scope.

Definition at line 5098 of file SemaDeclObjC.cpp.

References clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::isa(), clang::SemaBase::SemaRef, and clang::Decl::setInvalidDecl().

Referenced by ActOnCompatibilityAlias(), ActOnForwardClassDeclaration(), ActOnForwardProtocolDeclaration(), ActOnStartCategoryImplementation(), ActOnStartCategoryInterface(), ActOnStartClassImplementation(), ActOnStartClassInterface(), and ActOnStartProtocolInterface().

◆ CheckObjCForCollectionOperand()

◆ CheckObjCMethodCall()

bool clang::SemaObjC::CheckObjCMethodCall ( ObjCMethodDecl * Method,
SourceLocation loc,
ArrayRef< const Expr * > Args )

Definition at line 1241 of file SemaObjC.cpp.

References clang::DoesNotApply, clang::Method, and clang::SemaBase::SemaRef.

Referenced by CheckMessageArgumentTypes().

◆ CheckObjCMethodDirectOverrides()

void SemaObjC::CheckObjCMethodDirectOverrides ( ObjCMethodDecl * method,
ObjCMethodDecl * overridden )

◆ CheckObjCMethodOverride()

◆ CheckObjCMethodOverrides()

◆ CheckObjCPropertyAttributes()

◆ CheckObjCString()

bool clang::SemaObjC::CheckObjCString ( Expr * Arg)

CheckObjCString - Checks that the argument to the builtin CFString constructor is correct Note: It might also make sense to do the UTF-16 conversion here (would simplify the backend).

Definition at line 1213 of file SemaObjC.cpp.

References clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::IgnoreParenCasts(), and clang::Result.

Referenced by BuildObjCStringLiteral().

◆ checkRetainCycles() [1/3]

void clang::SemaObjC::checkRetainCycles ( Expr * receiver,
Expr * argument )

Check a property assign to see if it's likely to cause a retain cycle.

Definition at line 1186 of file SemaObjC.cpp.

References clang::diagnoseRetainCycle(), clang::findCapturingExpr(), clang::findRetainCycleOwner(), and clang::SemaBase::SemaRef.

◆ checkRetainCycles() [2/3]

◆ checkRetainCycles() [3/3]

◆ CheckSubscriptingKind()

◆ CheckTollFreeBridgeCast()

◆ CheckTollFreeBridgeStaticCast()

bool SemaObjC::CheckTollFreeBridgeStaticCast ( QualType castType,
Expr * castExpr,
CastKind & Kind )

◆ CollectIvarsToConstructOrDestruct()

void SemaObjC::CollectIvarsToConstructOrDestruct ( ObjCInterfaceDecl * OI,
SmallVectorImpl< ObjCIvarDecl * > & Ivars )

CollectIvarsToConstructOrDestruct - Collect those ivars which require initialization.

Definition at line 5265 of file SemaDeclObjC.cpp.

References clang::ObjCInterfaceDecl::all_declared_ivar_begin(), clang::SemaBase::getASTContext(), clang::ObjCIvarDecl::getNextIvar(), and clang::Type::isRecordType().

Referenced by SetIvarInitializers().

◆ CollectMultipleMethodsInGlobalPool()

bool SemaObjC::CollectMultipleMethodsInGlobalPool ( Selector Sel,
SmallVectorImpl< ObjCMethodDecl * > & Methods,
bool InstanceFirst,
bool CheckTheOther,
const ObjCObjectType * TypeBound = nullptr )

We first select the type of the method: Instance or Factory, then collect all methods with that type.

  • Returns instance or factory methods in global method pool for given selector. It checks the desired kind first, if none is found, and parameter checkTheOther is set, it then checks the other kind. If no such method or only one method is found, function returns false; otherwise, it returns true.

Definition at line 3520 of file SemaDeclObjC.cpp.

References FilterMethodsByTypeBound(), clang::ObjCMethodList::getNext(), MethodPool, ReadMethodPool(), and clang::SemaBase::SemaRef.

Referenced by BuildInstanceMessage().

◆ CreatePropertyDecl()

ObjCPropertyDecl * SemaObjC::CreatePropertyDecl ( Scope * S,
ObjCContainerDecl * CDecl,
SourceLocation AtLoc,
SourceLocation LParenLoc,
FieldDeclarator & FD,
Selector GetterSel,
SourceLocation GetterNameLoc,
Selector SetterSel,
SourceLocation SetterNameLoc,
const bool isReadWrite,
const unsigned Attributes,
const unsigned AttributesAsWritten,
QualType T,
TypeSourceInfo * TSI,
tok::ObjCKeywordKind MethodImplKind,
DeclContext * lexicalDC = nullptr )

Called by ActOnProperty and HandlePropertyInClassExtension to handle creating the ObjcPropertyDecl for a category or @interface.

Definition at line 551 of file SemaObjCProperty.cpp.

References clang::DeclContext::addDecl(), clang::ObjCRuntime::allowsDirectDispatch(), clang::ObjCInterfaceDecl::ClassImplementsProtocol(), clang::ObjCPropertyDecl::Create(), clang::FixItHint::CreateInsertion(), clang::FieldDeclarator::D, clang::SemaBase::Diag(), clang::ObjCPropertyDecl::findPropertyDecl(), clang::SemaBase::getASTContext(), clang::TypeLoc::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::TypeLoc::getEndLoc(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::SemaBase::getLangOpts(), clang::Decl::getLocation(), getOwnershipRule(), clang::ObjCPropertyDecl::getQueryKind(), clang::TypeSourceInfo::getTypeLoc(), clang::Decl::hasAttr(), clang::isa(), clang::ObjCPropertyAttribute::kind_assign, clang::ObjCPropertyAttribute::kind_atomic, clang::ObjCPropertyAttribute::kind_class, clang::ObjCPropertyAttribute::kind_copy, clang::ObjCPropertyAttribute::kind_direct, clang::ObjCPropertyAttribute::kind_getter, clang::ObjCPropertyAttribute::kind_nonatomic, clang::ObjCPropertyAttribute::kind_null_resettable, clang::ObjCPropertyAttribute::kind_nullability, clang::ObjCPropertyAttribute::kind_readonly, clang::ObjCPropertyAttribute::kind_readwrite, clang::ObjCPropertyAttribute::kind_retain, clang::ObjCPropertyAttribute::kind_setter, clang::ObjCPropertyAttribute::kind_strong, clang::ObjCPropertyAttribute::kind_unsafe_unretained, clang::ObjCPropertyAttribute::kind_weak, LookupProtocol(), makePropertyAttributesAsWritten(), clang::LangOptionsBase::NonGC, clang::ObjCPropertyDecl::Optional, clang::ObjCPropertyDecl::Required, clang::SemaBase::SemaRef, clang::ObjCPropertyDecl::setGetterName(), clang::Decl::setInvalidDecl(), clang::Decl::setLexicalDeclContext(), clang::ObjCPropertyDecl::setPropertyAttributes(), clang::ObjCPropertyDecl::setPropertyAttributesAsWritten(), clang::ObjCPropertyDecl::setPropertyImplementation(), clang::ObjCPropertyDecl::setSetterName(), and clang::T.

Referenced by ActOnProperty(), and HandlePropertyInClassExtension().

◆ DefaultSynthesizeProperties() [1/2]

void SemaObjC::DefaultSynthesizeProperties ( Scope * S,
Decl * D,
SourceLocation AtEnd )

◆ DefaultSynthesizeProperties() [2/2]

void SemaObjC::DefaultSynthesizeProperties ( Scope * S,
ObjCImplDecl * IMPDecl,
ObjCInterfaceDecl * IDecl,
SourceLocation AtEnd )

◆ diagnoseARCUnbridgedCast()

◆ DiagnoseClassExtensionDupMethods()

void SemaObjC::DiagnoseClassExtensionDupMethods ( ObjCCategoryDecl * CAT,
ObjCInterfaceDecl * ID )

DiagnoseClassExtensionDupMethods - Check for duplicate declaration of a class method in its extension.

Definition at line 1766 of file SemaDeclObjC.cpp.

References clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::ObjCMethodDecl::isInstanceMethod(), MatchTwoMethodDeclarations(), clang::Method, and clang::ObjCContainerDecl::methods().

Referenced by ActOnAtEnd().

◆ DiagnoseCStringFormatDirectiveInCFAPI()

void clang::SemaObjC::DiagnoseCStringFormatDirectiveInCFAPI ( const NamedDecl * FDecl,
Expr ** Args,
unsigned NumArgs )

◆ DiagnoseDuplicateIvars()

void SemaObjC::DiagnoseDuplicateIvars ( ObjCInterfaceDecl * ID,
ObjCInterfaceDecl * SID )

DiagnoseDuplicateIvars - Check for duplicate ivars in the entire class at the start of @implementation.

This becomes necessary because class extension can add ivars to a class in random order which will not be known until class's @implementation is seen.

Definition at line 3775 of file SemaDeclObjC.cpp.

References clang::SemaBase::Diag(), clang::Decl::getLocation(), and clang::ObjCInterfaceDecl::lookupInstanceVariable().

Referenced by ActOnAtEnd(), and clang::Sema::ActOnFields().

◆ DiagnoseMissingDesignatedInitOverrides()

◆ DiagnoseMultipleMethodInGlobalPool()

◆ diagnoseNullResettableSynthesizedSetters()

void SemaObjC::diagnoseNullResettableSynthesizedSetters ( const ObjCImplDecl * impDecl)

◆ DiagnoseOwningPropertyGetterSynthesis()

◆ DiagnosePropertyAccessorMismatch()

◆ DiagnosePropertyMismatch()

◆ DiagnoseTypeArgsAndProtocols()

void SemaObjC::DiagnoseTypeArgsAndProtocols ( IdentifierInfo * ProtocolId,
SourceLocation ProtocolLoc,
IdentifierInfo * TypeArgId,
SourceLocation TypeArgLoc,
bool SelectProtocolFirst = false )

Definition at line 1418 of file SemaDeclObjC.cpp.

References clang::SemaBase::Diag().

Referenced by actOnObjCTypeArgsOrProtocolQualifiers().

◆ DiagnoseUnimplementedProperties()

◆ DiagnoseUnusedBackingIvarInAccessor()

void SemaObjC::DiagnoseUnusedBackingIvarInAccessor ( Scope * S,
const ObjCImplementationDecl * ImplD )

DiagnoseUnusedBackingIvarInAccessor - Issue an 'unused' warning if ivar which backs the property is not used in the property's accessor.

Definition at line 5361 of file SemaDeclObjC.cpp.

References DIAG, clang::SemaBase::Diag(), clang::SemaBase::getDiagnostics(), GetIvarBackingPropertyAccessor(), clang::Decl::getLocation(), clang::Scope::hasUnrecoverableErrorOccurred(), clang::ObjCContainerDecl::instance_methods(), clang::Decl::isReferenced(), and clang::SemaBase::SemaRef.

Referenced by ActOnAtEnd().

◆ DiagnoseUseOfUnimplementedSelectors()

◆ EmitRelatedResultTypeNote()

void SemaObjC::EmitRelatedResultTypeNote ( const Expr * E)

If the given expression involves a message send to a method with a related result type, emit a note describing what happened.

Definition at line 1684 of file SemaExprObjC.cpp.

References clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::ObjCMessageExpr::getMethodDecl(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), and clang::Method.

Referenced by clang::Sema::DiagnoseAssignmentResult(), emitBadConversionNotes(), and clang::Sema::PerformImplicitConversion().

◆ EmitRelatedResultTypeNoteForReturn()

void SemaObjC::EmitRelatedResultTypeNoteForReturn ( QualType destType)

Given that we had incompatible pointer types in a return statement, check whether we're in a method with a related result type, and if so, emit a note describing what happened.

Definition at line 1654 of file SemaExprObjC.cpp.

References clang::SemaBase::Diag(), findExplicitInstancetypeDeclarer(), clang::SemaBase::getASTContext(), clang::Decl::getLocation(), clang::ObjCMethodDecl::getMethodFamily(), clang::ObjCMethodDecl::getReturnType(), clang::ObjCMethodDecl::hasRelatedResultType(), clang::SourceLocation::isInvalid(), and clang::SemaBase::SemaRef.

Referenced by clang::Sema::DiagnoseAssignmentResult(), and emitBadConversionNotes().

◆ FindCompositeObjCPointerType()

◆ FindProtocolDeclaration()

void SemaObjC::FindProtocolDeclaration ( bool WarnOnDeclarations,
bool ForObjCContainer,
ArrayRef< IdentifierLoc > ProtocolId,
SmallVectorImpl< Decl * > & Protocols )

◆ FinishObjCForCollectionStmt()

StmtResult clang::SemaObjC::FinishObjCForCollectionStmt ( Stmt * ForCollection,
Stmt * Body )

FinishObjCForCollectionStmt - Attach the body to a objective-C foreach statement.

Definition at line 193 of file SemaObjC.cpp.

References clang::cast(), clang::ForStmt::setBody(), and clang::StmtError().

Referenced by clang::Sema::FinishCXXForRangeStmt(), and clang::TreeTransform< AdjustConstraintDepth >::RebuildObjCForCollectionStmt().

◆ getCurObjCLexicalContext()

const DeclContext * clang::SemaObjC::getCurObjCLexicalContext ( ) const

Definition at line 1256 of file SemaObjC.cpp.

References clang::SemaBase::SemaRef.

Referenced by DiagnoseUnusedOfDecl().

◆ GetFormatNSStringIdx()

bool clang::SemaObjC::GetFormatNSStringIdx ( const FormatAttr * Format,
unsigned & Idx )

◆ GetIvarBackingPropertyAccessor()

ObjCIvarDecl * SemaObjC::GetIvarBackingPropertyAccessor ( const ObjCMethodDecl * Method,
const ObjCPropertyDecl *& PDecl ) const

GetIvarBackingPropertyAccessor - If method is a property setter/getter and it property has a backing ivar, returns this ivar; otherwise, returns NULL.

It also returns ivar's property on success.

Definition at line 5301 of file SemaDeclObjC.cpp.

References clang::ObjCPropertyDecl::getPropertyIvarDecl(), clang::ObjCInterfaceDecl::lookupMethod(), and clang::Method.

Referenced by DiagnoseUnusedBackingIvarInAccessor().

◆ getMessageSendResultType()

◆ getNSErrorIdent()

IdentifierInfo * clang::SemaObjC::getNSErrorIdent ( )

Retrieve the identifier "NSError".

Definition at line 1265 of file SemaObjC.cpp.

References clang::SemaBase::SemaRef.

Referenced by clang::checkSwiftAsyncErrorBlock(), classifyPointerDeclarator(), isCFError(), and clang::isErrorParameter().

◆ getObjCContainerKind()

◆ getObjCDeclContext()

ObjCContainerDecl * SemaObjC::getObjCDeclContext ( ) const

Definition at line 5499 of file SemaDeclObjC.cpp.

References clang::SemaBase::SemaRef.

◆ getObjCInterfaceDecl()

ObjCInterfaceDecl * SemaObjC::getObjCInterfaceDecl ( const IdentifierInfo *& Id,
SourceLocation IdLoc,
bool TypoCorrection = false )

Look for an Objective-C class in the translation unit.

Parameters
IdThe name of the Objective-C class we're looking for. If typo-correction fixes this name, the Id will be updated to the fixed name.
IdLocThe location of the name in the translation unit.
DoTypoCorrectionIf true, this routine will attempt typo correction if there is no class with the given name.
Returns
The declaration of the named Objective-C class, or NULL if the class could not be found.

Definition at line 5428 of file SemaDeclObjC.cpp.

References clang::C, clang::ErrorRecovery, clang::ObjCInterfaceDecl::getDefinition(), clang::NamedDecl::getIdentifier(), clang::Sema::LookupOrdinaryName, clang::SemaBase::PDiag(), and clang::SemaBase::SemaRef.

Referenced by ActOnClassPropertyRefExpr(), ActOnDefs(), ActOnStartCategoryImplementation(), and ActOnStartCategoryInterface().

◆ getObjCMessageKind()

◆ handleBlocksAttr()

◆ handleBoxable()

void clang::SemaObjC::handleBoxable ( Decl * D,
const ParsedAttr & AL )

Definition at line 2116 of file SemaObjC.cpp.

References clang::SemaBase::getASTContext(), and clang::SemaBase::SemaRef.

Referenced by ProcessDeclAttribute().

◆ handleBridgeAttr()

◆ handleBridgeMutableAttr()

◆ handleBridgeRelatedAttr()

◆ handleDesignatedInitializer()

◆ handleDirectAttr()

◆ handleDirectMembersAttr()

◆ HandleExprPropertyRefExpr()

ExprResult SemaObjC::HandleExprPropertyRefExpr ( const ObjCObjectPointerType * OPT,
Expr * BaseExpr,
SourceLocation OpLoc,
DeclarationName MemberName,
SourceLocation MemberLoc,
SourceLocation SuperLoc,
QualType SuperType,
bool Super )

HandleExprPropertyRefExpr - Handle foo.bar where foo is a pointer to an objective C interface.

This is a property reference expression.

Definition at line 1975 of file SemaExprObjC.cpp.

References clang::cast(), clang::SelectorTable::constructSetterSelector(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::ErrorRecovery, clang::ExprError(), clang::ObjCMethodDecl::findPropertyDecl(), clang::ObjCContainerDecl::FindPropertyDeclaration(), clang::DeclarationName::getAsIdentifierInfo(), clang::SemaBase::getASTContext(), clang::ObjCInterfaceType::getDecl(), clang::ObjCObjectPointerType::getInterfaceDecl(), clang::ObjCObjectPointerType::getInterfaceType(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::ObjCObjectPointerType::getPointeeType(), clang::Stmt::getSourceRange(), HandleExprPropertyRefExpr(), clang::isa(), clang::DeclarationName::isIdentifier(), clang::Decl::isImplicit(), clang::ObjCMethodDecl::isPropertyAccessor(), clang::ObjCPropertyAttribute::kind_setter, clang::ObjCInterfaceDecl::lookupInstanceMethod(), clang::ObjCInterfaceDecl::lookupInstanceVariable(), LookupMethodInQualifiedType(), clang::Sema::LookupOrdinaryName, clang::ObjCInterfaceDecl::lookupPrivateMethod(), clang::Member, clang::nullptr, clang::OBJC_PR_query_instance, clang::OK_ObjCProperty, clang::SemaBase::PDiag(), clang::ObjCObjectPointerType::quals(), clang::SemaBase::SemaRef, clang::T, and clang::VK_LValue.

Referenced by ActOnClassPropertyRefExpr(), HandleExprPropertyRefExpr(), and LookupMemberExpr().

◆ handleExternallyRetainedAttr()

◆ handleIBOutlet()

void clang::SemaObjC::handleIBOutlet ( Decl * D,
const ParsedAttr & AL )

◆ handleIBOutletCollection()

◆ handleIndependentClass()

void clang::SemaObjC::handleIndependentClass ( Decl * D,
const ParsedAttr & AL )

◆ handleMethodFamilyAttr()

◆ handleNSErrorDomain()

◆ handleNSObject()

void clang::SemaObjC::handleNSObject ( Decl * D,
const ParsedAttr & AL )

◆ handleOwnershipAttr()

◆ handlePreciseLifetimeAttr()

◆ HandlePropertyInClassExtension()

ObjCPropertyDecl * SemaObjC::HandlePropertyInClassExtension ( Scope * S,
SourceLocation AtLoc,
SourceLocation LParenLoc,
FieldDeclarator & FD,
Selector GetterSel,
SourceLocation GetterNameLoc,
Selector SetterSel,
SourceLocation SetterNameLoc,
const bool isReadWrite,
unsigned & Attributes,
const unsigned AttributesAsWritten,
QualType T,
TypeSourceInfo * TSI,
tok::ObjCKeywordKind MethodImplKind )

◆ handleRequiresSuperAttr()

void clang::SemaObjC::handleRequiresSuperAttr ( Decl * D,
const ParsedAttr & Attrs )

◆ handleReturnsInnerPointerAttr()

◆ handleRuntimeName()

void clang::SemaObjC::handleRuntimeName ( Decl * D,
const ParsedAttr & AL )

◆ handleSuppresProtocolAttr()

void clang::SemaObjC::handleSuppresProtocolAttr ( Decl * D,
const ParsedAttr & AL )

◆ handleXReturnsXRetainedAttr()

◆ ImplMethodsVsClassMethods()

◆ inferObjCARCLifetime()

◆ isCFError()

◆ isCFStringType()

◆ isKnownName()

bool SemaObjC::isKnownName ( StringRef name)

◆ isNSStringType()

bool clang::SemaObjC::isNSStringType ( QualType T,
bool AllowNSAttributedString = false )

◆ isObjCMethodDecl()

bool clang::SemaObjC::isObjCMethodDecl ( Decl * D)
inline

Definition at line 399 of file SemaObjC.h.

◆ isObjCWritebackConversion()

bool clang::SemaObjC::isObjCWritebackConversion ( QualType FromType,
QualType ToType,
QualType & ConvertedType )

Determine whether this is an Objective-C writeback conversion, used for parameter passing when performing automatic reference counting.

Parameters
FromTypeThe type we're converting form.
ToTypeThe type we're converting to.
ConvertedTypeThe type that will be produced after applying this conversion.

Construct the type we're converting to, which is a pointer to __autoreleasing pointee.

Definition at line 1314 of file SemaObjC.cpp.

References clang::Qualifiers::compatiblyIncludes(), clang::Qualifiers::empty(), clang::Type::getAs(), clang::SemaBase::getASTContext(), clang::SemaBase::getLangOpts(), clang::Qualifiers::getObjCLifetime(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::QualType::getUnqualifiedType(), clang::Type::isObjCLifetimeType(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::SemaBase::SemaRef, clang::Qualifiers::setObjCLifetime(), and clang::Qualifiers::withoutObjCLifetime().

Referenced by IsStandardConversion(), and tryObjCWritebackConversion().

◆ isSelfExpr() [1/2]

bool SemaObjC::isSelfExpr ( Expr * RExpr)

Private Helper predicate to check for 'self'.

Definition at line 1920 of file SemaExprObjC.cpp.

References isSelfExpr(), clang::Method, and clang::SemaBase::SemaRef.

Referenced by BuildInstanceMessage(), isSelfExpr(), and LookupMethodInReceiverType().

◆ isSelfExpr() [2/2]

bool SemaObjC::isSelfExpr ( Expr * RExpr,
const ObjCMethodDecl * Method )

◆ isSignedCharBool()

bool clang::SemaObjC::isSignedCharBool ( QualType Ty)

◆ isValidOSObjectOutParameter()

bool clang::SemaObjC::isValidOSObjectOutParameter ( const Decl * D)
Returns
whether the parameter is a pointer to OSObject pointer.

Definition at line 1807 of file SemaObjC.cpp.

References clang::Type::getPointeeType(), clang::QualType::isNull(), and clang::isValidSubjectOfOSAttribute().

Referenced by ProcessDeclAttribute().

◆ IvarBacksCurrentMethodAccessor()

bool SemaObjC::IvarBacksCurrentMethodAccessor ( ObjCInterfaceDecl * IFace,
ObjCMethodDecl * Method,
ObjCIvarDecl * IV )

IvarBacksCurrentMethodAccessor - This routine returns 'true' if 'IV' is an ivar synthesized for 'Method' and 'Method' is a property accessor declared in class 'IFace'.

Definition at line 1825 of file SemaObjCProperty.cpp.

References clang::ObjCMethodDecl::getSelector(), clang::ObjCIvarDecl::getSynthesize(), clang::ObjCContainerDecl::instance_properties(), clang::ObjCMethodDecl::isPropertyAccessor(), clang::ObjCInterfaceDecl::known_extensions(), clang::ObjCInterfaceDecl::lookupMethod(), clang::Method, and clang::Property.

Referenced by BuildIvarRefExpr().

◆ LookupFactoryMethodInGlobalPool()

ObjCMethodDecl * clang::SemaObjC::LookupFactoryMethodInGlobalPool ( Selector Sel,
SourceRange R,
bool receiverIdOrClass = false )
inline

LookupFactoryMethodInGlobalPool - Returns the method and warns if there are multiple signatures.

Definition at line 864 of file SemaObjC.h.

Referenced by BuildClassMessage(), BuildInstanceMessage(), and ParseObjCSelectorExpression().

◆ LookupImplementedMethodInGlobalPool()

ObjCMethodDecl * SemaObjC::LookupImplementedMethodInGlobalPool ( Selector Sel)

LookupImplementedMethodInGlobalPool - Returns the method which has an implementation.

Definition at line 3657 of file SemaDeclObjC.cpp.

References clang::Method, and MethodPool.

Referenced by DiagnoseUseOfUnimplementedSelectors().

◆ LookupInObjCMethod()

ExprResult SemaObjC::LookupInObjCMethod ( LookupResult & LookUp,
Scope * S,
IdentifierInfo * II,
bool AllowBuiltinCreation = false )

The parser has read a name in, and Sema has detected that we're currently inside an ObjC method.

Perform some additional checks and determine if we should form a reference to an ivar. If so, build an expression referencing that ivar.

Definition at line 4847 of file SemaExprObjC.cpp.

References BuildIvarRefExpr(), clang::cast(), clang::LookupResult::empty(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::LookupResult::getNameLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUsable(), LookupIvarInObjCMethod(), and clang::SemaBase::SemaRef.

◆ LookupInstanceMethodInGlobalPool()

ObjCMethodDecl * clang::SemaObjC::LookupInstanceMethodInGlobalPool ( Selector Sel,
SourceRange R,
bool receiverIdOrClass = false )
inline

LookupInstanceMethodInGlobalPool - Returns the method and warns if there are multiple signatures.

Definition at line 855 of file SemaObjC.h.

Referenced by BuildInstanceMessage(), hasIsEqualMethod(), and ParseObjCSelectorExpression().

◆ LookupIvarInObjCMethod()

DeclResult SemaObjC::LookupIvarInObjCMethod ( LookupResult & Lookup,
Scope * S,
IdentifierInfo * II )

◆ LookupMethodInObjectType()

ObjCMethodDecl * SemaObjC::LookupMethodInObjectType ( Selector Sel,
QualType Ty,
bool IsInstance )

LookupMethodInType - Look up a method in an ObjCObjectType.

Definition at line 1938 of file SemaExprObjC.cpp.

References clang::ast_matchers::type.

Referenced by CheckKeyForObjCARCConversion(), hasIsEqualMethod(), HelperIsMethodInObjCType(), and LookupMethodInReceiverType().

◆ LookupMethodInQualifiedType()

ObjCMethodDecl * SemaObjC::LookupMethodInQualifiedType ( Selector Sel,
const ObjCObjectPointerType * OPT,
bool IsInstance )

LookupMethodInQualifiedType - Lookups up a method in protocol qualifier list of a qualified objective pointer type.

Definition at line 1962 of file SemaExprObjC.cpp.

References clang::ObjCObjectPointerType::quals().

Referenced by BuildInstanceMessage(), CheckObjCForCollectionOperand(), HandleExprPropertyRefExpr(), and hasIsEqualMethod().

◆ LookupProtocol()

◆ MatchAllMethodDeclarations()

void SemaObjC::MatchAllMethodDeclarations ( const SelectorSet & InsMap,
const SelectorSet & ClsMap,
SelectorSet & InsMapSeen,
SelectorSet & ClsMapSeen,
ObjCImplDecl * IMPDecl,
ObjCContainerDecl * IDecl,
bool & IncompleteImpl,
bool ImmediateClass,
bool WarnCategoryMethodImpl = false )

MatchAllMethodDeclarations - Check methods declaraed in interface or or protocol against those declared in their implementations.

MatchAllMethodDeclarations - Check methods declared in interface or protocol against those declared in their implementations.

Definition at line 2843 of file SemaDeclObjC.cpp.

References clang::ObjCContainerDecl::class_methods(), clang::ObjCContainerDecl::getClassMethod(), clang::ObjCContainerDecl::getInstanceMethod(), clang::ObjCContainerDecl::instance_methods(), clang::isa(), clang::ObjCMethodDecl::isSynthesizedAccessorStub(), MatchAllMethodDeclarations(), clang::SemaBase::SemaRef, WarnConflictingTypedMethods(), WarnExactTypedMethods(), and WarnUndefinedMethod().

Referenced by CheckCategoryVsClassMethodMatches(), ImplMethodsVsClassMethods(), and MatchAllMethodDeclarations().

◆ MatchTwoMethodDeclarations()

bool SemaObjC::MatchTwoMethodDeclarations ( const ObjCMethodDecl * left,
const ObjCMethodDecl * right,
MethodMatchStrategy strategy = MMS_strict )

MatchTwoMethodDeclarations - Checks if two methods' type match and returns true, or false, accordingly.

MatchTwoMethodDeclarations - Checks that two methods have matching type and returns true, or false, accordingly.

TODO: Handle protocol list; such as id<p1,p2> in type comparisons

Definition at line 3270 of file SemaDeclObjC.cpp.

References clang::SemaBase::getASTContext(), clang::SemaBase::getLangOpts(), clang::ObjCMethodDecl::getReturnType(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::ObjCMethodDecl::isDirectMethod(), clang::Decl::isUnconditionallyVisible(), matchTypes(), clang::ObjCMethodDecl::param_begin(), and clang::ObjCMethodDecl::param_end().

Referenced by ActOnAtEnd(), addMethodToGlobalList(), DiagnoseClassExtensionDupMethods(), DiagnoseMultipleMethodInGlobalPool(), and HelperToDiagnoseMismatchedMethodsInGlobalPool().

◆ parsedAttrToRetainOwnershipKind()

Sema::RetainOwnershipKind clang::SemaObjC::parsedAttrToRetainOwnershipKind ( const ParsedAttr & AL)

◆ ParseObjCEncodeExpression()

ExprResult SemaObjC::ParseObjCEncodeExpression ( SourceLocation AtLoc,
SourceLocation EncodeLoc,
SourceLocation LParenLoc,
ParsedType Ty,
SourceLocation RParenLoc )

◆ ParseObjCProtocolExpression()

ExprResult SemaObjC::ParseObjCProtocolExpression ( IdentifierInfo * ProtocolName,
SourceLocation AtLoc,
SourceLocation ProtoLoc,
SourceLocation LParenLoc,
SourceLocation ProtoIdLoc,
SourceLocation RParenLoc )

◆ ParseObjCSelectorExpression()

◆ ParseObjCStringLiteral()

◆ popObjCTypeParamList()

void SemaObjC::popObjCTypeParamList ( Scope * S,
ObjCTypeParamList * typeParamList )

Definition at line 805 of file SemaDeclObjC.cpp.

References clang::Scope::RemoveDecl(), and clang::SemaBase::SemaRef.

◆ PrepareCastToObjCObjectPointer()

CastKind SemaObjC::PrepareCastToObjCObjectPointer ( ExprResult & E)

Prepare a conversion of the given expression to an ObjC object pointer type.

Definition at line 5194 of file SemaExprObjC.cpp.

References clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::SemaBase::SemaRef, and clang::ast_matchers::type.

Referenced by clang::Sema::PerformImplicitConversion().

◆ ProcessPropertyDecl()

void SemaObjC::ProcessPropertyDecl ( ObjCPropertyDecl * property)

Process the specified property declaration and create decls for the setters and getters as needed.

ProcessPropertyDecl - Make sure that any user-defined setter/getter methods have the property type and issue diagnostics if they don't.

Parameters
propertyThe property declaration being processed

Also synthesize a getter/setter method if none exist (and update the appropriate lookup tables.

Definition at line 2365 of file SemaObjCProperty.cpp.

References clang::Decl::addAttr(), clang::DeclContext::addDecl(), AddFactoryMethodToGlobalPool(), AddInstanceMethodToGlobalPool(), AddPropertyAttrs(), clang::cast(), CheckARCMethodDecl(), CheckObjCMethodOverrides(), clang::ObjCMethodDecl::Create(), clang::ParmVarDecl::Create(), clang::ObjCMethodDecl::createImplicitParams(), clang::SemaBase::Diag(), DiagnosePropertyAccessorMismatch(), clang::SemaBase::getASTContext(), clang::Decl::getAttr(), clang::ObjCMethodDecl::getClassInterface(), clang::ObjCContainerDecl::getClassMethod(), clang::Decl::getDeclContext(), clang::ObjCPropertyDecl::getGetterName(), clang::NamedDecl::getIdentifier(), clang::ObjCContainerDecl::getInstanceMethod(), clang::SemaBase::getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCPropertyDecl::getPropertyImplementation(), clang::ObjCMethodDecl::getReturnType(), clang::ObjCMethodDecl::getSelector(), clang::ObjCPropertyDecl::getSetterName(), clang::ObjCPropertyDecl::getType(), clang::Decl::hasAttr(), clang::ObjCPropertyDecl::isDirectProperty(), clang::Decl::isInvalidDecl(), clang::ObjCPropertyDecl::isReadOnly(), clang::ObjCPropertyAttribute::kind_null_resettable, clang::NonNull, clang::Nullable, clang::Optional, clang::ObjCPropertyDecl::Optional, clang::ObjCMethodDecl::param_begin(), clang::ObjCMethodDecl::param_size(), clang::Required, RTC_Unknown, clang::SC_None, clang::SemaBase::SemaRef, clang::ObjCMethodDecl::setMethodParams(), clang::ObjCMethodDecl::setPropertyAccessor(), and clang::Unspecified.

Referenced by ActOnAtEnd(), and HandlePropertyInClassExtension().

◆ ReadMethodPool()

void SemaObjC::ReadMethodPool ( Selector Sel)

Read the contents of the method pool for a given selector from external storage.

Definition at line 3435 of file SemaDeclObjC.cpp.

References clang::SemaBase::SemaRef.

Referenced by AddClassMessageCompletions(), and CollectMultipleMethodsInGlobalPool().

◆ SelectorsForTypoCorrection()

◆ SetIvarInitializers()

◆ stripARCUnbridgedCast()

◆ tryCaptureObjCSelf()

ObjCMethodDecl * SemaObjC::tryCaptureObjCSelf ( SourceLocation Loc)

Try to capture an implicit reference to 'self'.

Definition at line 1421 of file SemaExprObjC.cpp.

References clang::ObjCMethodDecl::getSelfDecl(), and clang::SemaBase::SemaRef.

Referenced by ActOnClassPropertyRefExpr(), and ActOnSuperMessage().

◆ updateOutOfDateSelector()

void SemaObjC::updateOutOfDateSelector ( Selector Sel)

Definition at line 3440 of file SemaDeclObjC.cpp.

References clang::SemaBase::SemaRef.

◆ WarnConflictingTypedMethods()

◆ WarnExactTypedMethods()

Member Data Documentation

◆ ArrayWithObjectsMethod

ObjCMethodDecl* clang::SemaObjC::ArrayWithObjectsMethod

The declaration of the arrayWithObjects:count: method.

Definition at line 624 of file SemaObjC.h.

Referenced by BuildObjCArrayLiteral(), and SemaObjC().

◆ CFError

RecordDecl* clang::SemaObjC::CFError = nullptr

The struct behind the CFErrorRef pointer.

Definition at line 158 of file SemaObjC.h.

Referenced by isCFError().

◆ DictionaryWithObjectsMethod

ObjCMethodDecl* clang::SemaObjC::DictionaryWithObjectsMethod

The declaration of the dictionaryWithObjects:forKeys:count: method.

Definition at line 630 of file SemaObjC.h.

Referenced by BuildObjCDictionaryLiteral(), and SemaObjC().

◆ MethodPool

GlobalMethodPool clang::SemaObjC::MethodPool

Method Pool - allows efficient lookup when typechecking messages to "id".

We need to maintain a list, since selectors can have differing signatures across classes. In Cocoa, this happens to be extremely uncommon (only 1% of selectors are "overloaded"). At the head of the list it is recorded whether there were 0, 1, or >= 2 methods inside categories with a particular selector.

Definition at line 220 of file SemaObjC.h.

Referenced by AddClassMessageCompletions(), AreMultipleMethodsInGlobalPool(), CheckObjCMethodOverrides(), CollectMultipleMethodsInGlobalPool(), DiagnoseMismatchedSelectors(), LookupDirectMethodInGlobalPool(), LookupImplementedMethodInGlobalPool(), moveMethodToBackOfGlobalList(), clang::ASTReader::ReadMethodPool(), and SelectorsForTypoCorrection().

◆ NSAPIObj

◆ NSArrayDecl

ObjCInterfaceDecl* clang::SemaObjC::NSArrayDecl

The declaration of the Objective-C NSArray class.

Definition at line 621 of file SemaObjC.h.

Referenced by BuildObjCArrayLiteral(), checkArrayLiteral(), and SemaObjC().

◆ NSDictionaryDecl

ObjCInterfaceDecl* clang::SemaObjC::NSDictionaryDecl

The declaration of the Objective-C NSDictionary class.

Definition at line 627 of file SemaObjC.h.

Referenced by BuildObjCDictionaryLiteral(), checkDictionaryLiteral(), and SemaObjC().

◆ NSNumberDecl

ObjCInterfaceDecl* clang::SemaObjC::NSNumberDecl

The declaration of the Objective-C NSNumber class.

Definition at line 594 of file SemaObjC.h.

Referenced by getNSNumberFactoryMethod(), and SemaObjC().

◆ NSNumberLiteralMethods

ObjCMethodDecl* clang::SemaObjC::NSNumberLiteralMethods[NSAPI::NumNSNumberLiteralMethods]

The Objective-C NSNumber methods used to create NSNumber literals.

Definition at line 606 of file SemaObjC.h.

Referenced by getNSNumberFactoryMethod(), and clang::Sema::Sema().

◆ NSNumberPointer

QualType clang::SemaObjC::NSNumberPointer

Pointer to NSNumber type (NSNumber *).

Definition at line 600 of file SemaObjC.h.

Referenced by BuildObjCBoxedExpr(), BuildObjCNumericLiteral(), and getNSNumberFactoryMethod().

◆ NSStringDecl

ObjCInterfaceDecl* clang::SemaObjC::NSStringDecl

The declaration of the Objective-C NSString class.

Definition at line 609 of file SemaObjC.h.

Referenced by BuildObjCBoxedExpr(), and SemaObjC().

◆ NSStringPointer

QualType clang::SemaObjC::NSStringPointer

Pointer to NSString type (NSString *).

Definition at line 612 of file SemaObjC.h.

Referenced by BuildObjCBoxedExpr().

◆ NSValueDecl

ObjCInterfaceDecl* clang::SemaObjC::NSValueDecl

The declaration of the Objective-C NSValue class.

Definition at line 597 of file SemaObjC.h.

Referenced by BuildObjCBoxedExpr(), and SemaObjC().

◆ NSValuePointer

QualType clang::SemaObjC::NSValuePointer

Pointer to NSValue type (NSValue *).

Definition at line 603 of file SemaObjC.h.

Referenced by BuildObjCBoxedExpr().

◆ QIDNSCopying

QualType clang::SemaObjC::QIDNSCopying

id<NSCopying> type.

Definition at line 633 of file SemaObjC.h.

Referenced by BuildObjCDictionaryLiteral().

◆ ReferencedSelectors

llvm::MapVector<Selector, SourceLocation> clang::SemaObjC::ReferencedSelectors

Method selectors used in a @selector expression.

Used for implementation of -Wselector.

Definition at line 209 of file SemaObjC.h.

Referenced by DiagnoseUseOfUnimplementedSelectors(), ParseObjCSelectorExpression(), and RemoveSelectorFromWarningCache().

◆ RespondsToSelectorSel

Selector clang::SemaObjC::RespondsToSelectorSel

will hold 'respondsToSelector:'

Definition at line 636 of file SemaObjC.h.

Referenced by ActOnInstanceMessage().

◆ StringWithUTF8StringMethod

ObjCMethodDecl* clang::SemaObjC::StringWithUTF8StringMethod

The declaration of the stringWithUTF8String: method.

Definition at line 615 of file SemaObjC.h.

Referenced by BuildObjCBoxedExpr(), and SemaObjC().

◆ ValueWithBytesObjCTypeMethod

ObjCMethodDecl* clang::SemaObjC::ValueWithBytesObjCTypeMethod

The declaration of the valueWithBytes:objCType: method.

Definition at line 618 of file SemaObjC.h.

Referenced by BuildObjCBoxedExpr(), and SemaObjC().


The documentation for this class was generated from the following files: