summaryrefslogtreecommitdiff
path: root/clang/lib/Analysis/RetainSummaryManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis/RetainSummaryManager.cpp')
-rw-r--r--clang/lib/Analysis/RetainSummaryManager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Analysis/RetainSummaryManager.cpp b/clang/lib/Analysis/RetainSummaryManager.cpp
index 6f46917b2dfc6..9f45a8efe546f 100644
--- a/clang/lib/Analysis/RetainSummaryManager.cpp
+++ b/clang/lib/Analysis/RetainSummaryManager.cpp
@@ -140,12 +140,15 @@ RetainSummaryManager::getPersistentSummary(const RetainSummary &OldSumm) {
static bool isSubclass(const Decl *D,
StringRef ClassName) {
using namespace ast_matchers;
- DeclarationMatcher SubclassM = cxxRecordDecl(isSameOrDerivedFrom(ClassName));
+ DeclarationMatcher SubclassM =
+ cxxRecordDecl(isSameOrDerivedFrom(std::string(ClassName)));
return !(match(SubclassM, *D, D->getASTContext()).empty());
}
static bool isOSObjectSubclass(const Decl *D) {
- return D && isSubclass(D, "OSMetaClassBase");
+ // OSSymbols are particular OSObjects that are allocated globally
+ // and therefore aren't really refcounted, so we ignore them.
+ return D && isSubclass(D, "OSMetaClassBase") && !isSubclass(D, "OSSymbol");
}
static bool isOSObjectDynamicCast(StringRef S) {
@@ -662,6 +665,7 @@ RetainSummaryManager::getSummary(AnyCall C,
switch (C.getKind()) {
case AnyCall::Function:
case AnyCall::Constructor:
+ case AnyCall::InheritedConstructor:
case AnyCall::Allocator:
case AnyCall::Deallocator:
Summ = getFunctionSummary(cast_or_null<FunctionDecl>(C.getDecl()));