]> granicus.if.org Git - clang/commitdiff
Stub out some code for support for NSDeallocateObject. This is enabled yet until
authorTed Kremenek <kremenek@apple.com>
Tue, 17 Mar 2009 22:43:44 +0000 (22:43 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 17 Mar 2009 22:43:44 +0000 (22:43 +0000)
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

lib/Analysis/CFRefCount.cpp

index 7382e1a7ac8fadc1b7f4c350f39ece4587695b0f..8b3ad8ddab65180db445f517cf4725662ee8661f 100644 (file)
@@ -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.  <rdar://problem/6619988>
+#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) {