From: Ted Kremenek Date: Wed, 11 Feb 2009 07:10:07 +0000 (+0000) Subject: Per PR 3187, disable the missing -dealloc check for classes that subclass SenTestCase. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8cb6fb3bd80d0b051f37c31d8658666361b5b7bb;p=clang Per PR 3187, disable the missing -dealloc check for classes that subclass SenTestCase. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64292 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CheckObjCDealloc.cpp b/lib/Analysis/CheckObjCDealloc.cpp index dda25017c3..a14ae26512 100644 --- a/lib/Analysis/CheckObjCDealloc.cpp +++ b/lib/Analysis/CheckObjCDealloc.cpp @@ -121,11 +121,23 @@ void clang::CheckObjCDealloc(ObjCImplementationDecl* D, // Determine if the class subclasses NSObject. IdentifierInfo* NSObjectII = &Ctx.Idents.get("NSObject"); + IdentifierInfo* SenTestCaseII = &Ctx.Idents.get("SenTestCase"); + - for ( ; ID ; ID = ID->getSuperClass()) - if (ID->getIdentifier() == NSObjectII) + for ( ; ID ; ID = ID->getSuperClass()) { + IdentifierInfo *II = ID->getIdentifier(); + + if (II == NSObjectII) break; - + + // FIXME: For now, ignore classes that subclass SenTestCase, as these don't + // need to implement -dealloc. They implement tear down in another way, + // which we should try and catch later. + // http://llvm.org/bugs/show_bug.cgi?id=3187 + if (II == SenTestCaseII) + return; + } + if (!ID) return;