clang API Documentation
#include <DeclObjC.h>
Public Types | |
enum | ImplementationControl { None, Required, Optional } |
typedef const ParmVarDecl *const * | param_const_iterator |
typedef ParmVarDecl *const * | param_iterator |
typedef llvm::iterator_range < param_iterator > | param_range |
typedef llvm::iterator_range < param_const_iterator > | param_const_range |
typedef std::const_mem_fun_t < QualType, ParmVarDecl > | deref_fun |
typedef llvm::mapped_iterator < param_const_iterator, deref_fun > | param_type_iterator |
Public Member Functions | |
ObjCMethodDecl * | getCanonicalDecl () override |
Retrieves the "canonical" declaration of the given declaration. | |
const ObjCMethodDecl * | getCanonicalDecl () const |
ObjCDeclQualifier | getObjCDeclQualifier () const |
void | setObjCDeclQualifier (ObjCDeclQualifier QV) |
bool | hasRelatedResultType () const |
Determine whether this method has a result type that is related to the message receiver's type. | |
void | SetRelatedResultType (bool RRT=true) |
Note whether this method has a related result type. | |
bool | isRedeclaration () const |
True if this is a method redeclaration in the same interface. | |
void | setAsRedeclaration (const ObjCMethodDecl *PrevMethod) |
SourceLocation | getDeclaratorEndLoc () const |
Returns the location where the declarator ends. It will be the location of ';' for a method declaration and the location of '{' for a method definition. | |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
SourceRange | getSourceRange () const override LLVM_READONLY |
Source range that this declaration covers. | |
SourceLocation | getSelectorStartLoc () const |
SourceLocation | getSelectorLoc (unsigned Index) const |
void | getSelectorLocs (SmallVectorImpl< SourceLocation > &SelLocs) const |
unsigned | getNumSelectorLocs () const |
ObjCInterfaceDecl * | getClassInterface () |
const ObjCInterfaceDecl * | getClassInterface () const |
Selector | getSelector () const |
QualType | getReturnType () const |
void | setReturnType (QualType T) |
SourceRange | getReturnTypeSourceRange () const |
QualType | getSendResultType () const |
Determine the type of an expression that sends a message to this function. | |
TypeSourceInfo * | getReturnTypeSourceInfo () const |
void | setReturnTypeSourceInfo (TypeSourceInfo *TInfo) |
unsigned | param_size () const |
param_range | params () |
param_const_range | params () const |
param_const_iterator | param_begin () const |
param_const_iterator | param_end () const |
param_iterator | param_begin () |
param_iterator | param_end () |
param_const_iterator | sel_param_end () const |
ArrayRef< ParmVarDecl * > | parameters () const |
void | setMethodParams (ASTContext &C, ArrayRef< ParmVarDecl * > Params, ArrayRef< SourceLocation > SelLocs=llvm::None) |
Sets the method's parameters and selector source locations. If the method is implicit (not coming from source) SelLocs is ignored. | |
param_type_iterator | param_type_begin () const |
param_type_iterator | param_type_end () const |
void | createImplicitParams (ASTContext &Context, const ObjCInterfaceDecl *ID) |
ImplicitParamDecl * | getSelfDecl () const |
void | setSelfDecl (ImplicitParamDecl *SD) |
ImplicitParamDecl * | getCmdDecl () const |
void | setCmdDecl (ImplicitParamDecl *CD) |
ObjCMethodFamily | getMethodFamily () const |
Determines the family of this method. | |
bool | isInstanceMethod () const |
void | setInstanceMethod (bool isInst) |
bool | isVariadic () const |
void | setVariadic (bool isVar) |
bool | isClassMethod () const |
bool | isPropertyAccessor () const |
void | setPropertyAccessor (bool isAccessor) |
bool | isDefined () const |
void | setDefined (bool isDefined) |
bool | isOverriding () const |
Whether this method overrides any other in the class hierarchy. | |
void | setOverriding (bool isOverriding) |
void | getOverriddenMethods (SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const |
Return overridden methods for the given Method . | |
bool | hasSkippedBody () const |
True if the method was a definition but its body was skipped. | |
void | setHasSkippedBody (bool Skipped=true) |
const ObjCPropertyDecl * | findPropertyDecl (bool CheckOverrides=true) const |
Returns the property associated with this method's selector. | |
void | setDeclImplementation (ImplementationControl ic) |
ImplementationControl | getImplementationControl () const |
bool | isThisDeclarationADesignatedInitializer () const |
bool | isDesignatedInitializerForTheInterface (const ObjCMethodDecl **InitMethod=nullptr) const |
bool | hasBody () const override |
Determine whether this method has a body. | |
Stmt * | getBody () const override |
Retrieve the body of this method, if it has one. | |
void | setLazyBody (uint64_t Offset) |
CompoundStmt * | getCompoundBody () |
void | setBody (Stmt *B) |
bool | isThisDeclarationADefinition () const |
Returns whether this specific method is a definition. | |
Static Public Member Functions | |
static ObjCMethodDecl * | Create (ASTContext &C, SourceLocation beginLoc, SourceLocation endLoc, Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance=true, bool isVariadic=false, bool isPropertyAccessor=false, bool isImplicitlyDeclared=false, bool isDefined=false, ImplementationControl impControl=None, bool HasRelatedResultType=false) |
static ObjCMethodDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
static DeclContext * | castToDeclContext (const ObjCMethodDecl *D) |
static ObjCMethodDecl * | castFromDeclContext (const DeclContext *DC) |
Friends | |
class | ASTDeclReader |
class | ASTDeclWriter |
ObjCMethodDecl - Represents an instance or class method declaration. ObjC methods can be declared within 4 contexts: class interfaces, categories, protocols, and class implementations. While C++ member functions leverage C syntax, Objective-C method syntax is modeled after Smalltalk (using colons to specify argument types/expressions). Here are some brief examples:
Setter/getter instance methods:
Instance method that takes 2 NSView arguments:
Getter class method: + (NSMenu *)defaultMenu;
A selector represents a unique name for a method. The selector names for the above methods are setMenu:, menu, replaceSubview:with:, and defaultMenu.
Definition at line 113 of file DeclObjC.h.
typedef std::const_mem_fun_t<QualType, ParmVarDecl> clang::ObjCMethodDecl::deref_fun |
Definition at line 385 of file DeclObjC.h.
typedef const ParmVarDecl* const* clang::ObjCMethodDecl::param_const_iterator |
Definition at line 345 of file DeclObjC.h.
typedef llvm::iterator_range<param_const_iterator> clang::ObjCMethodDecl::param_const_range |
Definition at line 348 of file DeclObjC.h.
typedef ParmVarDecl* const* clang::ObjCMethodDecl::param_iterator |
Definition at line 346 of file DeclObjC.h.
typedef llvm::iterator_range<param_iterator> clang::ObjCMethodDecl::param_range |
Definition at line 347 of file DeclObjC.h.
typedef llvm::mapped_iterator<param_const_iterator, deref_fun> clang::ObjCMethodDecl::param_type_iterator |
Definition at line 387 of file DeclObjC.h.
Definition at line 115 of file DeclObjC.h.
static ObjCMethodDecl* clang::ObjCMethodDecl::castFromDeclContext | ( | const DeclContext * | DC | ) | [inline, static] |
Reimplemented from clang::Decl.
Definition at line 496 of file DeclObjC.h.
static DeclContext* clang::ObjCMethodDecl::castToDeclContext | ( | const ObjCMethodDecl * | D | ) | [inline, static] |
Definition at line 493 of file DeclObjC.h.
static bool clang::ObjCMethodDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::NamedDecl.
Definition at line 491 of file DeclObjC.h.
References classofKind(), and clang::Decl::getKind().
static bool clang::ObjCMethodDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::NamedDecl.
Definition at line 492 of file DeclObjC.h.
Referenced by classof().
ObjCMethodDecl * ObjCMethodDecl::Create | ( | ASTContext & | C, |
SourceLocation | beginLoc, | ||
SourceLocation | endLoc, | ||
Selector | SelInfo, | ||
QualType | T, | ||
TypeSourceInfo * | ReturnTInfo, | ||
DeclContext * | contextDecl, | ||
bool | isInstance = true , |
||
bool | isVariadic = false , |
||
bool | isPropertyAccessor = false , |
||
bool | isImplicitlyDeclared = false , |
||
bool | isDefined = false , |
||
ImplementationControl | impControl = None , |
||
bool | HasRelatedResultType = false |
||
) | [static] |
Definition at line 642 of file DeclObjC.cpp.
References AttributeLangSupport::C.
Referenced by clang::Sema::ActOnMethodDeclaration(), clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCDictionaryLiteral(), createImplicitParams(), getNSNumberFactoryMethod(), clang::Sema::ProcessPropertyDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
ObjCMethodDecl * ObjCMethodDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID | ||
) | [static] |
Definition at line 654 of file DeclObjC.cpp.
References AttributeLangSupport::C.
void ObjCMethodDecl::createImplicitParams | ( | ASTContext & | Context, |
const ObjCInterfaceDecl * | ID | ||
) |
createImplicitParams - Used to lazily create the self and cmd implict parameters. This must be called prior to using getSelfDecl() or getCmdDecl(). The call is ignored if the implicit paramters have already been created.
Definition at line 893 of file DeclObjC.cpp.
References Create(), clang::ImplicitParamDecl::Create(), clang::IdentifierTable::get(), clang::ASTContext::getLangOpts(), getMethodFamily(), clang::ASTContext::getObjCClassType(), clang::ASTContext::getObjCIdType(), clang::ASTContext::getObjCInterfaceType(), clang::ASTContext::getObjCObjectPointerType(), clang::ASTContext::getObjCSelType(), clang::ASTContext::getQualifiedType(), clang::ASTContext::Idents, isClassMethod(), isInstanceMethod(), clang::Qualifiers::OCL_Strong, clang::OMF_init, setCmdDecl(), clang::Qualifiers::setObjCLifetime(), setSelfDecl(), and clang::QualType::withConst().
Referenced by clang::Sema::ActOnStartOfObjCMethodDef(), and clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod().
const ObjCPropertyDecl * ObjCMethodDecl::findPropertyDecl | ( | bool | CheckOverrides = true | ) | const |
Returns the property associated with this method's selector.
Note that even if this particular method is not marked as a property accessor, it is still possible for it to match a property declared in a superclass. Pass false
if you only want to check the current class.
Definition at line 1097 of file DeclObjC.cpp.
References clang::ObjCPropertyDecl::findPropertyDecl(), getMethodFamily(), clang::Selector::getNumArgs(), getOverriddenMethods(), clang::DeclContext::getParent(), getSelector(), isInstanceMethod(), isPropertyAccessor(), clang::OMF_None, and clang::ObjCContainerDecl::properties().
Referenced by clang::Sema::BuildInstanceMessage(), clang::Sema::CheckObjCBridgeRelatedConversions(), DiagnoseARCUseOfWeakReceiver(), clang::BodyFarm::getBody(), clang::ASTContext::getCommentForDecl(), and clang::Sema::GetIvarBackingPropertyAccessor().
Stmt * ObjCMethodDecl::getBody | ( | ) | const [override, virtual] |
Retrieve the body of this method, if it has one.
Reimplemented from clang::Decl.
Definition at line 676 of file DeclObjC.cpp.
References clang::LazyOffsetPtr< T, OffsT, Get >::get(), and clang::Decl::getASTContext().
Referenced by checkObjCDealloc(), clang::CodeGen::CodeGenFunction::GenerateObjCMethod(), getCompoundBody(), getLocEnd(), hasSuperInitCall(), and clang::ASTDeclWriter::VisitObjCMethodDecl().
ObjCMethodDecl * ObjCMethodDecl::getCanonicalDecl | ( | ) | [override, virtual] |
Retrieves the "canonical" declaration of the given declaration.
Reimplemented from clang::Decl.
Definition at line 771 of file DeclObjC.cpp.
References clang::Decl::getDeclContext(), getSelector(), isInstanceMethod(), and isRedeclaration().
Referenced by clang::BodyFarm::getBody(), and getCanonicalDecl().
const ObjCMethodDecl* clang::ObjCMethodDecl::getCanonicalDecl | ( | ) | const [inline] |
Reimplemented from clang::Decl.
Definition at line 265 of file DeclObjC.h.
References getCanonicalDecl().
Definition at line 951 of file DeclObjC.cpp.
References clang::Decl::getDeclContext().
Referenced by clang::Sema::ActOnStartOfObjCMethodDef(), clang::Sema::ActOnSuperMessage(), AddSuperSendCompletion(), clang::ObjCMethodCall::canBeOverridenInSubclass(), clang::Sema::checkInitMethod(), clang::Sema::CheckObjCMethodOverrides(), CompareReturnTypes(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), clang::CodeGen::CodeGenFunction::GenerateObjCMethod(), getClassInterface(), clang::Sema::GetIvarBackingPropertyAccessor(), getMethodReceiverIfKnownImmutable(), isDesignatedInitializerForTheInterface(), clang::Sema::LookupInObjCMethod(), LookupMemberExpr(), LookupMethodInReceiverType(), ReplaceWithClasstype(), and shouldRunOnFunctionOrMethod().
const ObjCInterfaceDecl* clang::ObjCMethodDecl::getClassInterface | ( | ) | const [inline] |
Definition at line 324 of file DeclObjC.h.
References getClassInterface().
ImplicitParamDecl* clang::ObjCMethodDecl::getCmdDecl | ( | ) | const [inline] |
Definition at line 404 of file DeclObjC.h.
Referenced by clang::Sema::ActOnStartOfObjCMethodDef(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), and clang::ASTDeclWriter::VisitObjCMethodDecl().
CompoundStmt* clang::ObjCMethodDecl::getCompoundBody | ( | ) | [inline] |
Definition at line 484 of file DeclObjC.h.
References getBody().
Referenced by cleanupDeallocOrFinalize().
SourceLocation clang::ObjCMethodDecl::getDeclaratorEndLoc | ( | ) | const [inline] |
Returns the location where the declarator ends. It will be the location of ';' for a method declaration and the location of '{' for a method definition.
Definition at line 288 of file DeclObjC.h.
Referenced by rewriteToObjCProperty().
ImplementationControl clang::ObjCMethodDecl::getImplementationControl | ( | ) | const [inline] |
Definition at line 459 of file DeclObjC.h.
Referenced by clang::Sema::ParseObjCSelectorExpression(), clang::ASTDeclWriter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), and clang::Sema::WarnExactTypedMethods().
SourceLocation ObjCMethodDecl::getLocEnd | ( | ) | const |
Reimplemented from clang::Decl.
Definition at line 795 of file DeclObjC.cpp.
References getBody().
Referenced by getSourceRange(), clang::ASTDeclWriter::VisitObjCMethodDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
SourceLocation clang::ObjCMethodDecl::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Decl.
Definition at line 291 of file DeclObjC.h.
References clang::Decl::getLocation().
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), clang::CodeGen::CodeGenFunction::GenerateObjCGetter(), clang::CodeGen::CodeGenFunction::GenerateObjCMethod(), clang::CodeGen::CodeGenFunction::GenerateObjCSetter(), getSelectorStartLoc(), ReplaceWithClasstype(), ReplaceWithInstancetype(), rewriteToObjCProperty(), and WarnUndefinedMethod().
Determines the family of this method.
Definition at line 801 of file DeclObjC.cpp.
References clang::Selector::getMethodFamily(), getReturnType(), getSelector(), clang::InvalidObjCMethodFamily, isInstanceMethod(), clang::Type::isObjCIdType(), clang::Type::isObjCSelType(), 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, param_size(), and param_type_begin().
Referenced by clang::Sema::ActOnMethodDeclaration(), clang::Sema::ActOnStartOfObjCMethodDef(), clang::Sema::BuildClassMessage(), clang::Sema::BuildInstanceMessage(), clang::Sema::CheckARCMethodDecl(), checkMethodFamilyMismatch(), clang::Sema::CheckObjCMethodOverride(), createImplicitParams(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::Sema::EmitRelatedResultTypeNoteForReturn(), findPropertyDecl(), clang::ObjCMessageExpr::getMethodFamily(), handleObjCRequiresSuperAttr(), isDesignatedInitializerForTheInterface(), isInitializationMethod(), isThisDeclarationADesignatedInitializer(), clang::Sema::LookupInObjCMethod(), and clang::Sema::MaybeBindToTemporary().
unsigned clang::ObjCMethodDecl::getNumSelectorLocs | ( | ) | const [inline] |
Definition at line 314 of file DeclObjC.h.
References clang::Selector::getNumArgs(), getSelector(), clang::Decl::isImplicit(), and clang::Selector::isUnarySelector().
Referenced by getSelectorLoc(), and getSelectorLocs().
ObjCDeclQualifier clang::ObjCMethodDecl::getObjCDeclQualifier | ( | ) | const [inline] |
Definition at line 269 of file DeclObjC.h.
Referenced by CheckMethodOverrideReturn(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::ASTContext::getObjCEncodingForMethodDecl(), clang::ASTContext::ObjCMethodsAreEqual(), and clang::ASTDeclWriter::VisitObjCMethodDecl().
void ObjCMethodDecl::getOverriddenMethods | ( | SmallVectorImpl< const ObjCMethodDecl * > & | Overridden | ) | const |
Return overridden methods for the given Method
.
An ObjC method is considered to override any method in the class's base classes (and base's categories), its protocols, or its categories' protocols, that has the same selector and is of the same kind (class or instance). A method in an implementation is not considered as overriding the same method in the interface or its categories.
Definition at line 1080 of file DeclObjC.cpp.
References collectOverriddenMethodsSlow(), clang::Decl::getDeclContext(), getSelector(), isInstanceMethod(), isOverriding(), and isRedeclaration().
Referenced by findExplicitInstancetypeDeclarer(), findPropertyDecl(), and clang::ASTContext::getOverriddenMethods().
QualType clang::ObjCMethodDecl::getReturnType | ( | ) | const [inline] |
Definition at line 330 of file DeclObjC.h.
Referenced by AdjustRelatedResultType(), clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), clang::Sema::BuildClassMessage(), clang::Sema::BuildInstanceMessage(), clang::Sema::CheckARCMethodDecl(), clang::Sema::checkInitMethod(), clang::Sema::CheckMessageArgumentTypes(), checkMethodFamilyMismatch(), CheckMethodOverrideReturn(), clang::Sema::CheckObjCMethodOverride(), CheckRelatedResultTypeCompatibility(), clang::Sema::CodeCompleteObjCMethodDecl(), CompareReturnTypes(), DiagnoseARCUseOfWeakReceiver(), clang::Sema::DiagnosePropertyAccessorMismatch(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExprLValue(), clang::Sema::EmitRelatedResultTypeNote(), clang::Sema::EmitRelatedResultTypeNoteForReturn(), clang::comments::DeclInfo::fill(), findExplicitInstancetypeDeclarer(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::ObjCPropertyRefExpr::getGetterResultType(), getMethodFamily(), clang::ASTContext::getObjCEncodingForMethodDecl(), getSendResultType(), handleObjCMethodFamilyAttr(), hasIsEqualMethod(), isAcceptableMethodMismatch(), clang::Sema::MatchTwoMethodDeclarations(), clang::ASTContext::ObjCMethodsAreEqual(), clang::Sema::ProcessPropertyDecl(), ReplaceWithInstancetype(), rewriteToObjCProperty(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), validateBoxingMethod(), clang::ASTDeclWriter::VisitObjCMethodDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
TypeSourceInfo* clang::ObjCMethodDecl::getReturnTypeSourceInfo | ( | ) | const [inline] |
Definition at line 340 of file DeclObjC.h.
Referenced by getReturnTypeSourceRange(), ReplaceWithClasstype(), ReplaceWithInstancetype(), clang::ASTDeclWriter::VisitObjCMethodDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
Definition at line 963 of file DeclObjC.cpp.
References getReturnTypeSourceInfo().
Referenced by clang::Sema::CheckARCMethodDecl(), CheckMethodOverrideReturn(), and clang::Sema::CheckObjCMethodOverride().
Selector clang::ObjCMethodDecl::getSelector | ( | ) | const [inline] |
Definition at line 328 of file DeclObjC.h.
References clang::NamedDecl::getDeclName(), and clang::DeclarationName::getObjCSelector().
Referenced by clang::Sema::ActOnAtEnd(), clang::Sema::ActOnMethodDeclaration(), clang::Sema::ActOnStartOfObjCMethodDef(), clang::Sema::ActOnSuperMessage(), addRedeclaredMethods(), AddSuperSendCompletion(), clang::Sema::BuildInstanceMessage(), clang::Sema::CheckMessageArgumentTypes(), clang::Sema::CheckObjCBridgeRelatedConversions(), clang::Sema::CheckObjCMethodOverrides(), clang::Sema::CodeCompleteObjCMethodDecl(), CollectOverriddenMethodsRecurse(), collectOverriddenMethodsSlow(), CompareReturnTypes(), DiagnoseARCUseOfWeakReceiver(), clang::Sema::DiagnoseMissingDesignatedInitOverrides(), clang::Sema::DiagnosePropertyAccessorMismatch(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::Sema::EmitRelatedResultTypeNote(), findExplicitInstancetypeDeclarer(), findPropertyDecl(), getCanonicalDecl(), clang::ObjCPropertyRefExpr::getGetterSelector(), clang::Sema::GetIvarBackingPropertyAccessor(), getMethodFamily(), getNumSelectorLocs(), getOverriddenMethods(), getSelectorLoc(), clang::ObjCPropertyRefExpr::getSetterSelector(), HelperSelectorsForTypoCorrection(), HelperToDiagnoseMismatchedMethodsInGlobalPool(), isAcceptableMethodMismatch(), isAcceptableObjCMethod(), isDesignatedInitializerForTheInterface(), clang::Sema::IvarBacksCurrentMethodAccessor(), clang::MangleContext::mangleObjCMethodName(), moveMethodToBackOfGlobalList(), clang::Sema::ProcessPropertyDecl(), rewriteToObjCProperty(), sel_param_end(), setMethodParams(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), and clang::Sema::WarnExactTypedMethods().
SourceLocation clang::ObjCMethodDecl::getSelectorLoc | ( | unsigned | Index | ) | const [inline] |
Definition at line 302 of file DeclObjC.h.
References getNumSelectorLocs(), getSelector(), clang::getStandardSelectorLoc(), parameters(), and clang::SelLoc_StandardWithSpace.
Referenced by clang::Sema::CheckARCMethodDecl(), getSelectorLocs(), and getSelectorStartLoc().
void ObjCMethodDecl::getSelectorLocs | ( | SmallVectorImpl< SourceLocation > & | SelLocs | ) | const |
Definition at line 702 of file DeclObjC.cpp.
References getNumSelectorLocs(), and getSelectorLoc().
Referenced by clang::ASTNodeImporter::VisitObjCMethodDecl().
SourceLocation clang::ObjCMethodDecl::getSelectorStartLoc | ( | ) | const [inline] |
Definition at line 297 of file DeclObjC.h.
References getLocStart(), getSelectorLoc(), and clang::Decl::isImplicit().
Referenced by cleanupDeallocOrFinalize(), and rewriteToObjCProperty().
ImplicitParamDecl* clang::ObjCMethodDecl::getSelfDecl | ( | ) | const [inline] |
Definition at line 402 of file DeclObjC.h.
Referenced by clang::Sema::ActOnStartOfObjCMethodDef(), clang::CodeGen::CodeGenTypes::arrangeObjCMethodDeclaration(), CheckForModifiableLvalue(), createObjCPropertyGetter(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), findRetainCycleOwner(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::Expr::isObjCSelfExpr(), clang::Sema::isSelfExpr(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), clang::Sema::tryCaptureObjCSelf(), tryRemoveRetainOfSelf(), clang::CodeGen::CodeGenFunction::TypeOfSelfObject(), and clang::ASTDeclWriter::VisitObjCMethodDecl().
QualType clang::ObjCMethodDecl::getSendResultType | ( | ) | const [inline] |
Determine the type of an expression that sends a message to this function.
Definition at line 336 of file DeclObjC.h.
References clang::Decl::getASTContext(), clang::QualType::getNonLValueExprType(), and getReturnType().
Referenced by clang::Sema::getMessageSendResultType().
SourceRange clang::ObjCMethodDecl::getSourceRange | ( | ) | const [inline, override, virtual] |
Source range that this declaration covers.
Reimplemented from clang::Decl.
Definition at line 293 of file DeclObjC.h.
References clang::Decl::getLocation(), and getLocEnd().
Referenced by clang::Sema::CheckMessageArgumentTypes(), cleanupDeallocOrFinalize(), and GCRewriteFinalize().
bool clang::ObjCMethodDecl::hasBody | ( | ) | const [inline, override, virtual] |
Determine whether this method has a body.
Reimplemented from clang::Decl.
Definition at line 477 of file DeclObjC.h.
References clang::LazyOffsetPtr< T, OffsT, Get >::isValid().
Referenced by isThisDeclarationADefinition().
bool clang::ObjCMethodDecl::hasRelatedResultType | ( | ) | const [inline] |
Determine whether this method has a result type that is related to the message receiver's type.
Definition at line 276 of file DeclObjC.h.
Referenced by clang::Sema::ActOnMethodDeclaration(), AdjustRelatedResultType(), clang::Sema::CheckObjCMethodOverride(), clang::Sema::CheckObjCMethodOverrides(), clang::Sema::EmitRelatedResultTypeNote(), clang::Sema::EmitRelatedResultTypeNoteForReturn(), clang::Sema::getMessageSendResultType(), clang::ASTDeclWriter::VisitObjCMethodDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
bool clang::ObjCMethodDecl::hasSkippedBody | ( | ) | const [inline] |
True if the method was a definition but its body was skipped.
Definition at line 445 of file DeclObjC.h.
bool clang::ObjCMethodDecl::isClassMethod | ( | ) | const [inline] |
Definition at line 415 of file DeclObjC.h.
Referenced by clang::Sema::ActOnMethodDeclaration(), CheckForModifiableLvalue(), createImplicitParams(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::Sema::GetIvarBackingPropertyAccessor(), clang::Sema::LookupInObjCMethod(), and clang::Sema::WarnExactTypedMethods().
bool clang::ObjCMethodDecl::isDefined | ( | ) | const [inline] |
Definition at line 420 of file DeclObjC.h.
Referenced by clang::Sema::addMethodToGlobalList(), clang::Sema::LookupImplementedMethodInGlobalPool(), setDefined(), clang::ASTDeclWriter::VisitObjCMethodDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
bool ObjCMethodDecl::isDesignatedInitializerForTheInterface | ( | const ObjCMethodDecl ** | InitMethod = nullptr | ) | const |
Returns true if the method selector resolves to a designated initializer in the class's interface.
InitMethod | if non-null and the function returns true, it receives the method declaration that was marked with the designated initializer attribute. |
Definition at line 664 of file DeclObjC.cpp.
References getClassInterface(), clang::Decl::getDeclContext(), getMethodFamily(), getSelector(), and clang::OMF_init.
Referenced by clang::Sema::ActOnStartOfObjCMethodDef(), and clang::Sema::BuildInstanceMessage().
bool clang::ObjCMethodDecl::isInstanceMethod | ( | ) | const [inline] |
Definition at line 410 of file DeclObjC.h.
Referenced by clang::Sema::ActOnAtEnd(), clang::Sema::ActOnMethodDeclaration(), clang::Sema::ActOnStartOfObjCMethodDef(), clang::Sema::ActOnSuperMessage(), clang::Sema::AddAnyMethodToGlobalPool(), addRedeclaredMethods(), AddSuperSendCompletion(), clang::Sema::BuildInstanceMessage(), clang::Sema::CheckObjCMethodOverrides(), CollectOverriddenMethodsRecurse(), collectOverriddenMethodsSlow(), createImplicitParams(), clang::Sema::DiagnoseClassExtensionDupMethods(), clang::Sema::EmitRelatedResultTypeNote(), clang::comments::DeclInfo::fill(), findExplicitInstancetypeDeclarer(), findPropertyDecl(), GetAssumedMessageSendExprType(), getCanonicalDecl(), clang::Sema::getMessageSendResultType(), clang::ObjCContainerDecl::getMethod(), getMethodFamily(), getOverriddenMethods(), clang::ObjCContainerDecl::HasUserDeclaredSetterMethod(), isAcceptableMethodMismatch(), clang::Sema::IvarBacksCurrentMethodAccessor(), clang::Sema::LookupInObjCMethod(), clang::MangleContext::mangleObjCMethodName(), moveMethodToBackOfGlobalList(), ReplaceWithInstancetype(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), clang::ASTDeclWriter::VisitObjCMethodDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
bool clang::ObjCMethodDecl::isOverriding | ( | ) | const [inline] |
Whether this method overrides any other in the class hierarchy.
A method is said to override any method in the class's base classes, its protocols, or its categories' protocols, that has the same selector and is of the same kind (class or instance). A method in an implementation is not considered as overriding the same method in the interface or its categories.
Definition at line 430 of file DeclObjC.h.
Referenced by clang::Sema::ActOnMethodDeclaration(), clang::ObjCMethodCall::canBeOverridenInSubclass(), clang::Sema::CheckObjCMethodOverrides(), collectOverriddenMethodsSlow(), getOverriddenMethods(), and setOverriding().
bool clang::ObjCMethodDecl::isPropertyAccessor | ( | ) | const [inline] |
Definition at line 417 of file DeclObjC.h.
Referenced by clang::Sema::CheckObjCBridgeRelatedConversions(), clang::Sema::DiagnoseUnusedExprResult(), findPropertyDecl(), clang::BodyFarm::getBody(), clang::ASTContext::getCommentForDecl(), clang::Sema::GetIvarBackingPropertyAccessor(), clang::Sema::IvarBacksCurrentMethodAccessor(), clang::ASTDeclWriter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), and wasSynthesizedProperty().
bool clang::ObjCMethodDecl::isRedeclaration | ( | ) | const [inline] |
True if this is a method redeclaration in the same interface.
Definition at line 282 of file DeclObjC.h.
Referenced by getCanonicalDecl(), and getOverriddenMethods().
bool clang::ObjCMethodDecl::isThisDeclarationADefinition | ( | ) | const [inline] |
Returns whether this specific method is a definition.
Definition at line 488 of file DeclObjC.h.
References hasBody().
Returns true if this specific method declaration is marked with the designated initializer attribute.
Definition at line 659 of file DeclObjC.cpp.
References getMethodFamily(), and clang::OMF_init.
bool clang::ObjCMethodDecl::isVariadic | ( | ) | const [inline] |
Definition at line 412 of file DeclObjC.h.
Referenced by AddSuperSendCompletion(), clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), clang::Sema::CheckConflictingOverridingMethod(), clang::Sema::CheckMessageArgumentTypes(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::ASTContext::ObjCMethodsAreEqual(), clang::ASTDeclWriter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::Sema::WarnConflictingTypedMethods(), and clang::Sema::WarnExactTypedMethods().
param_const_iterator clang::ObjCMethodDecl::param_begin | ( | ) | const [inline] |
Definition at line 355 of file DeclObjC.h.
Referenced by clang::Sema::ActOnStartOfObjCMethodDef(), AddSuperSendCompletion(), clang::Sema::CheckConflictingOverridingMethod(), clang::Sema::CheckObjCMethodOverride(), clang::Sema::CheckObjCMethodOverrides(), clang::Sema::CodeCompleteObjCMethodDecl(), emitCPPObjectAtomicSetterCall(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), emitStructSetterCall(), clang::comments::DeclInfo::fill(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::ASTContext::getObjCEncodingForMethodDecl(), clang::ObjCPropertyRefExpr::getSetterArgType(), clang::Sema::MatchTwoMethodDeclarations(), clang::Sema::mergeObjCMethodDecls(), clang::ASTContext::ObjCMethodsAreEqual(), param_type_begin(), params(), clang::Sema::ProcessPropertyDecl(), rewriteToObjCProperty(), sel_param_end(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::Sema::WarnConflictingTypedMethods(), and clang::Sema::WarnExactTypedMethods().
param_iterator clang::ObjCMethodDecl::param_begin | ( | ) | [inline] |
Definition at line 361 of file DeclObjC.h.
param_const_iterator clang::ObjCMethodDecl::param_end | ( | ) | const [inline] |
Definition at line 358 of file DeclObjC.h.
Referenced by clang::Sema::ActOnStartOfObjCMethodDef(), AddSuperSendCompletion(), clang::Sema::CheckConflictingOverridingMethod(), clang::Sema::CheckObjCMethodOverride(), clang::Sema::CheckObjCMethodOverrides(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::Sema::MatchTwoMethodDeclarations(), clang::Sema::mergeObjCMethodDecls(), clang::ASTContext::ObjCMethodsAreEqual(), param_type_end(), params(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::Sema::WarnConflictingTypedMethods(), and clang::Sema::WarnExactTypedMethods().
param_iterator clang::ObjCMethodDecl::param_end | ( | ) | [inline] |
Definition at line 362 of file DeclObjC.h.
unsigned clang::ObjCMethodDecl::param_size | ( | ) | const [inline] |
Definition at line 344 of file DeclObjC.h.
Referenced by AddSuperSendCompletion(), clang::Sema::CheckMessageArgumentTypes(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::comments::DeclInfo::fill(), clang::BodyFarm::getBody(), getMethodFamily(), clang::ASTContext::ObjCMethodsAreEqual(), clang::Sema::ProcessPropertyDecl(), clang::ASTDeclWriter::VisitObjCMethodDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
param_type_iterator clang::ObjCMethodDecl::param_type_begin | ( | ) | const [inline] |
Definition at line 389 of file DeclObjC.h.
References clang::ValueDecl::getType(), and param_begin().
Referenced by getMethodFamily().
param_type_iterator clang::ObjCMethodDecl::param_type_end | ( | ) | const [inline] |
Definition at line 392 of file DeclObjC.h.
References clang::ValueDecl::getType(), and param_end().
ArrayRef<ParmVarDecl*> clang::ObjCMethodDecl::parameters | ( | ) | const [inline] |
Definition at line 372 of file DeclObjC.h.
Referenced by clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCDictionaryLiteral(), CheckKeyForObjCARCConversion(), clang::Sema::CheckMessageArgumentTypes(), clang::ObjCMethodCall::getInitialStackFrameContents(), getPreferredArgumentTypeForMessageSend(), getSelectorLoc(), hasIsEqualMethod(), and clang::ObjCMethodCall::parameters().
param_range clang::ObjCMethodDecl::params | ( | ) | [inline] |
Definition at line 350 of file DeclObjC.h.
References param_begin(), and param_end().
Referenced by clang::Sema::ActOnStartOfObjCMethodDef(), clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), clang::ASTDeclWriter::VisitObjCMethodDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
param_const_range clang::ObjCMethodDecl::params | ( | ) | const [inline] |
Definition at line 351 of file DeclObjC.h.
References param_begin(), and param_end().
param_const_iterator clang::ObjCMethodDecl::sel_param_end | ( | ) | const [inline] |
Definition at line 366 of file DeclObjC.h.
References clang::Selector::getNumArgs(), getSelector(), and param_begin().
Referenced by clang::ASTContext::getObjCEncodingForMethodDecl().
void ObjCMethodDecl::setAsRedeclaration | ( | const ObjCMethodDecl * | PrevMethod | ) |
Definition at line 680 of file DeclObjC.cpp.
References clang::Decl::getASTContext(), and clang::ASTContext::setObjCMethodRedeclaration().
Referenced by clang::Sema::ActOnAtEnd().
void clang::ObjCMethodDecl::setBody | ( | Stmt * | B | ) | [inline] |
Definition at line 485 of file DeclObjC.h.
void clang::ObjCMethodDecl::setCmdDecl | ( | ImplicitParamDecl * | CD | ) | [inline] |
Definition at line 405 of file DeclObjC.h.
Referenced by createImplicitParams(), and clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setDeclImplementation | ( | ImplementationControl | ic | ) | [inline] |
Definition at line 456 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setDefined | ( | bool | isDefined | ) | [inline] |
Definition at line 421 of file DeclObjC.h.
References isDefined().
Referenced by clang::Sema::addMethodToGlobalList(), and clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setHasSkippedBody | ( | bool | Skipped = true | ) | [inline] |
Definition at line 446 of file DeclObjC.h.
void clang::ObjCMethodDecl::setInstanceMethod | ( | bool | isInst | ) | [inline] |
Definition at line 411 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setLazyBody | ( | uint64_t | Offset | ) | [inline] |
Definition at line 482 of file DeclObjC.h.
void ObjCMethodDecl::setMethodParams | ( | ASTContext & | C, |
ArrayRef< ParmVarDecl * > | Params, | ||
ArrayRef< SourceLocation > | SelLocs = llvm::None |
||
) |
Sets the method's parameters and selector source locations. If the method is implicit (not coming from source) SelLocs
is ignored.
Definition at line 708 of file DeclObjC.cpp.
References getSelector(), clang::hasStandardSelectorLocs(), clang::Decl::isImplicit(), and clang::SelLoc_NonStandard.
Referenced by clang::Sema::ActOnMethodDeclaration(), clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCDictionaryLiteral(), getNSNumberFactoryMethod(), clang::Sema::ProcessPropertyDecl(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setObjCDeclQualifier | ( | ObjCDeclQualifier | QV | ) | [inline] |
Definition at line 272 of file DeclObjC.h.
Referenced by clang::Sema::ActOnMethodDeclaration(), and clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setOverriding | ( | bool | isOverriding | ) | [inline] |
Definition at line 431 of file DeclObjC.h.
References isOverriding().
Referenced by clang::Sema::CheckObjCMethodOverrides().
void clang::ObjCMethodDecl::setPropertyAccessor | ( | bool | isAccessor | ) | [inline] |
Definition at line 418 of file DeclObjC.h.
Referenced by clang::Sema::ProcessPropertyDecl(), and clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::SetRelatedResultType | ( | bool | RRT = true | ) | [inline] |
Note whether this method has a related result type.
Definition at line 279 of file DeclObjC.h.
Referenced by clang::Sema::ActOnMethodDeclaration(), clang::Sema::CheckObjCMethodOverrides(), and clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setReturnType | ( | QualType | T | ) | [inline] |
Definition at line 331 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setReturnTypeSourceInfo | ( | TypeSourceInfo * | TInfo | ) | [inline] |
Definition at line 341 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setSelfDecl | ( | ImplicitParamDecl * | SD | ) | [inline] |
Definition at line 403 of file DeclObjC.h.
Referenced by createImplicitParams(), and clang::ASTDeclReader::VisitObjCMethodDecl().
void clang::ObjCMethodDecl::setVariadic | ( | bool | isVar | ) | [inline] |
Definition at line 413 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCMethodDecl().
friend class ASTDeclReader [friend] |
Reimplemented from clang::DeclContext.
Definition at line 500 of file DeclObjC.h.
friend class ASTDeclWriter [friend] |
Reimplemented from clang::Decl.
Definition at line 501 of file DeclObjC.h.