diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-07-16 19:50:32 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-07-16 19:50:32 +0000 |
commit | 0556048ae8ff743d0abb9fa88a0d0ee8e9123742 (patch) | |
tree | 7aa752e9a8585a50224fe2bc11c3375e42032def /lib/StaticAnalyzer | |
parent | 57080fbac1ccce702255423335d52e81bcf17b6b (diff) |
[analyzer] Place checking for Core Foundation "Create" rule into a proper API. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp | 2 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Core/CFRefCount.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp index 235b400eb9..9fc8163ab8 100644 --- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -606,7 +606,7 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(ObjCMessage msg, continue; // Ignore CF references, which can be toll-free bridged. - if (cocoa::isCFObjectRef(ArgTy)) + if (coreFoundation::isCFObjectRef(ArgTy)) continue; // Generate only one error node to use for all bug reports. diff --git a/lib/StaticAnalyzer/Core/CFRefCount.cpp b/lib/StaticAnalyzer/Core/CFRefCount.cpp index 8306b7f524..bf53029208 100644 --- a/lib/StaticAnalyzer/Core/CFRefCount.cpp +++ b/lib/StaticAnalyzer/Core/CFRefCount.cpp @@ -1135,8 +1135,7 @@ RetainSummary* RetainSummaryManager::getSummary(const FunctionDecl* FD) { RetainSummary* RetainSummaryManager::getCFCreateGetRuleSummary(const FunctionDecl* FD, StringRef FName) { - if (FName.find("Create") != StringRef::npos || - FName.find("Copy") != StringRef::npos) + if (coreFoundation::followsCreateRule(FName)) return getCFSummaryCreateRule(FD); return getCFSummaryGetRule(FD); @@ -1206,7 +1205,8 @@ RetainSummaryManager::getInitMethodSummary(QualType RetTy) { assert(ScratchArgs.isEmpty()); // 'init' methods conceptually return a newly allocated object and claim // the receiver. - if (cocoa::isCocoaObjectRef(RetTy) || cocoa::isCFObjectRef(RetTy)) + if (cocoa::isCocoaObjectRef(RetTy) || + coreFoundation::isCFObjectRef(RetTy)) return getPersistentSummary(ObjCInitRetE, DecRefMsg); return getDefaultSummary(); @@ -1356,7 +1356,7 @@ RetainSummaryManager::getCommonMethodSummary(const ObjCMethodDecl* MD, } // Look for methods that return an owned core foundation object. - if (cocoa::isCFObjectRef(RetTy)) { + if (coreFoundation::isCFObjectRef(RetTy)) { RetEffect E = cocoa::followsFundamentalRule(S, MD) ? RetEffect::MakeOwned(RetEffect::CF, true) : RetEffect::MakeNotOwned(RetEffect::CF); |