]> granicus.if.org Git - clang/commitdiff
IOServiceGetMatchingServices is a release function.
authorTed Kremenek <kremenek@apple.com>
Wed, 29 Oct 2008 04:07:07 +0000 (04:07 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 29 Oct 2008 04:07:07 +0000 (04:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58362 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFRefCount.cpp

index 21c2ecf4b944a603e309c040340228f57ab5661c..fe7a1989704f57838441008a5a584f9fb906f56b 100644 (file)
@@ -533,7 +533,7 @@ public:
                                       ArgEffect ReceiverEff = DoNothing,
                                       ArgEffect DefaultEff = MayEscape,
                                       bool isEndPath = false);
-                 
+
   RetainSummary* getPersistentSummary(RetEffect RE,
                                       ArgEffect ReceiverEff = DoNothing,
                                       ArgEffect DefaultEff = MayEscape) {
@@ -546,7 +546,7 @@ public:
     
     StopSummary = getPersistentSummary(RetEffect::MakeNoRet(),
                                        StopTracking, StopTracking);
-    
+
     return StopSummary;
   }  
 
@@ -728,6 +728,18 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) {
         S = getCGSummary(FD, FName );
         break;
       }
+      
+      // FIXME: This should all be refactored into a chain of "summary lookup"
+      //  filters.
+      if (strcmp(FName, "IOServiceGetMatchingServices") == 0) {
+        // FIXES: <rdar://problem/6326900>
+        // This should be addressed using a API table.  This strcmp is also
+        // a little gross, but there is no need to super optimize here.
+        assert (ScratchArgs.empty());
+        ScratchArgs.push_back(std::make_pair(1, DecRef));
+        S = getPersistentSummary(RetEffect::MakeNoRet(), DoNothing, DoNothing);
+        break;
+      }
     }
 
     if (FName[0] == 'C') {