forked from OSchip/llvm-project
Constify ASTContext::getObjContainingInterface
llvm-svn: 174282
This commit is contained in:
parent
82700578d4
commit
37527c242a
|
@ -1982,7 +1982,7 @@ public:
|
|||
/// \brief Returns the Objective-C interface that \p ND belongs to if it is
|
||||
/// an Objective-C method/property/ivar etc. that is part of an interface,
|
||||
/// otherwise returns null.
|
||||
ObjCInterfaceDecl *getObjContainingInterface(NamedDecl *ND) const;
|
||||
const ObjCInterfaceDecl *getObjContainingInterface(const NamedDecl *ND) const;
|
||||
|
||||
/// \brief Set the copy inialization expression of a block var decl.
|
||||
void setBlockVarCopyInits(VarDecl*VD, Expr* Init);
|
||||
|
|
|
@ -1805,12 +1805,16 @@ void ASTContext::setObjCImplementation(ObjCCategoryDecl *CatD,
|
|||
ObjCImpls[CatD] = ImplD;
|
||||
}
|
||||
|
||||
ObjCInterfaceDecl *ASTContext::getObjContainingInterface(NamedDecl *ND) const {
|
||||
if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(ND->getDeclContext()))
|
||||
const ObjCInterfaceDecl *ASTContext::getObjContainingInterface(
|
||||
const NamedDecl *ND) const {
|
||||
if (const ObjCInterfaceDecl *ID =
|
||||
dyn_cast<ObjCInterfaceDecl>(ND->getDeclContext()))
|
||||
return ID;
|
||||
if (ObjCCategoryDecl *CD = dyn_cast<ObjCCategoryDecl>(ND->getDeclContext()))
|
||||
if (const ObjCCategoryDecl *CD =
|
||||
dyn_cast<ObjCCategoryDecl>(ND->getDeclContext()))
|
||||
return CD->getClassInterface();
|
||||
if (ObjCImplDecl *IMD = dyn_cast<ObjCImplDecl>(ND->getDeclContext()))
|
||||
if (const ObjCImplDecl *IMD =
|
||||
dyn_cast<ObjCImplDecl>(ND->getDeclContext()))
|
||||
return IMD->getClassInterface();
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue