diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-02-03 13:23:21 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-02-03 13:23:21 +0000 |
commit | b35cc2d46c4188a0b2d094b3104ce69092c34802 (patch) | |
tree | ec2c14dbf8238c121fe83696ed3166990315a397 /lib/AST/ASTContext.cpp | |
parent | e414cc167815e773e4fd27e44943734d54160cab (diff) |
Constify ASTContext::getObjContainingInterface
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174282 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 5d15573038..f97e6e9119 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -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; |