[cfe-commits] r54699 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Tue Aug 12 13:41:59 PDT 2008


Author: kremenek
Date: Tue Aug 12 15:41:56 2008
New Revision: 54699

URL: http://llvm.org/viewvc/llvm-project?rev=54699&view=rev
Log:
More cleanups.  Add missing #include.

Modified:
    cfe/trunk/lib/Analysis/CFRefCount.cpp

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=54699&r1=54698&r2=54699&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue Aug 12 15:41:56 2008
@@ -29,6 +29,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include <ostream>
 #include <sstream>
+#include <stdarg.h>
 
 using namespace clang;
 using llvm::CStrInCStrNoCase;
@@ -375,7 +376,7 @@
     return I;
   }
   
-  
+
   iterator find(Expr* Receiver, Selector S) {
     return find(getReceiverDecl(Receiver), S);
   }
@@ -450,13 +451,7 @@
   
   /// Ctx - The ASTContext object for the analyzed ASTs.
   ASTContext& Ctx;
-  
-  /// NSWindowII - An IdentifierInfo* representing the identifier "NSWindow."
-  IdentifierInfo* NSWindowII;
 
-  /// NSPanelII - An IdentifierInfo* representing the identifier "NSPanel."
-  IdentifierInfo* NSPanelII;
-  
   /// CFDictionaryCreateII - An IdentifierInfo* representing the indentifier
   ///  "CFDictionaryCreate".
   IdentifierInfo* CFDictionaryCreateII;
@@ -513,14 +508,12 @@
                                       ArgEffect DefaultEff = MayEscape,
                                       bool isEndPath = false);
                  
-
   RetainSummary* getPersistentSummary(RetEffect RE,
                                       ArgEffect ReceiverEff = DoNothing,
                                       ArgEffect DefaultEff = MayEscape) {
     return getPersistentSummary(getArgEffects(), RE, ReceiverEff, DefaultEff);
   }
   
-  
   RetainSummary* getPersistentStopSummary() {
     if (StopSummary)
       return StopSummary;
@@ -549,14 +542,6 @@
     ObjCMethodSummaries[S] = Summ;
   }
   
-  void addNSWindowMethSummary(Selector S, RetainSummary *Summ) {
-    ObjCMethodSummaries[ObjCSummaryKey(NSWindowII, S)] = Summ;
-  }
-  
-  void addNSPanelMethSummary(Selector S, RetainSummary *Summ) {
-    ObjCMethodSummaries[ObjCSummaryKey(NSPanelII, S)] = Summ;
-  }
-  
   void addInstMethSummary(const char* Cls, RetainSummary* Summ, va_list argp) {
     
     IdentifierInfo* ClsII = &Ctx.Idents.get(Cls);
@@ -589,8 +574,6 @@
   
   RetainSummaryManager(ASTContext& ctx, bool gcenabled)
    : Ctx(ctx),
-     NSWindowII(&ctx.Idents.get("NSWindow")),
-     NSPanelII(&ctx.Idents.get("NSPanel")),
      CFDictionaryCreateII(&ctx.Idents.get("CFDictionaryCreate")),
      GCEnabled(gcenabled), StopSummary(0) {
 
@@ -841,6 +824,7 @@
       
     default:
       assert (false && "Not a supported unary function.");
+      return 0;
   }
 }
 
@@ -999,11 +983,11 @@
   RetainSummary* Summ = getPersistentSummary(E);  
   
   // Create the "copy" selector.  
-  addNSObjectMethSummary(GetNullarySelector("copy", Ctx), Summ);
-  
+  addNSObjectMethSummary(GetNullarySelector("copy", Ctx), Summ);  
+
   // Create the "mutableCopy" selector.
   addNSObjectMethSummary(GetNullarySelector("mutableCopy", Ctx), Summ);
-
+  
   // Create the "retain" selector.
   E = RetEffect::MakeReceiverAlias();
   Summ = getPersistentSummary(E, isGCEnabled() ? DoNothing : IncRef);
@@ -1020,7 +1004,7 @@
   // Create the "autorelease" selector.
   Summ = getPersistentSummary(E, isGCEnabled() ? DoNothing : Autorelease);
   addNSObjectMethSummary(GetNullarySelector("autorelease", Ctx), Summ);
-
+  
   // For NSWindow, allocated objects are (initially) self-owned.  
   RetainSummary *NSWindowSumm =
     getPersistentSummary(RetEffect::MakeReceiverAlias(), SelfOwn);
@@ -1128,15 +1112,6 @@
     return RefVal(ReturnedNotOwned);
   }
   
-  // State creation: errors.
-
-#if 0
-  static RefVal makeLeak(unsigned Count) { return RefVal(ErrorLeak, Count); }  
-  static RefVal makeReleased() { return RefVal(Released); }
-  static RefVal makeUseAfterRelease() { return RefVal(ErrorUseAfterRelease); }
-  static RefVal makeReleaseNotOwned() { return RefVal(ErrorReleaseNotOwned); }
-#endif
-  
   // Comparison, profiling, and pretty-printing.
   
   bool operator==(const RefVal& X) const {





More information about the cfe-commits mailing list