From: Ted Kremenek Date: Tue, 17 Mar 2009 22:43:44 +0000 (+0000) Subject: Stub out some code for support for NSDeallocateObject. This is enabled yet until X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61991903335144605031c3597a5c99e1565b0bd4;p=clang Stub out some code for support for NSDeallocateObject. This is enabled yet until we resolve the semantics of this function when GC is enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67116 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 7382e1a7ac..8b3ad8ddab 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -867,6 +867,18 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) { S = getPersistentSummary(RetEffect::MakeNoRet(), DoNothing, DoNothing); break; } + + // Enable this code once the semantics of NSDeallocateObject are resolved + // for GC. +#if 0 + // Handle: NSDeallocateObject(id anObject); + // This method does allow 'nil' (although we don't check it now). + if (strcmp(FName, "NSDeallocateObject") == 0) { + return RetTy == Ctx.VoidTy + ? getPersistentSummary(RetEffect::MakeNoRet(), DoNothing, Dealloc) + : getPersistentStopSummary(); + } +#endif // Handle: id NSMakeCollectable(CFTypeRef) if (strcmp(FName, "NSMakeCollectable") == 0) {