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

Ted Kremenek kremenek at apple.com
Mon Feb 23 08:51:39 PST 2009


Author: kremenek
Date: Mon Feb 23 10:51:39 2009
New Revision: 65321

URL: http://llvm.org/viewvc/llvm-project?rev=65321&view=rev
Log:
Per Chris L.'s suggestion, use getAsFunctionType() instead of getDesguaredType().  Constify some pointers along the way.

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=65321&r1=65320&r2=65321&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Mon Feb 23 10:51:39 2009
@@ -596,7 +596,7 @@
   enum UnaryFuncKind { cfretain, cfrelease, cfmakecollectable };  
   
 public:
-  RetainSummary* getUnarySummary(FunctionType* FT, UnaryFuncKind func);
+  RetainSummary* getUnarySummary(const FunctionType* FT, UnaryFuncKind func);
   
   RetainSummary* getCFSummaryCreateRule(FunctionDecl* FD);
   RetainSummary* getCFSummaryGetRule(FunctionDecl* FD);  
@@ -829,9 +829,9 @@
       break;
     }
     
-    // [PR 3337] Use 'getDesugaredType' to strip away any typedefs on the
+    // [PR 3337] Use 'getAsFunctionType' to strip away any typedefs on the
     // function's type.
-    FunctionType* FT = cast<FunctionType>(FD->getType()->getDesugaredType());
+    const FunctionType* FT = FD->getType()->getAsFunctionType();
     const char* FName = FD->getIdentifier()->getName();
     
     // Inspect the result type.
@@ -943,10 +943,12 @@
 }
 
 RetainSummary*
-RetainSummaryManager::getUnarySummary(FunctionType* FT, UnaryFuncKind func) {
+RetainSummaryManager::getUnarySummary(const FunctionType* FT,
+                                      UnaryFuncKind func) {
+
   // Sanity check that this is *really* a unary function.  This can
   // happen if people do weird things.
-  FunctionTypeProto* FTP = dyn_cast<FunctionTypeProto>(FT);
+  const FunctionTypeProto* FTP = dyn_cast<FunctionTypeProto>(FT);
   if (!FTP || FTP->getNumArgs() != 1)
     return getPersistentStopSummary();
   





More information about the cfe-commits mailing list