r216272 - [analyzer] Remove check covered by -Wobjc-missing-super-calls.
Jordan Rose
jordan_rose at apple.com
Fri Aug 22 09:57:33 PDT 2014
Author: jrose
Date: Fri Aug 22 11:57:33 2014
New Revision: 216272
URL: http://llvm.org/viewvc/llvm-project?rev=216272&view=rev
Log:
[analyzer] Remove check covered by -Wobjc-missing-super-calls.
The ObjCDealloc checker is currently disabled because it was too aggressive, but this
is a good first step in getting it back to a useful state.
Patch by David Kilzer!
Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp?rev=216272&r1=216271&r2=216272&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp Fri Aug 22 11:57:33 2014
@@ -28,27 +28,6 @@
using namespace clang;
using namespace ento;
-static bool scan_dealloc(Stmt *S, Selector Dealloc) {
-
- if (ObjCMessageExpr *ME = dyn_cast<ObjCMessageExpr>(S))
- if (ME->getSelector() == Dealloc) {
- switch (ME->getReceiverKind()) {
- case ObjCMessageExpr::Instance: return false;
- case ObjCMessageExpr::SuperInstance: return true;
- case ObjCMessageExpr::Class: break;
- case ObjCMessageExpr::SuperClass: break;
- }
- }
-
- // Recurse to children.
-
- for (Stmt::child_iterator I = S->child_begin(), E= S->child_end(); I!=E; ++I)
- if (*I && scan_dealloc(*I, Dealloc))
- return true;
-
- return false;
-}
-
static bool scan_ivar_release(Stmt *S, ObjCIvarDecl *ID,
const ObjCPropertyDecl *PD,
Selector Release,
@@ -180,24 +159,6 @@ static void checkObjCDealloc(const Check
os.str(), DLoc);
return;
}
-
- // dealloc found. Scan for missing [super dealloc].
- if (MD->getBody() && !scan_dealloc(MD->getBody(), S)) {
-
- const char* name = LOpts.getGC() == LangOptions::NonGC
- ? "missing [super dealloc]"
- : "missing [super dealloc] (Hybrid MM, non-GC)";
-
- std::string buf;
- llvm::raw_string_ostream os(buf);
- os << "The 'dealloc' instance method in Objective-C class '" << *D
- << "' does not send a 'dealloc' message to its super class"
- " (missing [super dealloc])";
-
- BR.EmitBasicReport(MD, Checker, name, categories::CoreFoundationObjectiveC,
- os.str(), DLoc);
- return;
- }
// Get the "release" selector.
IdentifierInfo* RII = &Ctx.Idents.get("release");
More information about the cfe-commits
mailing list