[analyzer] Ivar Invalidation: track ivars in continuations and
@implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166047 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp b/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
index 462066a..e52e3d4 100644
--- a/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
@@ -314,12 +314,12 @@
   // Collect all ivars that need cleanup.
   IvarSet Ivars;
   const ObjCInterfaceDecl *InterfaceD = D->getClassInterface();
-  for (ObjCInterfaceDecl::ivar_iterator
-      II = InterfaceD->ivar_begin(),
-      IE = InterfaceD->ivar_end(); II != IE; ++II) {
-    const ObjCIvarDecl *Iv = *II;
+
+  // Collect ivars declared in this class, its extensions and its implementation
+  ObjCInterfaceDecl *IDecl = const_cast<ObjCInterfaceDecl *>(InterfaceD);
+  for (const ObjCIvarDecl *Iv = IDecl->all_declared_ivar_begin(); Iv;
+       Iv= Iv->getNextIvar())
     trackIvar(Iv, Ivars);
-  }
 
   // Construct Property/Property Accessor to Ivar maps to assist checking if an
   // ivar which is backing a property has been reset.