diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-23 16:51:39 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-23 16:51:39 +0000 |
commit | 6ad315a4bee79827a79575c7b3aa47014bcb3849 (patch) | |
tree | 65d54624570457e7dba40ca3fdbe8d24abd5f5b7 /lib/Analysis/CFRefCount.cpp | |
parent | 279d896d4972417f62537fe4a87a8c3c3d675108 (diff) |
Per Chris L.'s suggestion, use getAsFunctionType() instead of getDesguaredType(). Constify some pointers along the way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 3816c560b3..efd1c85f2b 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -596,7 +596,7 @@ class VISIBILITY_HIDDEN RetainSummaryManager { 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 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) { 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 @@ RetainSummaryManager::getCFCreateGetRuleSummary(FunctionDecl* FD, } 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(); |