diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-10-28 22:18:22 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-10-28 22:18:22 +0000 |
commit | e8ec699167a7c3a2872feefd03e0ea2fabb980e0 (patch) | |
tree | 9c6a53a26c98d54c7abc40c8a8492c501f1d685a /lib | |
parent | 27d20a24a1b816cecbd142727d2c81af5a6a111b (diff) |
Unused ivars checker: also check methods in categories that are defined in the same translation unit. Fixes <rdar://problem/6260004>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/CheckObjCUnusedIVars.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Analysis/CheckObjCUnusedIVars.cpp b/lib/Analysis/CheckObjCUnusedIVars.cpp index 6c942aaafc..2d9b53163f 100644 --- a/lib/Analysis/CheckObjCUnusedIVars.cpp +++ b/lib/Analysis/CheckObjCUnusedIVars.cpp @@ -74,6 +74,14 @@ static void Scan(IvarUsageMap& M, const ObjCContainerDecl* D) { for (ObjCImplementationDecl::propimpl_iterator I = ID->propimpl_begin(), E = ID->propimpl_end(); I!=E; ++I) Scan(M, *I); + + // Scan the associated categories as well. + for (const ObjCCategoryDecl *CD = + ID->getClassInterface()->getCategoryList(); CD ; + CD = CD->getNextClassCategory()) { + if (const ObjCCategoryImplDecl *CID = CD->getImplementation()) + Scan(M, CID); + } } } |