summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CheckObjCUnusedIVars.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis/CheckObjCUnusedIVars.cpp')
-rw-r--r--clang/lib/Analysis/CheckObjCUnusedIVars.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Analysis/CheckObjCUnusedIVars.cpp b/clang/lib/Analysis/CheckObjCUnusedIVars.cpp
index 57fad8d86b6..7979f9c942e 100644
--- a/clang/lib/Analysis/CheckObjCUnusedIVars.cpp
+++ b/clang/lib/Analysis/CheckObjCUnusedIVars.cpp
@@ -61,7 +61,8 @@ void clang::CheckObjCUnusedIvar(ObjCImplementationDecl* D, BugReporter& BR) {
IvarUsageMap M;
-
+ ASTContext &Ctx = BR.getContext();
+
// Iterate over the ivars.
for (ObjCInterfaceDecl::ivar_iterator I=ID->ivar_begin(), E=ID->ivar_end();
I!=E; ++I) {
@@ -83,14 +84,14 @@ void clang::CheckObjCUnusedIvar(ObjCImplementationDecl* D, BugReporter& BR) {
return;
// Now scan the methods for accesses.
- for (ObjCImplementationDecl::instmeth_iterator I = D->instmeth_begin(),
- E = D->instmeth_end(); I!=E; ++I)
- Scan(M, (*I)->getBody(BR.getContext()));
+ for (ObjCImplementationDecl::instmeth_iterator I = D->instmeth_begin(Ctx),
+ E = D->instmeth_end(Ctx); I!=E; ++I)
+ Scan(M, (*I)->getBody(Ctx));
// Scan for @synthesized property methods that act as setters/getters
// to an ivar.
- for (ObjCImplementationDecl::propimpl_iterator I = D->propimpl_begin(),
- E = D->propimpl_end(); I!=E; ++I)
+ for (ObjCImplementationDecl::propimpl_iterator I = D->propimpl_begin(Ctx),
+ E = D->propimpl_end(Ctx); I!=E; ++I)
Scan(M, *I);
// Find ivars that are unused.
OpenPOWER on IntegriCloud