Skip to content

Commit

Permalink
[analyzer] Remove check covered by -Wobjc-missing-super-calls.
Browse files Browse the repository at this point in the history
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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216272 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
jrose-apple committed Aug 22, 2014
1 parent 99ef95c commit 1292e09
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -181,24 +160,6 @@ static void checkObjCDealloc(const CheckerBase *Checker,
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");
Selector RS = Ctx.Selectors.getSelector(0, &RII);
Expand Down

0 comments on commit 1292e09

Please sign in to comment.