summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CheckObjCUnusedIVars.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-10-28 22:18:22 +0000
committerTed Kremenek <kremenek@apple.com>2009-10-28 22:18:22 +0000
commit1c9401ec15ccce6e8d9f94fe825de5aafc666af8 (patch)
treebe33c594c4c151698b91bfd4aac459604432bfcb /clang/lib/Analysis/CheckObjCUnusedIVars.cpp
parent3ab552ec74751a3388cf085ee5b10adcd4d2bea2 (diff)
downloadbcm5719-llvm-1c9401ec15ccce6e8d9f94fe825de5aafc666af8.tar.gz
bcm5719-llvm-1c9401ec15ccce6e8d9f94fe825de5aafc666af8.zip
Unused ivars checker: also check methods in categories that are defined in the same translation unit. Fixes <rdar://problem/6260004>.
llvm-svn: 85442
Diffstat (limited to 'clang/lib/Analysis/CheckObjCUnusedIVars.cpp')
-rw-r--r--clang/lib/Analysis/CheckObjCUnusedIVars.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Analysis/CheckObjCUnusedIVars.cpp b/clang/lib/Analysis/CheckObjCUnusedIVars.cpp
index 6c942aaafc0..2d9b53163f6 100644
--- a/clang/lib/Analysis/CheckObjCUnusedIVars.cpp
+++ b/clang/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);
+ }
}
}
OpenPOWER on IntegriCloud