diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-04-23 21:25:57 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-04-23 21:25:57 +0000 |
commit | 0a1f9c423fb98e0e2037a99a9cd80359a50cba99 (patch) | |
tree | b06ab975b7f7edaf30418d33139feb13e2536d8c /clang/lib/Analysis/CFRefCount.cpp | |
parent | 196ac3c69a04bad1f1aa41faabc95b7a77bb6805 (diff) | |
download | bcm5719-llvm-0a1f9c423fb98e0e2037a99a9cd80359a50cba99.tar.gz bcm5719-llvm-0a1f9c423fb98e0e2037a99a9cd80359a50cba99.zip |
retain/release checker: Don't call isTrackedObject() with the canonical type.
This was preventing the checker from tracking return objects referenced by 'id'.
llvm-svn: 69922
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | clang/lib/Analysis/CFRefCount.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 98221fe32bd..575a47b7766 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -703,7 +703,7 @@ public: RetainSummary* getSummary(FunctionDecl* FD); RetainSummary* getMethodSummary(ObjCMessageExpr* ME, ObjCInterfaceDecl* ID); - RetainSummary* getClassMethodSummary(ObjCMessageExpr *ME, Selector S); + RetainSummary* getClassMethodSummary(ObjCMessageExpr *ME); bool isGCEnabled() const { return GCEnabled; } }; @@ -1071,7 +1071,7 @@ RetainSummaryManager::getMethodSummary(ObjCMessageExpr* ME, return getInitMethodSummary(ME); // Look for methods that return an owned object. - if (!isTrackedObjectType(Ctx.getCanonicalType(ME->getType()))) + if (!isTrackedObjectType(ME->getType())) return 0; // EXPERIMENTAL: Assume the Cocoa conventions for all objects returned @@ -1089,13 +1089,13 @@ RetainSummaryManager::getMethodSummary(ObjCMessageExpr* ME, } RetainSummary* -RetainSummaryManager::getClassMethodSummary(ObjCMessageExpr* ME, - Selector S) { +RetainSummaryManager::getClassMethodSummary(ObjCMessageExpr* ME) { // FIXME: Eventually we should properly do class method summaries, but // it requires us being able to walk the type hierarchy. Unfortunately, // we cannot do this with just an IdentifierInfo* for the class name. IdentifierInfo* ClsName = ME->getClassName(); + Selector S = ME->getSelector(); // Look up a summary in our cache of Selectors -> Summaries. ObjCMethodSummariesTy::iterator I = ObjCClassMethodSummaries.find(ClsName, S); @@ -1104,15 +1104,13 @@ RetainSummaryManager::getClassMethodSummary(ObjCMessageExpr* ME, return I->second; // Look for methods that return an owned object. - if (!isTrackedObjectType(Ctx.getCanonicalType(ME->getType()))) + if (!isTrackedObjectType(ME->getType())) return 0; // EXPERIMENTAL: Assume the Cocoa conventions for all objects returned // by class methods. // Look for methods that return an owned object. - if (!isTrackedObjectType(Ctx.getCanonicalType(ME->getType()))) - return 0; - + const char* s = S.getIdentifierInfoForSlot(0)->getName(); RetEffect E = followsFundamentalRule(s) ? (isGCEnabled() ? RetEffect::MakeNotOwned(RetEffect::ObjC) @@ -2014,7 +2012,7 @@ void CFRefCount::EvalObjCMessageExpr(ExplodedNodeSet<GRState>& Dst, } } else - Summ = Summaries.getClassMethodSummary(ME, ME->getSelector()); + Summ = Summaries.getClassMethodSummary(ME); EvalSummary(Dst, Eng, Builder, ME, ME->getReceiver(), Summ, ME->arg_begin(), ME->arg_end(), Pred); |