Coverage Report

Created: 2022-07-16 07:03

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Analysis/RetainSummaryManager.cpp
Line
Count
Source (jump to first uncovered line)
1
//== RetainSummaryManager.cpp - Summaries for reference counting --*- C++ -*--//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
//  This file defines summaries implementation for retain counting, which
10
//  implements a reference count checker for Core Foundation, Cocoa
11
//  and OSObject (on Mac OS X).
12
//
13
//===----------------------------------------------------------------------===//
14
15
#include "clang/Analysis/DomainSpecific/CocoaConventions.h"
16
#include "clang/Analysis/RetainSummaryManager.h"
17
#include "clang/AST/Attr.h"
18
#include "clang/AST/DeclCXX.h"
19
#include "clang/AST/DeclObjC.h"
20
#include "clang/AST/ParentMap.h"
21
#include "clang/ASTMatchers/ASTMatchFinder.h"
22
23
using namespace clang;
24
using namespace ento;
25
26
template <class T>
27
0
constexpr static bool isOneOf() {
28
0
  return false;
29
0
}
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr>()
30
31
/// Helper function to check whether the class is one of the
32
/// rest of varargs.
33
template <class T, class P, class... ToCompare>
34
0
constexpr static bool isOneOf() {
35
0
  return std::is_same<T, P>::value || isOneOf<T, ToCompare...>();
36
0
}
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSReturnsAutoreleasedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::CFConsumedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<(anonymous namespace)::GeneralizedConsumedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnNonZeroAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSReturnsRetainedOnZeroAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::OSConsumesThisAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::CFConsumedAttr, clang::CFReturnsRetainedAttr, clang::CFReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::NSConsumedAttr, clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSConsumesSelfAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::NSReturnsRetainedAttr, clang::NSReturnsAutoreleasedAttr, clang::NSReturnsNotRetainedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, clang::OSConsumedAttr, clang::OSConsumesThisAttr, clang::OSReturnsNotRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnZeroAttr, clang::OSReturnsRetainedOnNonZeroAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
Unexecuted instantiation: RetainSummaryManager.cpp:bool isOneOf<clang::NSConsumesSelfAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr, (anonymous namespace)::GeneralizedConsumedAttr>()
37
38
namespace {
39
40
/// Fake attribute class for RC* attributes.
41
struct GeneralizedReturnsRetainedAttr {
42
160
  static bool classof(const Attr *A) {
43
160
    if (auto AA = dyn_cast<AnnotateAttr>(A))
44
11
      return AA->getAnnotation() == "rc_ownership_returns_retained";
45
149
    return false;
46
160
  }
47
};
48
49
struct GeneralizedReturnsNotRetainedAttr {
50
131
  static bool classof(const Attr *A) {
51
131
    if (auto AA = dyn_cast<AnnotateAttr>(A))
52
1
      return AA->getAnnotation() == "rc_ownership_returns_not_retained";
53
130
    return false;
54
131
  }
55
};
56
57
struct GeneralizedConsumedAttr {
58
50
  static bool classof(const Attr *A) {
59
50
    if (auto AA = dyn_cast<AnnotateAttr>(A))
60
17
      return AA->getAnnotation() == "rc_ownership_consumed";
61
33
    return false;
62
50
  }
63
};
64
65
}
66
67
template <class T>
68
Optional<ObjKind> RetainSummaryManager::hasAnyEnabledAttrOf(const Decl *D,
69
48.2k
                                                            QualType QT) {
70
48.2k
  ObjKind K;
71
48.2k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
48.2k
              CFReturnsNotRetainedAttr>()) {
73
10.8k
    if (!TrackObjCAndCFObjects)
74
22
      return None;
75
76
10.8k
    K = ObjKind::CF;
77
37.3k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
37.3k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
37.3k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
10.2k
    if (!TrackObjCAndCFObjects)
82
26
      return None;
83
84
10.1k
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
10.1k
                NSReturnsNotRetainedAttr>() &&
86
10.1k
        
!cocoa::isCocoaObjectRef(QT)7.28k
)
87
5.92k
      return None;
88
4.27k
    K = ObjKind::ObjC;
89
27.1k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
27.1k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
27.1k
                     OSReturnsRetainedOnZeroAttr,
92
27.1k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
16.3k
    if (!TrackOSObjects)
94
14.7k
      return None;
95
1.61k
    K = ObjKind::OS;
96
10.7k
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
10.7k
                     GeneralizedReturnsRetainedAttr,
98
10.7k
                     GeneralizedConsumedAttr>()) {
99
10.7k
    K = ObjKind::Generalized;
100
10.7k
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
27.5k
  if (D->hasAttr<T>())
104
210
    return K;
105
27.3k
  return None;
106
27.5k
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::NSReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
2.50k
                                                            QualType QT) {
70
2.50k
  ObjKind K;
71
2.50k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
2.50k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
2.50k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
2.50k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
2.50k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
2.50k
    if (!TrackObjCAndCFObjects)
82
8
      return None;
83
84
2.49k
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
2.49k
                NSReturnsNotRetainedAttr>() &&
86
2.49k
        !cocoa::isCocoaObjectRef(QT))
87
2.00k
      return None;
88
483
    K = ObjKind::ObjC;
89
483
  } else 
if (0
isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
0
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
0
                     OSReturnsRetainedOnZeroAttr,
92
0
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
0
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
483
  if (D->hasAttr<T>())
104
30
    return K;
105
453
  return None;
106
483
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::CFReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
4.46k
                                                            QualType QT) {
70
4.46k
  ObjKind K;
71
4.46k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
4.46k
              CFReturnsNotRetainedAttr>()) {
73
4.46k
    if (!TrackObjCAndCFObjects)
74
10
      return None;
75
76
4.45k
    K = ObjKind::CF;
77
4.45k
  } else 
if (0
isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
0
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
0
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
0
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
0
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
0
                     OSReturnsRetainedOnZeroAttr,
92
0
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
0
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
4.45k
  if (D->hasAttr<T>())
104
49
    return K;
105
4.40k
  return None;
106
4.45k
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
4.41k
                                                            QualType QT) {
70
4.41k
  ObjKind K;
71
4.41k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
4.41k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
4.41k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
4.41k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
4.41k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
4.41k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
4.41k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
4.41k
                     OSReturnsRetainedOnZeroAttr,
92
4.41k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
4.41k
    if (!TrackOSObjects)
94
3.96k
      return None;
95
453
    K = ObjKind::OS;
96
453
  } else 
if (0
isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
453
  if (D->hasAttr<T>())
104
12
    return K;
105
441
  return None;
106
453
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<(anonymous namespace)::GeneralizedReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
4.39k
                                                            QualType QT) {
70
4.39k
  ObjKind K;
71
4.39k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
4.39k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
4.39k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
4.39k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
4.39k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
4.39k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
4.39k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
4.39k
                     OSReturnsRetainedOnZeroAttr,
92
4.39k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
4.39k
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
4.39k
                     GeneralizedReturnsRetainedAttr,
98
4.39k
                     GeneralizedConsumedAttr>()) {
99
4.39k
    K = ObjKind::Generalized;
100
4.39k
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
4.39k
  if (D->hasAttr<T>())
104
9
    return K;
105
4.39k
  return None;
106
4.39k
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::CFReturnsNotRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
4.39k
                                                            QualType QT) {
70
4.39k
  ObjKind K;
71
4.39k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
4.39k
              CFReturnsNotRetainedAttr>()) {
73
4.39k
    if (!TrackObjCAndCFObjects)
74
10
      return None;
75
76
4.38k
    K = ObjKind::CF;
77
4.38k
  } else 
if (0
isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
0
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
0
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
0
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
0
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
0
                     OSReturnsRetainedOnZeroAttr,
92
0
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
0
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
4.38k
  if (D->hasAttr<T>())
104
15
    return K;
105
4.36k
  return None;
106
4.38k
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsNotRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
4.37k
                                                            QualType QT) {
70
4.37k
  ObjKind K;
71
4.37k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
4.37k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
4.37k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
4.37k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
4.37k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
4.37k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
4.37k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
4.37k
                     OSReturnsRetainedOnZeroAttr,
92
4.37k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
4.37k
    if (!TrackOSObjects)
94
3.93k
      return None;
95
438
    K = ObjKind::OS;
96
438
  } else 
if (0
isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
438
  if (D->hasAttr<T>())
104
4
    return K;
105
434
  return None;
106
438
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
4.37k
                                                            QualType QT) {
70
4.37k
  ObjKind K;
71
4.37k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
4.37k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
4.37k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
4.37k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
4.37k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
4.37k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
4.37k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
4.37k
                     OSReturnsRetainedOnZeroAttr,
92
4.37k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
4.37k
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
4.37k
                     GeneralizedReturnsRetainedAttr,
98
4.37k
                     GeneralizedConsumedAttr>()) {
99
4.37k
    K = ObjKind::Generalized;
100
4.37k
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
4.37k
  if (D->hasAttr<T>())
104
0
    return K;
105
4.37k
  return None;
106
4.37k
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::NSReturnsNotRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
2.41k
                                                            QualType QT) {
70
2.41k
  ObjKind K;
71
2.41k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
2.41k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
2.41k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
2.41k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
2.41k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
2.41k
    if (!TrackObjCAndCFObjects)
82
8
      return None;
83
84
2.40k
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
2.40k
                NSReturnsNotRetainedAttr>() &&
86
2.40k
        !cocoa::isCocoaObjectRef(QT))
87
1.95k
      return None;
88
445
    K = ObjKind::ObjC;
89
445
  } else 
if (0
isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
0
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
0
                     OSReturnsRetainedOnZeroAttr,
92
0
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
0
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
445
  if (D->hasAttr<T>())
104
9
    return K;
105
436
  return None;
106
445
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::NSReturnsAutoreleasedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
2.40k
                                                            QualType QT) {
70
2.40k
  ObjKind K;
71
2.40k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
2.40k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
2.40k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
2.40k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
2.40k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
2.40k
    if (!TrackObjCAndCFObjects)
82
8
      return None;
83
84
2.39k
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
2.39k
                NSReturnsNotRetainedAttr>() &&
86
2.39k
        !cocoa::isCocoaObjectRef(QT))
87
1.95k
      return None;
88
436
    K = ObjKind::ObjC;
89
436
  } else 
if (0
isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
0
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
0
                     OSReturnsRetainedOnZeroAttr,
92
0
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
0
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
436
  if (D->hasAttr<T>())
104
4
    return K;
105
432
  return None;
106
436
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::NSConsumedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
2.05k
                                                            QualType QT) {
70
2.05k
  ObjKind K;
71
2.05k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
2.05k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
2.05k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
2.05k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
2.05k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
2.05k
    if (!TrackObjCAndCFObjects)
82
2
      return None;
83
84
2.05k
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
2.05k
                NSReturnsNotRetainedAttr>() &&
86
2.05k
        
!cocoa::isCocoaObjectRef(QT)0
)
87
0
      return None;
88
2.05k
    K = ObjKind::ObjC;
89
2.05k
  } else 
if (0
isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
0
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
0
                     OSReturnsRetainedOnZeroAttr,
92
0
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
0
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
2.05k
  if (D->hasAttr<T>())
104
13
    return K;
105
2.04k
  return None;
106
2.05k
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::CFConsumedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
2.04k
                                                            QualType QT) {
70
2.04k
  ObjKind K;
71
2.04k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
2.04k
              CFReturnsNotRetainedAttr>()) {
73
2.04k
    if (!TrackObjCAndCFObjects)
74
2
      return None;
75
76
2.04k
    K = ObjKind::CF;
77
2.04k
  } else 
if (0
isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
0
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
0
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
0
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
0
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
0
                     OSReturnsRetainedOnZeroAttr,
92
0
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
0
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
2.04k
  if (D->hasAttr<T>())
104
29
    return K;
105
2.01k
  return None;
106
2.04k
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSConsumedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
2.01k
                                                            QualType QT) {
70
2.01k
  ObjKind K;
71
2.01k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
2.01k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
2.01k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
2.01k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
2.01k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
2.01k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
2.01k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
2.01k
                     OSReturnsRetainedOnZeroAttr,
92
2.01k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
2.01k
    if (!TrackOSObjects)
94
1.85k
      return None;
95
166
    K = ObjKind::OS;
96
166
  } else 
if (0
isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
166
  if (D->hasAttr<T>())
104
7
    return K;
105
159
  return None;
106
166
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<(anonymous namespace)::GeneralizedConsumedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
2.01k
                                                            QualType QT) {
70
2.01k
  ObjKind K;
71
2.01k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
2.01k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
2.01k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
2.01k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
2.01k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
2.01k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
2.01k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
2.01k
                     OSReturnsRetainedOnZeroAttr,
92
2.01k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
2.01k
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
2.01k
                     GeneralizedReturnsRetainedAttr,
98
2.01k
                     GeneralizedConsumedAttr>()) {
99
2.01k
    K = ObjKind::Generalized;
100
2.01k
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
2.01k
  if (D->hasAttr<T>())
104
17
    return K;
105
1.99k
  return None;
106
2.01k
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsRetainedOnNonZeroAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
1.97k
                                                            QualType QT) {
70
1.97k
  ObjKind K;
71
1.97k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
1.97k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
1.97k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
1.97k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
1.97k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
1.97k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
1.97k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
1.97k
                     OSReturnsRetainedOnZeroAttr,
92
1.97k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
1.97k
    if (!TrackOSObjects)
94
1.82k
      return None;
95
148
    K = ObjKind::OS;
96
148
  } else 
if (0
isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
148
  if (D->hasAttr<T>())
104
1
    return K;
105
147
  return None;
106
148
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsRetainedOnZeroAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
1.96k
                                                            QualType QT) {
70
1.96k
  ObjKind K;
71
1.96k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
1.96k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
1.96k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
1.96k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
1.96k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
1.96k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
1.96k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
1.96k
                     OSReturnsRetainedOnZeroAttr,
92
1.96k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
1.96k
    if (!TrackOSObjects)
94
1.82k
      return None;
95
147
    K = ObjKind::OS;
96
147
  } else 
if (0
isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
147
  if (D->hasAttr<T>())
104
2
    return K;
105
145
  return None;
106
147
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSConsumesThisAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
1.64k
                                                            QualType QT) {
70
1.64k
  ObjKind K;
71
1.64k
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
1.64k
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
1.64k
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
1.64k
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
1.64k
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
0
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
0
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
0
                NSReturnsNotRetainedAttr>() &&
86
0
        !cocoa::isCocoaObjectRef(QT))
87
0
      return None;
88
0
    K = ObjKind::ObjC;
89
1.64k
  } else if (isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
1.64k
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
1.64k
                     OSReturnsRetainedOnZeroAttr,
92
1.64k
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
1.64k
    if (!TrackOSObjects)
94
1.37k
      return None;
95
264
    K = ObjKind::OS;
96
264
  } else 
if (0
isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
264
  if (D->hasAttr<T>())
104
2
    return K;
105
262
  return None;
106
264
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::NSConsumesSelfAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
69
853
                                                            QualType QT) {
70
853
  ObjKind K;
71
853
  if (isOneOf<T, CFConsumedAttr, CFReturnsRetainedAttr,
72
853
              CFReturnsNotRetainedAttr>()) {
73
0
    if (!TrackObjCAndCFObjects)
74
0
      return None;
75
76
0
    K = ObjKind::CF;
77
853
  } else if (isOneOf<T, NSConsumedAttr, NSConsumesSelfAttr,
78
853
                     NSReturnsAutoreleasedAttr, NSReturnsRetainedAttr,
79
853
                     NSReturnsNotRetainedAttr, NSConsumesSelfAttr>()) {
80
81
853
    if (!TrackObjCAndCFObjects)
82
0
      return None;
83
84
853
    if (isOneOf<T, NSReturnsRetainedAttr, NSReturnsAutoreleasedAttr,
85
853
                NSReturnsNotRetainedAttr>() &&
86
853
        
!cocoa::isCocoaObjectRef(QT)0
)
87
0
      return None;
88
853
    K = ObjKind::ObjC;
89
853
  } else 
if (0
isOneOf<T, OSConsumedAttr, OSConsumesThisAttr,
90
0
                     OSReturnsNotRetainedAttr, OSReturnsRetainedAttr,
91
0
                     OSReturnsRetainedOnZeroAttr,
92
0
                     OSReturnsRetainedOnNonZeroAttr>()) {
93
0
    if (!TrackOSObjects)
94
0
      return None;
95
0
    K = ObjKind::OS;
96
0
  } else if (isOneOf<T, GeneralizedReturnsNotRetainedAttr,
97
0
                     GeneralizedReturnsRetainedAttr,
98
0
                     GeneralizedConsumedAttr>()) {
99
0
    K = ObjKind::Generalized;
100
0
  } else {
101
0
    llvm_unreachable("Unexpected attribute");
102
0
  }
103
853
  if (D->hasAttr<T>())
104
7
    return K;
105
846
  return None;
106
853
}
107
108
template <class T1, class T2, class... Others>
109
Optional<ObjKind> RetainSummaryManager::hasAnyEnabledAttrOf(const Decl *D,
110
32.5k
                                                            QualType QT) {
111
32.5k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
141
    return Out;
113
32.3k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
32.5k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::CFReturnsRetainedAttr, clang::OSReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
2.47k
                                                            QualType QT) {
111
2.47k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
37
    return Out;
113
2.43k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
2.47k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsRetainedAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
2.43k
                                                            QualType QT) {
111
2.43k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
1
    return Out;
113
2.43k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
2.43k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::CFReturnsNotRetainedAttr, clang::OSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
2.42k
                                                            QualType QT) {
111
2.42k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
9
    return Out;
113
2.41k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
2.42k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
2.41k
                                                            QualType QT) {
111
2.41k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
3
    return Out;
113
2.41k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
2.41k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<(anonymous namespace)::GeneralizedReturnsNotRetainedAttr, clang::NSReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
2.41k
                                                            QualType QT) {
111
2.41k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
0
    return Out;
113
2.41k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
2.41k
}
llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::NSReturnsNotRetainedAttr, clang::NSReturnsAutoreleasedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
2.41k
                                                            QualType QT) {
111
2.41k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
9
    return Out;
113
2.40k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
2.41k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::NSConsumedAttr, clang::CFConsumedAttr, clang::OSConsumedAttr, (anonymous namespace)::GeneralizedConsumedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
2.05k
                                                            QualType QT) {
111
2.05k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
13
    return Out;
113
2.04k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
2.05k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::CFConsumedAttr, clang::OSConsumedAttr, (anonymous namespace)::GeneralizedConsumedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
2.04k
                                                            QualType QT) {
111
2.04k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
29
    return Out;
113
2.01k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
2.04k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSConsumedAttr, (anonymous namespace)::GeneralizedConsumedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
2.01k
                                                            QualType QT) {
111
2.01k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
7
    return Out;
113
2.01k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
2.01k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::CFReturnsRetainedAttr, clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr, clang::OSReturnsRetainedOnZeroAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
1.99k
                                                            QualType QT) {
111
1.99k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
12
    return Out;
113
1.98k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
1.99k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsRetainedAttr, clang::OSReturnsRetainedOnNonZeroAttr, clang::OSReturnsRetainedOnZeroAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
1.98k
                                                            QualType QT) {
111
1.98k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
11
    return Out;
113
1.97k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
1.98k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsRetainedOnNonZeroAttr, clang::OSReturnsRetainedOnZeroAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
1.97k
                                                            QualType QT) {
111
1.97k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
1
    return Out;
113
1.96k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
1.97k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsRetainedOnZeroAttr, (anonymous namespace)::GeneralizedReturnsRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
1.96k
                                                            QualType QT) {
111
1.96k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
2
    return Out;
113
1.96k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
1.96k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::CFReturnsNotRetainedAttr, clang::OSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
1.96k
                                                            QualType QT) {
111
1.96k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
6
    return Out;
113
1.96k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
1.96k
}
RetainSummaryManager.cpp:llvm::Optional<clang::ento::ObjKind> clang::ento::RetainSummaryManager::hasAnyEnabledAttrOf<clang::OSReturnsNotRetainedAttr, (anonymous namespace)::GeneralizedReturnsNotRetainedAttr>(clang::Decl const*, clang::QualType)
Line
Count
Source
110
1.96k
                                                            QualType QT) {
111
1.96k
  if (auto Out = hasAnyEnabledAttrOf<T1>(D, QT))
112
1
    return Out;
113
1.96k
  return hasAnyEnabledAttrOf<T2, Others...>(D, QT);
114
1.96k
}
115
116
const RetainSummary *
117
4.89k
RetainSummaryManager::getPersistentSummary(const RetainSummary &OldSumm) {
118
  // Unique "simple" summaries -- those without ArgEffects.
119
4.89k
  if (OldSumm.isSimple()) {
120
3.59k
    ::llvm::FoldingSetNodeID ID;
121
3.59k
    OldSumm.Profile(ID);
122
123
3.59k
    void *Pos;
124
3.59k
    CachedSummaryNode *N = SimpleSummaries.FindNodeOrInsertPos(ID, Pos);
125
126
3.59k
    if (!N) {
127
1.14k
      N = (CachedSummaryNode *) BPAlloc.Allocate<CachedSummaryNode>();
128
1.14k
      new (N) CachedSummaryNode(OldSumm);
129
1.14k
      SimpleSummaries.InsertNode(N, Pos);
130
1.14k
    }
131
132
3.59k
    return &N->getValue();
133
3.59k
  }
134
135
1.29k
  RetainSummary *Summ = (RetainSummary *) BPAlloc.Allocate<RetainSummary>();
136
1.29k
  new (Summ) RetainSummary(OldSumm);
137
1.29k
  return Summ;
138
4.89k
}
139
140
static bool isSubclass(const Decl *D,
141
834
                       StringRef ClassName) {
142
834
  using namespace ast_matchers;
143
834
  DeclarationMatcher SubclassM =
144
834
      cxxRecordDecl(isSameOrDerivedFrom(std::string(ClassName)));
145
834
  return !(match(SubclassM, *D, D->getASTContext()).empty());
146
834
}
147
148
290
static bool isExactClass(const Decl *D, StringRef ClassName) {
149
290
  using namespace ast_matchers;
150
290
  DeclarationMatcher sameClassM =
151
290
      cxxRecordDecl(hasName(std::string(ClassName)));
152
290
  return !(match(sameClassM, *D, D->getASTContext()).empty());
153
290
}
154
155
3.74k
static bool isOSObjectSubclass(const Decl *D) {
156
3.74k
  return D && 
isSubclass(D, "OSMetaClassBase")826
&&
157
3.74k
         
!isExactClass(D, "OSMetaClass")290
;
158
3.74k
}
159
160
102
static bool isOSObjectDynamicCast(StringRef S) { return S == "safeMetaCast"; }
161
162
90
static bool isOSObjectRequiredCast(StringRef S) {
163
90
  return S == "requiredMetaCast";
164
90
}
165
166
86
static bool isOSObjectThisCast(StringRef S) {
167
86
  return S == "metaCast";
168
86
}
169
170
171
3.47k
static bool isOSObjectPtr(QualType QT) {
172
3.47k
  return isOSObjectSubclass(QT->getPointeeCXXRecordDecl());
173
3.47k
}
174
175
3.47k
static bool isISLObjectRef(QualType Ty) {
176
3.47k
  return StringRef(Ty.getAsString()).startswith("isl_");
177
3.47k
}
178
179
8
static bool isOSIteratorSubclass(const Decl *D) {
180
8
  return isSubclass(D, "OSIterator");
181
8
}
182
183
1.47k
static bool hasRCAnnotation(const Decl *D, StringRef rcAnnotation) {
184
1.47k
  for (const auto *Ann : D->specific_attrs<AnnotateAttr>()) {
185
16
    if (Ann->getAnnotation() == rcAnnotation)
186
12
      return true;
187
16
  }
188
1.46k
  return false;
189
1.47k
}
190
191
433
static bool isRetain(const FunctionDecl *FD, StringRef FName) {
192
433
  return FName.startswith_insensitive("retain") ||
193
433
         
FName.endswith_insensitive("retain")427
;
194
433
}
195
196
77
static bool isRelease(const FunctionDecl *FD, StringRef FName) {
197
77
  return FName.startswith_insensitive("release") ||
198
77
         
FName.endswith_insensitive("release")55
;
199
77
}
200
201
310
static bool isAutorelease(const FunctionDecl *FD, StringRef FName) {
202
310
  return FName.startswith_insensitive("autorelease") ||
203
310
         
FName.endswith_insensitive("autorelease")307
;
204
310
}
205
206
256
static bool isMakeCollectable(StringRef FName) {
207
256
  return FName.contains_insensitive("MakeCollectable");
208
256
}
209
210
/// A function is OSObject related if it is declared on a subclass
211
/// of OSObject, or any of the parameters is a subclass of an OSObject.
212
44
static bool isOSObjectRelated(const CXXMethodDecl *MD) {
213
44
  if (isOSObjectSubclass(MD->getParent()))
214
9
    return true;
215
216
35
  for (ParmVarDecl *Param : MD->parameters()) {
217
21
    QualType PT = Param->getType()->getPointeeType();
218
21
    if (!PT.isNull())
219
16
      if (CXXRecordDecl *RD = PT->getAsCXXRecordDecl())
220
8
        if (isOSObjectSubclass(RD))
221
4
          return true;
222
21
  }
223
224
31
  return false;
225
35
}
226
227
bool
228
79
RetainSummaryManager::isKnownSmartPointer(QualType QT) {
229
79
  QT = QT.getCanonicalType();
230
79
  const auto *RD = QT->getAsCXXRecordDecl();
231
79
  if (!RD)
232
48
    return false;
233
31
  const IdentifierInfo *II = RD->getIdentifier();
234
31
  if (II && 
II->getName() == "smart_ptr"25
)
235
3
    if (const auto *ND = dyn_cast<NamespaceDecl>(RD->getDeclContext()))
236
3
      if (ND->getNameAsString() == "os")
237
3
        return true;
238
28
  return false;
239
31
}
240
241
const RetainSummary *
242
RetainSummaryManager::getSummaryForOSObject(const FunctionDecl *FD,
243
255
                                            StringRef FName, QualType RetTy) {
244
255
  assert(TrackOSObjects &&
245
255
         "Requesting a summary for an OSObject but OSObjects are not tracked");
246
247
255
  if (RetTy->isPointerType()) {
248
37
    const CXXRecordDecl *PD = RetTy->getPointeeType()->getAsCXXRecordDecl();
249
37
    if (PD && 
isOSObjectSubclass(PD)29
) {
250
27
      if (isOSObjectDynamicCast(FName) || 
isOSObjectRequiredCast(FName)26
||
251
27
          
isOSObjectThisCast(FName)25
)
252
3
        return getDefaultSummary();
253
254
      // TODO: Add support for the slightly common *Matching(table) idiom.
255
      // Cf. IOService::nameMatching() etc. - these function have an unusual
256
      // contract of returning at +0 or +1 depending on their last argument.
257
24
      if (FName.endswith("Matching")) {
258
2
        return getPersistentStopSummary();
259
2
      }
260
261
      // All objects returned with functions *not* starting with 'get',
262
      // or iterators, are returned at +1.
263
22
      if ((!FName.startswith("get") && 
!FName.startswith("Get")15
) ||
264
22
          
isOSIteratorSubclass(PD)8
) {
265
15
        return getOSSummaryCreateRule(FD);
266
15
      } else {
267
7
        return getOSSummaryGetRule(FD);
268
7
      }
269
22
    }
270
37
  }
271
272
228
  if (const auto *MD = dyn_cast<CXXMethodDecl>(FD)) {
273
32
    const CXXRecordDecl *Parent = MD->getParent();
274
32
    if (Parent && isOSObjectSubclass(Parent)) {
275
15
      if (FName == "release" || 
FName == "taggedRelease"13
)
276
3
        return getOSSummaryReleaseRule(FD);
277
278
12
      if (FName == "retain" || 
FName == "taggedRetain"11
)
279
2
        return getOSSummaryRetainRule(FD);
280
281
10
      if (FName == "free")
282
1
        return getOSSummaryFreeRule(FD);
283
284
9
      if (MD->getOverloadedOperator() == OO_New)
285
2
        return getOSSummaryCreateRule(MD);
286
9
    }
287
32
  }
288
289
220
  return nullptr;
290
228
}
291
292
const RetainSummary *RetainSummaryManager::getSummaryForObjCOrCFObject(
293
    const FunctionDecl *FD,
294
    StringRef FName,
295
    QualType RetTy,
296
    const FunctionType *FT,
297
1.56k
    bool &AllowAnnotations) {
298
299
1.56k
  ArgEffects ScratchArgs(AF.getEmptyMap());
300
301
1.56k
  std::string RetTyName = RetTy.getAsString();
302
1.56k
  if (FName == "pthread_create" || 
FName == "pthread_setspecific"1.56k
) {
303
    // Part of: <rdar://problem/7299394> and <rdar://problem/11282706>.
304
    // This will be addressed better with IPA.
305
8
    return getPersistentStopSummary();
306
1.55k
  } else if(FName == "NSMakeCollectable") {
307
    // Handle: id NSMakeCollectable(CFTypeRef)
308
6
    AllowAnnotations = false;
309
6
    return RetTy->isObjCIdType() ? getUnarySummary(FT, DoNothing)
310
6
                                 : 
getPersistentStopSummary()0
;
311
1.55k
  } else if (FName == "CMBufferQueueDequeueAndRetain" ||
312
1.55k
             
FName == "CMBufferQueueDequeueIfDataReadyAndRetain"1.54k
) {
313
    // Part of: <rdar://problem/39390714>.
314
3
    return getPersistentSummary(RetEffect::MakeOwned(ObjKind::CF),
315
3
                                ScratchArgs,
316
3
                                ArgEffect(DoNothing),
317
3
                                ArgEffect(DoNothing));
318
1.54k
  } else if (FName == "CFPlugInInstanceCreate") {
319
4
    return getPersistentSummary(RetEffect::MakeNoRet(), ScratchArgs);
320
1.54k
  } else if (FName == "IORegistryEntrySearchCFProperty" ||
321
1.54k
             (RetTyName == "CFMutableDictionaryRef" &&
322
1.54k
              
(24
FName == "IOBSDNameMatching"24
||
FName == "IOServiceMatching"20
||
323
24
               
FName == "IOServiceNameMatching"16
||
324
24
               
FName == "IORegistryEntryIDMatching"12
||
325
24
               
FName == "IOOpenFirmwarePathMatching"8
))) {
326
    // Part of <rdar://problem/6961230>. (IOKit)
327
    // This should be addressed using a API table.
328
20
    return getPersistentSummary(RetEffect::MakeOwned(ObjKind::CF), ScratchArgs,
329
20
                                ArgEffect(DoNothing), ArgEffect(DoNothing));
330
1.52k
  } else if (FName == "IOServiceGetMatchingService" ||
331
1.52k
             
FName == "IOServiceGetMatchingServices"1.51k
) {
332
    // FIXES: <rdar://problem/6326900>
333
    // This should be addressed using a API table.  This strcmp is also
334
    // a little gross, but there is no need to super optimize here.
335
8
    ScratchArgs = AF.add(ScratchArgs, 1, ArgEffect(DecRef, ObjKind::CF));
336
8
    return getPersistentSummary(RetEffect::MakeNoRet(),
337
8
                                ScratchArgs,
338
8
                                ArgEffect(DoNothing), ArgEffect(DoNothing));
339
1.51k
  } else if (FName == "IOServiceAddNotification" ||
340
1.51k
             
FName == "IOServiceAddMatchingNotification"1.51k
) {
341
    // Part of <rdar://problem/6961230>. (IOKit)
342
    // This should be addressed using a API table.
343
7
    ScratchArgs = AF.add(ScratchArgs, 2, ArgEffect(DecRef, ObjKind::CF));
344
7
    return getPersistentSummary(RetEffect::MakeNoRet(),
345
7
                                ScratchArgs,
346
7
                                ArgEffect(DoNothing), ArgEffect(DoNothing));
347
1.50k
  } else if (FName == "CVPixelBufferCreateWithBytes") {
348
    // FIXES: <rdar://problem/7283567>
349
    // Eventually this can be improved by recognizing that the pixel
350
    // buffer passed to CVPixelBufferCreateWithBytes is released via
351
    // a callback and doing full IPA to make sure this is done correctly.
352
    // FIXME: This function has an out parameter that returns an
353
    // allocated object.
354
5
    ScratchArgs = AF.add(ScratchArgs, 7, ArgEffect(StopTracking));
355
5
    return getPersistentSummary(RetEffect::MakeNoRet(),
356
5
                                ScratchArgs,
357
5
                                ArgEffect(DoNothing), ArgEffect(DoNothing));
358
1.50k
  } else if (FName == "CGBitmapContextCreateWithData") {
359
    // FIXES: <rdar://problem/7358899>
360
    // Eventually this can be improved by recognizing that 'releaseInfo'
361
    // passed to CGBitmapContextCreateWithData is released via
362
    // a callback and doing full IPA to make sure this is done correctly.
363
4
    ScratchArgs = AF.add(ScratchArgs, 8, ArgEffect(ArgEffect(StopTracking)));
364
4
    return getPersistentSummary(RetEffect::MakeOwned(ObjKind::CF), ScratchArgs,
365
4
                                ArgEffect(DoNothing), ArgEffect(DoNothing));
366
1.49k
  } else if (FName == "CVPixelBufferCreateWithPlanarBytes") {
367
    // FIXES: <rdar://problem/7283567>
368
    // Eventually this can be improved by recognizing that the pixel
369
    // buffer passed to CVPixelBufferCreateWithPlanarBytes is released
370
    // via a callback and doing full IPA to make sure this is done
371
    // correctly.
372
4
    ScratchArgs = AF.add(ScratchArgs, 12, ArgEffect(StopTracking));
373
4
    return getPersistentSummary(RetEffect::MakeNoRet(),
374
4
                                ScratchArgs,
375
4
                                ArgEffect(DoNothing), ArgEffect(DoNothing));
376
1.49k
  } else if (FName == "VTCompressionSessionEncodeFrame") {
377
    // The context argument passed to VTCompressionSessionEncodeFrame()
378
    // is passed to the callback specified when creating the session
379
    // (e.g. with VTCompressionSessionCreate()) which can release it.
380
    // To account for this possibility, conservatively stop tracking
381
    // the context.
382
3
    ScratchArgs = AF.add(ScratchArgs, 5, ArgEffect(StopTracking));
383
3
    return getPersistentSummary(RetEffect::MakeNoRet(),
384
3
                                ScratchArgs,
385
3
                                ArgEffect(DoNothing), ArgEffect(DoNothing));
386
1.49k
  } else if (FName == "dispatch_set_context" ||
387
1.49k
             
FName == "xpc_connection_set_context"1.49k
) {
388
    // <rdar://problem/11059275> - The analyzer currently doesn't have
389
    // a good way to reason about the finalizer function for libdispatch.
390
    // If we pass a context object that is memory managed, stop tracking it.
391
    // <rdar://problem/13783514> - Same problem, but for XPC.
392
    // FIXME: this hack should possibly go away once we can handle
393
    // libdispatch and XPC finalizers.
394
5
    ScratchArgs = AF.add(ScratchArgs, 1, ArgEffect(StopTracking));
395
5
    return getPersistentSummary(RetEffect::MakeNoRet(),
396
5
                                ScratchArgs,
397
5
                                ArgEffect(DoNothing), ArgEffect(DoNothing));
398
1.48k
  } else if (FName.startswith("NSLog")) {
399
8
    return getDoNothingSummary();
400
1.47k
  } else if (FName.startswith("NS") && 
FName.contains("Insert")6
) {
401
    // Allowlist NSXXInsertXX, for example NSMapInsertIfAbsent, since they can
402
    // be deallocated by NSMapRemove. (radar://11152419)
403
2
    ScratchArgs = AF.add(ScratchArgs, 1, ArgEffect(StopTracking));
404
2
    ScratchArgs = AF.add(ScratchArgs, 2, ArgEffect(StopTracking));
405
2
    return getPersistentSummary(RetEffect::MakeNoRet(),
406
2
                                ScratchArgs, ArgEffect(DoNothing),
407
2
                                ArgEffect(DoNothing));
408
2
  }
409
410
1.47k
  if (RetTy->isPointerType()) {
411
412
    // For CoreFoundation ('CF') types.
413
351
    if (cocoa::isRefType(RetTy, "CF", FName)) {
414
252
      if (isRetain(FD, FName)) {
415
        // CFRetain isn't supposed to be annotated. However, this may as
416
        // well be a user-made "safe" CFRetain function that is incorrectly
417
        // annotated as cf_returns_retained due to lack of better options.
418
        // We want to ignore such annotation.
419
23
        AllowAnnotations = false;
420
421
23
        return getUnarySummary(FT, IncRef);
422
229
      } else if (isAutorelease(FD, FName)) {
423
        // The headers use cf_consumed, but we can fully model CFAutorelease
424
        // ourselves.
425
10
        AllowAnnotations = false;
426
427
10
        return getUnarySummary(FT, Autorelease);
428
219
      } else if (isMakeCollectable(FName)) {
429
6
        AllowAnnotations = false;
430
6
        return getUnarySummary(FT, DoNothing);
431
213
      } else {
432
213
        return getCFCreateGetRuleSummary(FD);
433
213
      }
434
252
    }
435
436
    // For CoreGraphics ('CG') and CoreVideo ('CV') types.
437
99
    if (cocoa::isRefType(RetTy, "CG", FName) ||
438
99
        
cocoa::isRefType(RetTy, "CV", FName)87
) {
439
18
      if (isRetain(FD, FName))
440
5
        return getUnarySummary(FT, IncRef);
441
13
      else
442
13
        return getCFCreateGetRuleSummary(FD);
443
18
    }
444
445
    // For all other CF-style types, use the Create/Get
446
    // rule for summaries but don't support Retain functions
447
    // with framework-specific prefixes.
448
81
    if (coreFoundation::isCFObjectRef(RetTy)) {
449
26
      return getCFCreateGetRuleSummary(FD);
450
26
    }
451
452
55
    if (FD->hasAttr<CFAuditedTransferAttr>()) {
453
3
      return getCFCreateGetRuleSummary(FD);
454
3
    }
455
55
  }
456
457
  // Check for release functions, the only kind of functions that we care
458
  // about that don't return a pointer type.
459
1.17k
  if (FName.startswith("CG") || 
FName.startswith("CF")1.16k
) {
460
    // Test for 'CGCF'.
461
77
    FName = FName.substr(FName.startswith("CGCF") ? 
40
: 2);
462
463
77
    if (isRelease(FD, FName))
464
29
      return getUnarySummary(FT, DecRef);
465
48
    else {
466
48
      assert(ScratchArgs.isEmpty());
467
      // Remaining CoreFoundation and CoreGraphics functions.
468
      // We use to assume that they all strictly followed the ownership idiom
469
      // and that ownership cannot be transferred.  While this is technically
470
      // correct, many methods allow a tracked object to escape.  For example:
471
      //
472
      //   CFMutableDictionaryRef x = CFDictionaryCreateMutable(...);
473
      //   CFDictionaryAddValue(y, key, x);
474
      //   CFRelease(x);
475
      //   ... it is okay to use 'x' since 'y' has a reference to it
476
      //
477
      // We handle this and similar cases with the follow heuristic.  If the
478
      // function name contains "InsertValue", "SetValue", "AddValue",
479
      // "AppendValue", or "SetAttribute", then we assume that arguments may
480
      // "escape."  This means that something else holds on to the object,
481
      // allowing it be used even after its local retain count drops to 0.
482
0
      ArgEffectKind E =
483
48
          (StrInStrNoCase(FName, "InsertValue") != StringRef::npos ||
484
48
           StrInStrNoCase(FName, "AddValue") != StringRef::npos ||
485
48
           
StrInStrNoCase(FName, "SetValue") != StringRef::npos44
||
486
48
           
StrInStrNoCase(FName, "AppendValue") != StringRef::npos44
||
487
48
           
StrInStrNoCase(FName, "SetAttribute") != StringRef::npos40
)
488
48
              ? 
MayEscape12
489
48
              : 
DoNothing36
;
490
491
48
      return getPersistentSummary(RetEffect::MakeNoRet(), ScratchArgs,
492
48
                                  ArgEffect(DoNothing), ArgEffect(E, ObjKind::CF));
493
48
    }
494
77
  }
495
496
1.10k
  return nullptr;
497
1.17k
}
498
499
const RetainSummary *
500
RetainSummaryManager::generateSummary(const FunctionDecl *FD,
501
1.68k
                                      bool &AllowAnnotations) {
502
  // We generate "stop" summaries for implicitly defined functions.
503
1.68k
  if (FD->isImplicit())
504
53
    return getPersistentStopSummary();
505
506
1.63k
  const IdentifierInfo *II = FD->getIdentifier();
507
508
1.63k
  StringRef FName = II ? 
II->getName()1.61k
:
""18
;
509
510
  // Strip away preceding '_'.  Doing this here will effect all the checks
511
  // down below.
512
1.63k
  FName = FName.substr(FName.find_first_not_of('_'));
513
514
  // Inspect the result type. Strip away any typedefs.
515
1.63k
  const auto *FT = FD->getType()->castAs<FunctionType>();
516
1.63k
  QualType RetTy = FT->getReturnType();
517
518
1.63k
  if (TrackOSObjects)
519
255
    if (const RetainSummary *S = getSummaryForOSObject(FD, FName, RetTy))
520
35
      return S;
521
522
1.59k
  if (const auto *MD = dyn_cast<CXXMethodDecl>(FD))
523
44
    if (!isOSObjectRelated(MD))
524
31
      return getPersistentSummary(RetEffect::MakeNoRet(),
525
31
                                  ArgEffects(AF.getEmptyMap()),
526
31
                                  ArgEffect(DoNothing),
527
31
                                  ArgEffect(StopTracking),
528
31
                                  ArgEffect(DoNothing));
529
530
1.56k
  if (TrackObjCAndCFObjects)
531
1.56k
    if (const RetainSummary *S =
532
1.56k
            getSummaryForObjCOrCFObject(FD, FName, RetTy, FT, AllowAnnotations))
533
463
      return S;
534
535
1.10k
  return getDefaultSummary();
536
1.56k
}
537
538
const RetainSummary *
539
3.22k
RetainSummaryManager::getFunctionSummary(const FunctionDecl *FD) {
540
  // If we don't know what function we're calling, use our default summary.
541
3.22k
  if (!FD)
542
70
    return getDefaultSummary();
543
544
  // Look up a summary in our cache of FunctionDecls -> Summaries.
545
3.15k
  FuncSummariesTy::iterator I = FuncSummaries.find(FD);
546
3.15k
  if (I != FuncSummaries.end())
547
1.46k
    return I->second;
548
549
  // No summary?  Generate one.
550
1.68k
  bool AllowAnnotations = true;
551
1.68k
  const RetainSummary *S = generateSummary(FD, AllowAnnotations);
552
553
  // Annotations override defaults.
554
1.68k
  if (AllowAnnotations)
555
1.64k
    updateSummaryFromAnnotations(S, FD);
556
557
1.68k
  FuncSummaries[FD] = S;
558
1.68k
  return S;
559
3.15k
}
560
561
//===----------------------------------------------------------------------===//
562
// Summary creation for functions (largely uses of Core Foundation).
563
//===----------------------------------------------------------------------===//
564
565
198
static ArgEffect getStopTrackingHardEquivalent(ArgEffect E) {
566
198
  switch (E.getKind()) {
567
99
  case DoNothing:
568
99
  case Autorelease:
569
99
  case DecRefBridgedTransferred:
570
99
  case IncRef:
571
99
  case UnretainedOutParameter:
572
99
  case RetainedOutParameter:
573
99
  case RetainedOutParameterOnZero:
574
99
  case RetainedOutParameterOnNonZero:
575
158
  case MayEscape:
576
174
  case StopTracking:
577
177
  case StopTrackingHard:
578
177
    return E.withKind(StopTrackingHard);
579
21
  case DecRef:
580
21
  case DecRefAndStopTrackingHard:
581
21
    return E.withKind(DecRefAndStopTrackingHard);
582
0
  case Dealloc:
583
0
    return E.withKind(Dealloc);
584
198
  }
585
586
0
  llvm_unreachable("Unknown ArgEffect kind");
587
0
}
588
589
const RetainSummary *
590
RetainSummaryManager::updateSummaryForNonZeroCallbackArg(const RetainSummary *S,
591
84
                                                         AnyCall &C) {
592
84
  ArgEffect RecEffect = getStopTrackingHardEquivalent(S->getReceiverEffect());
593
84
  ArgEffect DefEffect = getStopTrackingHardEquivalent(S->getDefaultArgEffect());
594
595
84
  ArgEffects ScratchArgs(AF.getEmptyMap());
596
84
  ArgEffects CustomArgEffects = S->getArgEffects();
597
84
  for (ArgEffects::iterator I = CustomArgEffects.begin(),
598
84
                            E = CustomArgEffects.end();
599
114
       I != E; 
++I30
) {
600
30
    ArgEffect Translated = getStopTrackingHardEquivalent(I->second);
601
30
    if (Translated.getKind() != DefEffect.getKind())
602
21
      ScratchArgs = AF.add(ScratchArgs, I->first, Translated);
603
30
  }
604
605
84
  RetEffect RE = RetEffect::MakeNoRetHard();
606
607
  // Special cases where the callback argument CANNOT free the return value.
608
  // This can generally only happen if we know that the callback will only be
609
  // called when the return value is already being deallocated.
610
84
  if (const IdentifierInfo *Name = C.getIdentifier()) {
611
    // When the CGBitmapContext is deallocated, the callback here will free
612
    // the associated data buffer.
613
    // The callback in dispatch_data_create frees the buffer, but not
614
    // the data object.
615
73
    if (Name->isStr("CGBitmapContextCreateWithData") ||
616
73
        
Name->isStr("dispatch_data_create")70
)
617
11
      RE = S->getRetEffect();
618
73
  }
619
620
84
  return getPersistentSummary(RE, ScratchArgs, RecEffect, DefEffect);
621
84
}
622
623
void RetainSummaryManager::updateSummaryForReceiverUnconsumedSelf(
624
7
    const RetainSummary *&S) {
625
626
7
  RetainSummaryTemplate Template(S, *this);
627
628
7
  Template->setReceiverEffect(ArgEffect(DoNothing));
629
7
  Template->setRetEffect(RetEffect::MakeNoRet());
630
7
}
631
632
633
void RetainSummaryManager::updateSummaryForArgumentTypes(
634
6.21k
  const AnyCall &C, const RetainSummary *&RS) {
635
6.21k
  RetainSummaryTemplate Template(RS, *this);
636
637
6.21k
  unsigned parm_idx = 0;
638
10.1k
  for (auto pi = C.param_begin(), pe = C.param_end(); pi != pe;
639
6.21k
       
++pi, ++parm_idx3.97k
) {
640
3.97k
    QualType QT = (*pi)->getType();
641
642
    // Skip already created values.
643
3.97k
    if (RS->getArgEffects().contains(parm_idx))
644
501
      continue;
645
646
3.47k
    ObjKind K = ObjKind::AnyObj;
647
648
3.47k
    if (isISLObjectRef(QT)) {
649
4
      K = ObjKind::Generalized;
650
3.47k
    } else if (isOSObjectPtr(QT)) {
651
65
      K = ObjKind::OS;
652
3.40k
    } else if (cocoa::isCocoaObjectRef(QT)) {
653
526
      K = ObjKind::ObjC;
654
2.88k
    } else if (coreFoundation::isCFObjectRef(QT)) {
655
632
      K = ObjKind::CF;
656
632
    }
657
658
3.47k
    if (K != ObjKind::AnyObj)
659
1.22k
      Template->addArg(AF, parm_idx,
660
1.22k
                       ArgEffect(RS->getDefaultArgEffect().getKind(), K));
661
3.47k
  }
662
6.21k
}
663
664
const RetainSummary *
665
RetainSummaryManager::getSummary(AnyCall C,
666
                                 bool HasNonZeroCallbackArg,
667
                                 bool IsReceiverUnconsumedSelf,
668
6.26k
                                 QualType ReceiverType) {
669
6.26k
  const RetainSummary *Summ;
670
6.26k
  switch (C.getKind()) {
671
3.04k
  case AnyCall::Function:
672
3.20k
  case AnyCall::Constructor:
673
3.20k
  case AnyCall::InheritedConstructor:
674
3.22k
  case AnyCall::Allocator:
675
3.22k
  case AnyCall::Deallocator:
676
3.22k
    Summ = getFunctionSummary(cast_or_null<FunctionDecl>(C.getDecl()));
677
3.22k
    break;
678
38
  case AnyCall::Block:
679
52
  case AnyCall::Destructor:
680
    // FIXME: These calls are currently unsupported.
681
52
    return getPersistentStopSummary();
682
2.98k
  case AnyCall::ObjCMethod: {
683
2.98k
    const auto *ME = cast_or_null<ObjCMessageExpr>(C.getExpr());
684
2.98k
    if (!ME) {
685
666
      Summ = getMethodSummary(cast<ObjCMethodDecl>(C.getDecl()));
686
2.31k
    } else if (ME->isInstanceMessage()) {
687
1.73k
      Summ = getInstanceMethodSummary(ME, ReceiverType);
688
1.73k
    } else {
689
585
      Summ = getClassMethodSummary(ME);
690
585
    }
691
2.98k
    break;
692
38
  }
693
6.26k
  }
694
695
6.21k
  if (HasNonZeroCallbackArg)
696
84
    Summ = updateSummaryForNonZeroCallbackArg(Summ, C);
697
698
6.21k
  if (IsReceiverUnconsumedSelf)
699
7
    updateSummaryForReceiverUnconsumedSelf(Summ);
700
701
6.21k
  updateSummaryForArgumentTypes(C, Summ);
702
703
6.21k
  assert(Summ && "Unknown call type?");
704
0
  return Summ;
705
6.26k
}
706
707
708
const RetainSummary *
709
255
RetainSummaryManager::getCFCreateGetRuleSummary(const FunctionDecl *FD) {
710
255
  if (coreFoundation::followsCreateRule(FD))
711
174
    return getCFSummaryCreateRule(FD);
712
713
81
  return getCFSummaryGetRule(FD);
714
255
}
715
716
bool RetainSummaryManager::isTrustedReferenceCountImplementation(
717
1.47k
    const Decl *FD) {
718
1.47k
  return hasRCAnnotation(FD, "rc_ownership_trusted_implementation");
719
1.47k
}
720
721
Optional<RetainSummaryManager::BehaviorSummary>
722
RetainSummaryManager::canEval(const CallExpr *CE, const FunctionDecl *FD,
723
1.89k
                              bool &hasTrustedImplementationAnnotation) {
724
725
1.89k
  IdentifierInfo *II = FD->getIdentifier();
726
1.89k
  if (!II)
727
1
    return None;
728
729
1.89k
  StringRef FName = II->getName();
730
1.89k
  FName = FName.substr(FName.find_first_not_of('_'));
731
732
1.89k
  QualType ResultTy = CE->getCallReturnType(Ctx);
733
1.89k
  if (ResultTy->isObjCIdType()) {
734
35
    if (II->isStr("NSMakeCollectable"))
735
5
      return BehaviorSummary::Identity;
736
1.86k
  } else if (ResultTy->isPointerType()) {
737
    // Handle: (CF|CG|CV)Retain
738
    //         CFAutorelease
739
    // It's okay to be a little sloppy here.
740
748
    if (FName == "CMBufferQueueDequeueAndRetain" ||
741
748
        
FName == "CMBufferQueueDequeueIfDataReadyAndRetain"745
) {
742
      // Part of: <rdar://problem/39390714>.
743
      // These are not retain. They just return something and retain it.
744
3
      return None;
745
3
    }
746
745
    if (CE->getNumArgs() == 1 &&
747
745
        
(261
cocoa::isRefType(ResultTy, "CF", FName)261
||
748
261
         
cocoa::isRefType(ResultTy, "CG", FName)109
||
749
261
         
cocoa::isRefType(ResultTy, "CV", FName)107
) &&
750
745
        
(163
isRetain(FD, FName)163
||
isAutorelease(FD, FName)81
||
751
163
         
isMakeCollectable(FName)37
))
752
131
      return BehaviorSummary::Identity;
753
754
    // safeMetaCast is called by OSDynamicCast.
755
    // We assume that OSDynamicCast is either an identity (cast is OK,
756
    // the input was non-zero),
757
    // or that it returns zero (when the cast failed, or the input
758
    // was zero).
759
614
    if (TrackOSObjects) {
760
75
      if (isOSObjectDynamicCast(FName) && 
FD->param_size() >= 111
) {
761
11
        return BehaviorSummary::IdentityOrZero;
762
64
      } else if (isOSObjectRequiredCast(FName) && 
FD->param_size() >= 13
) {
763
3
        return BehaviorSummary::Identity;
764
61
      } else if (isOSObjectThisCast(FName) && 
isa<CXXMethodDecl>(FD)1
&&
765
61
                 
!cast<CXXMethodDecl>(FD)->isStatic()1
) {
766
1
        return BehaviorSummary::IdentityThis;
767
1
      }
768
75
    }
769
770
599
    const FunctionDecl* FDD = FD->getDefinition();
771
599
    if (FDD && 
isTrustedReferenceCountImplementation(FDD)48
) {
772
10
      hasTrustedImplementationAnnotation = true;
773
10
      return BehaviorSummary::Identity;
774
10
    }
775
599
  }
776
777
1.73k
  if (const auto *MD = dyn_cast<CXXMethodDecl>(FD)) {
778
167
    const CXXRecordDecl *Parent = MD->getParent();
779
167
    if (TrackOSObjects && 
Parent156
&&
isOSObjectSubclass(Parent)156
)
780
136
      if (FName == "release" || 
FName == "retain"85
)
781
65
        return BehaviorSummary::NoOp;
782
167
  }
783
784
1.66k
  return None;
785
1.73k
}
786
787
const RetainSummary *
788
RetainSummaryManager::getUnarySummary(const FunctionType* FT,
789
79
                                      ArgEffectKind AE) {
790
791
  // Unary functions have no arg effects by definition.
792
79
  ArgEffects ScratchArgs(AF.getEmptyMap());
793
794
  // Verify that this is *really* a unary function.  This can
795
  // happen if people do weird things.
796
79
  const FunctionProtoType* FTP = dyn_cast<FunctionProtoType>(FT);
797
79
  if (!FTP || FTP->getNumParams() != 1)
798
7
    return getPersistentStopSummary();
799
800
72
  ArgEffect Effect(AE, ObjKind::CF);
801
802
72
  ScratchArgs = AF.add(ScratchArgs, 0, Effect);
803
72
  return getPersistentSummary(RetEffect::MakeNoRet(),
804
72
                              ScratchArgs,
805
72
                              ArgEffect(DoNothing), ArgEffect(DoNothing));
806
79
}
807
808
const RetainSummary *
809
2
RetainSummaryManager::getOSSummaryRetainRule(const FunctionDecl *FD) {
810
2
  return getPersistentSummary(RetEffect::MakeNoRet(),
811
2
                              AF.getEmptyMap(),
812
2
                              /*ReceiverEff=*/ArgEffect(DoNothing),
813
2
                              /*DefaultEff=*/ArgEffect(DoNothing),
814
2
                              /*ThisEff=*/ArgEffect(IncRef, ObjKind::OS));
815
2
}
816
817
const RetainSummary *
818
3
RetainSummaryManager::getOSSummaryReleaseRule(const FunctionDecl *FD) {
819
3
  return getPersistentSummary(RetEffect::MakeNoRet(),
820
3
                              AF.getEmptyMap(),
821
3
                              /*ReceiverEff=*/ArgEffect(DoNothing),
822
3
                              /*DefaultEff=*/ArgEffect(DoNothing),
823
3
                              /*ThisEff=*/ArgEffect(DecRef, ObjKind::OS));
824
3
}
825
826
const RetainSummary *
827
1
RetainSummaryManager::getOSSummaryFreeRule(const FunctionDecl *FD) {
828
1
  return getPersistentSummary(RetEffect::MakeNoRet(),
829
1
                              AF.getEmptyMap(),
830
1
                              /*ReceiverEff=*/ArgEffect(DoNothing),
831
1
                              /*DefaultEff=*/ArgEffect(DoNothing),
832
1
                              /*ThisEff=*/ArgEffect(Dealloc, ObjKind::OS));
833
1
}
834
835
const RetainSummary *
836
17
RetainSummaryManager::getOSSummaryCreateRule(const FunctionDecl *FD) {
837
17
  return getPersistentSummary(RetEffect::MakeOwned(ObjKind::OS),
838
17
                              AF.getEmptyMap());
839
17
}
840
841
const RetainSummary *
842
7
RetainSummaryManager::getOSSummaryGetRule(const FunctionDecl *FD) {
843
7
  return getPersistentSummary(RetEffect::MakeNotOwned(ObjKind::OS),
844
7
                              AF.getEmptyMap());
845
7
}
846
847
const RetainSummary *
848
174
RetainSummaryManager::getCFSummaryCreateRule(const FunctionDecl *FD) {
849
174
  return getPersistentSummary(RetEffect::MakeOwned(ObjKind::CF),
850
174
                              ArgEffects(AF.getEmptyMap()));
851
174
}
852
853
const RetainSummary *
854
81
RetainSummaryManager::getCFSummaryGetRule(const FunctionDecl *FD) {
855
81
  return getPersistentSummary(RetEffect::MakeNotOwned(ObjKind::CF),
856
81
                              ArgEffects(AF.getEmptyMap()),
857
81
                              ArgEffect(DoNothing), ArgEffect(DoNothing));
858
81
}
859
860
861
862
863
//===----------------------------------------------------------------------===//
864
// Summary creation for Selectors.
865
//===----------------------------------------------------------------------===//
866
867
Optional<RetEffect>
868
RetainSummaryManager::getRetEffectFromAnnotations(QualType RetTy,
869
2.50k
                                                  const Decl *D) {
870
2.50k
  if (hasAnyEnabledAttrOf<NSReturnsRetainedAttr>(D, RetTy))
871
30
    return ObjCAllocRetE;
872
873
2.47k
  if (auto K = hasAnyEnabledAttrOf<CFReturnsRetainedAttr, OSReturnsRetainedAttr,
874
2.47k
                                   GeneralizedReturnsRetainedAttr>(D, RetTy))
875
47
    return RetEffect::MakeOwned(*K);
876
877
2.42k
  if (auto K = hasAnyEnabledAttrOf<
878
2.42k
          CFReturnsNotRetainedAttr, OSReturnsNotRetainedAttr,
879
2.42k
          GeneralizedReturnsNotRetainedAttr, NSReturnsNotRetainedAttr,
880
2.42k
          NSReturnsAutoreleasedAttr>(D, RetTy))
881
25
    return RetEffect::MakeNotOwned(*K);
882
883
2.39k
  if (const auto *MD = dyn_cast<CXXMethodDecl>(D))
884
117
    for (const auto *PD : MD->overridden_methods())
885
5
      if (auto RE = getRetEffectFromAnnotations(RetTy, PD))
886
3
        return RE;
887
888
2.39k
  return None;
889
2.39k
}
890
891
/// \return Whether the chain of typedefs starting from @c QT
892
/// has a typedef with a given name @c Name.
893
static bool hasTypedefNamed(QualType QT,
894
12
                            StringRef Name) {
895
14
  while (auto *T = dyn_cast<TypedefType>(QT)) {
896
4
    const auto &Context = T->getDecl()->getASTContext();
897
4
    if (T->getDecl()->getIdentifier() == &Context.Idents.get(Name))
898
2
      return true;
899
2
    QT = T->getDecl()->getUnderlyingType();
900
2
  }
901
10
  return false;
902
12
}
903
904
14
static QualType getCallableReturnType(const NamedDecl *ND) {
905
14
  if (const auto *FD = dyn_cast<FunctionDecl>(ND)) {
906
14
    return FD->getReturnType();
907
14
  } else 
if (const auto *0
MD0
= dyn_cast<ObjCMethodDecl>(ND)) {
908
0
    return MD->getReturnType();
909
0
  } else {
910
0
    llvm_unreachable("Unexpected decl");
911
0
  }
912
14
}
913
914
bool RetainSummaryManager::applyParamAnnotationEffect(
915
    const ParmVarDecl *pd, unsigned parm_idx, const NamedDecl *FD,
916
2.05k
    RetainSummaryTemplate &Template) {
917
2.05k
  QualType QT = pd->getType();
918
2.05k
  if (auto K =
919
2.05k
          hasAnyEnabledAttrOf<NSConsumedAttr, CFConsumedAttr, OSConsumedAttr,
920
2.05k
                              GeneralizedConsumedAttr>(pd, QT)) {
921
66
    Template->addArg(AF, parm_idx, ArgEffect(DecRef, *K));
922
66
    return true;
923
1.99k
  } else if (auto K = hasAnyEnabledAttrOf<
924
1.99k
                 CFReturnsRetainedAttr, OSReturnsRetainedAttr,
925
1.99k
                 OSReturnsRetainedOnNonZeroAttr, OSReturnsRetainedOnZeroAttr,
926
1.99k
                 GeneralizedReturnsRetainedAttr>(pd, QT)) {
927
928
    // For OSObjects, we try to guess whether the object is created based
929
    // on the return value.
930
26
    if (K == ObjKind::OS) {
931
14
      QualType QT = getCallableReturnType(FD);
932
933
14
      bool HasRetainedOnZero = pd->hasAttr<OSReturnsRetainedOnZeroAttr>();
934
14
      bool HasRetainedOnNonZero = pd->hasAttr<OSReturnsRetainedOnNonZeroAttr>();
935
936
      // The usual convention is to create an object on non-zero return, but
937
      // it's reverted if the typedef chain has a typedef kern_return_t,
938
      // because kReturnSuccess constant is defined as zero.
939
      // The convention can be overwritten by custom attributes.
940
14
      bool SuccessOnZero =
941
14
          HasRetainedOnZero ||
942
14
          
(12
hasTypedefNamed(QT, "kern_return_t")12
&&
!HasRetainedOnNonZero2
);
943
14
      bool ShouldSplit = !QT.isNull() && !QT->isVoidType();
944
14
      ArgEffectKind AK = RetainedOutParameter;
945
14
      if (ShouldSplit && 
SuccessOnZero10
) {
946
3
        AK = RetainedOutParameterOnZero;
947
11
      } else if (ShouldSplit && 
(7
!SuccessOnZero7
||
HasRetainedOnNonZero0
)) {
948
7
        AK = RetainedOutParameterOnNonZero;
949
7
      }
950
14
      Template->addArg(AF, parm_idx, ArgEffect(AK, ObjKind::OS));
951
14
    }
952
953
    // For others:
954
    // Do nothing. Retained out parameters will either point to a +1 reference
955
    // or NULL, but the way you check for failure differs depending on the
956
    // API. Consequently, we don't have a good way to track them yet.
957
26
    return true;
958
1.96k
  } else if (auto K = hasAnyEnabledAttrOf<CFReturnsNotRetainedAttr,
959
1.96k
                                          OSReturnsNotRetainedAttr,
960
1.96k
                                          GeneralizedReturnsNotRetainedAttr>(
961
1.96k
                 pd, QT)) {
962
7
    Template->addArg(AF, parm_idx, ArgEffect(UnretainedOutParameter, *K));
963
7
    return true;
964
7
  }
965
966
1.96k
  if (const auto *MD = dyn_cast<CXXMethodDecl>(FD)) {
967
65
    for (const auto *OD : MD->overridden_methods()) {
968
2
      const ParmVarDecl *OP = OD->parameters()[parm_idx];
969
2
      if (applyParamAnnotationEffect(OP, parm_idx, OD, Template))
970
1
        return true;
971
2
    }
972
65
  }
973
974
1.95k
  return false;
975
1.96k
}
976
977
void
978
RetainSummaryManager::updateSummaryFromAnnotations(const RetainSummary *&Summ,
979
1.64k
                                                   const FunctionDecl *FD) {
980
1.64k
  if (!FD)
981
0
    return;
982
983
1.64k
  assert(Summ && "Must have a summary to add annotations to.");
984
0
  RetainSummaryTemplate Template(Summ, *this);
985
986
  // Effects on the parameters.
987
1.64k
  unsigned parm_idx = 0;
988
1.64k
  for (auto pi = FD->param_begin(),
989
3.38k
         pe = FD->param_end(); pi != pe; 
++pi, ++parm_idx1.74k
)
990
1.74k
    applyParamAnnotationEffect(*pi, parm_idx, FD, Template);
991
992
1.64k
  QualType RetTy = FD->getReturnType();
993
1.64k
  if (Optional<RetEffect> RetE = getRetEffectFromAnnotations(RetTy, FD))
994
48
    Template->setRetEffect(*RetE);
995
996
1.64k
  if (hasAnyEnabledAttrOf<OSConsumesThisAttr>(FD, RetTy))
997
2
    Template->setThisEffect(ArgEffect(DecRef, ObjKind::OS));
998
1.64k
}
999
1000
void
1001
RetainSummaryManager::updateSummaryFromAnnotations(const RetainSummary *&Summ,
1002
858
                                                   const ObjCMethodDecl *MD) {
1003
858
  if (!MD)
1004
5
    return;
1005
1006
853
  assert(Summ && "Must have a valid summary to add annotations to");
1007
0
  RetainSummaryTemplate Template(Summ, *this);
1008
1009
  // Effects on the receiver.
1010
853
  if (hasAnyEnabledAttrOf<NSConsumesSelfAttr>(MD, MD->getReturnType()))
1011
7
    Template->setReceiverEffect(ArgEffect(DecRef, ObjKind::ObjC));
1012
1013
  // Effects on the parameters.
1014
853
  unsigned parm_idx = 0;
1015
1.16k
  for (auto pi = MD->param_begin(), pe = MD->param_end(); pi != pe;
1016
853
       
++pi, ++parm_idx313
)
1017
313
    applyParamAnnotationEffect(*pi, parm_idx, MD, Template);
1018
1019
853
  QualType RetTy = MD->getReturnType();
1020
853
  if (Optional<RetEffect> RetE = getRetEffectFromAnnotations(RetTy, MD))
1021
54
    Template->setRetEffect(*RetE);
1022
853
}
1023
1024
const RetainSummary *
1025
RetainSummaryManager::getStandardMethodSummary(const ObjCMethodDecl *MD,
1026
858
                                               Selector S, QualType RetTy) {
1027
  // Any special effects?
1028
858
  ArgEffect ReceiverEff = ArgEffect(DoNothing, ObjKind::ObjC);
1029
858
  RetEffect ResultEff = RetEffect::MakeNoRet();
1030
1031
  // Check the method family, and apply any default annotations.
1032
858
  switch (MD ? 
MD->getMethodFamily()853
:
S.getMethodFamily()5
) {
1033
641
    case OMF_None:
1034
641
    case OMF_initialize:
1035
641
    case OMF_performSelector:
1036
      // Assume all Objective-C methods follow Cocoa Memory Management rules.
1037
      // FIXME: Does the non-threaded performSelector family really belong here?
1038
      // The selector could be, say, @selector(copy).
1039
641
      if (cocoa::isCocoaObjectRef(RetTy))
1040
213
        ResultEff = RetEffect::MakeNotOwned(ObjKind::ObjC);
1041
428
      else if (coreFoundation::isCFObjectRef(RetTy)) {
1042
        // ObjCMethodDecl currently doesn't consider CF objects as valid return
1043
        // values for alloc, new, copy, or mutableCopy, so we have to
1044
        // double-check with the selector. This is ugly, but there aren't that
1045
        // many Objective-C methods that return CF objects, right?
1046
38
        if (MD) {
1047
38
          switch (S.getMethodFamily()) {
1048
0
          case OMF_alloc:
1049
12
          case OMF_new:
1050
22
          case OMF_copy:
1051
22
          case OMF_mutableCopy:
1052
22
            ResultEff = RetEffect::MakeOwned(ObjKind::CF);
1053
22
            break;
1054
16
          default:
1055
16
            ResultEff = RetEffect::MakeNotOwned(ObjKind::CF);
1056
16
            break;
1057
38
          }
1058
38
        } else {
1059
0
          ResultEff = RetEffect::MakeNotOwned(ObjKind::CF);
1060
0
        }
1061
38
      }
1062
641
      break;
1063
641
    case OMF_init:
1064
77
      ResultEff = ObjCInitRetE;
1065
77
      ReceiverEff = ArgEffect(DecRef, ObjKind::ObjC);
1066
77
      break;
1067
77
    case OMF_alloc:
1068
108
    case OMF_new:
1069
129
    case OMF_copy:
1070
130
    case OMF_mutableCopy:
1071
130
      if (cocoa::isCocoaObjectRef(RetTy))
1072
130
        ResultEff = ObjCAllocRetE;
1073
0
      else if (coreFoundation::isCFObjectRef(RetTy))
1074
0
        ResultEff = RetEffect::MakeOwned(ObjKind::CF);
1075
130
      break;
1076
3
    case OMF_autorelease:
1077
3
      ReceiverEff = ArgEffect(Autorelease, ObjKind::ObjC);
1078
3
      break;
1079
3
    case OMF_retain:
1080
3
      ReceiverEff = ArgEffect(IncRef, ObjKind::ObjC);
1081
3
      break;
1082
3
    case OMF_release:
1083
3
      ReceiverEff = ArgEffect(DecRef, ObjKind::ObjC);
1084
3
      break;
1085
0
    case OMF_dealloc:
1086
0
      ReceiverEff = ArgEffect(Dealloc, ObjKind::ObjC);
1087
0
      break;
1088
1
    case OMF_self:
1089
      // -self is handled specially by the ExprEngine to propagate the receiver.
1090
1
      break;
1091
0
    case OMF_retainCount:
1092
0
    case OMF_finalize:
1093
      // These methods don't return objects.
1094
0
      break;
1095
858
  }
1096
1097
  // If one of the arguments in the selector has the keyword 'delegate' we
1098
  // should stop tracking the reference count for the receiver.  This is
1099
  // because the reference count is quite possibly handled by a delegate
1100
  // method.
1101
858
  if (S.isKeywordSelector()) {
1102
545
    for (unsigned i = 0, e = S.getNumArgs(); i != e; 
++i313
) {
1103
313
      StringRef Slot = S.getNameForSlot(i);
1104
313
      if (Slot.substr(Slot.size() - 8).equals_insensitive("delegate")) {
1105
9
        if (ResultEff == ObjCInitRetE)
1106
3
          ResultEff = RetEffect::MakeNoRetHard();
1107
6
        else
1108
6
          ReceiverEff = ArgEffect(StopTrackingHard, ObjKind::ObjC);
1109
9
      }
1110
313
    }
1111
232
  }
1112
1113
858
  if (ReceiverEff.getKind() == DoNothing &&
1114
858
      
ResultEff.getKind() == RetEffect::NoRet766
)
1115
385
    return getDefaultSummary();
1116
1117
473
  return getPersistentSummary(ResultEff, ArgEffects(AF.getEmptyMap()),
1118
473
                              ArgEffect(ReceiverEff), ArgEffect(MayEscape));
1119
858
}
1120
1121
const RetainSummary *
1122
585
RetainSummaryManager::getClassMethodSummary(const ObjCMessageExpr *ME) {
1123
585
  assert(!ME->isInstanceMessage());
1124
0
  const ObjCInterfaceDecl *Class = ME->getReceiverInterface();
1125
1126
585
  return getMethodSummary(ME->getSelector(), Class, ME->getMethodDecl(),
1127
585
                          ME->getType(), ObjCClassMethodSummaries);
1128
585
}
1129
1130
const RetainSummary *RetainSummaryManager::getInstanceMethodSummary(
1131
    const ObjCMessageExpr *ME,
1132
1.73k
    QualType ReceiverType) {
1133
1.73k
  const ObjCInterfaceDecl *ReceiverClass = nullptr;
1134
1135
  // We do better tracking of the type of the object than the core ExprEngine.
1136
  // See if we have its type in our private state.
1137
1.73k
  if (!ReceiverType.isNull())
1138
1.19k
    if (const auto *PT = ReceiverType->getAs<ObjCObjectPointerType>())
1139
1.14k
      ReceiverClass = PT->getInterfaceDecl();
1140
1141
  // If we don't know what kind of object this is, fall back to its static type.
1142
1.73k
  if (!ReceiverClass)
1143
738
    ReceiverClass = ME->getReceiverInterface();
1144
1145
  // FIXME: The receiver could be a reference to a class, meaning that
1146
  //  we should use the class method.
1147
  // id x = [NSObject class];
1148
  // [x performSelector:... withObject:... afterDelay:...];
1149
1.73k
  Selector S = ME->getSelector();
1150
1.73k
  const ObjCMethodDecl *Method = ME->getMethodDecl();
1151
1.73k
  if (!Method && 
ReceiverClass2
)
1152
1
    Method = ReceiverClass->getInstanceMethod(S);
1153
1154
1.73k
  return getMethodSummary(S, ReceiverClass, Method, ME->getType(),
1155
1.73k
                          ObjCMethodSummaries);
1156
1.73k
}
1157
1158
const RetainSummary *
1159
RetainSummaryManager::getMethodSummary(Selector S,
1160
                                       const ObjCInterfaceDecl *ID,
1161
                                       const ObjCMethodDecl *MD, QualType RetTy,
1162
2.98k
                                       ObjCMethodSummariesTy &CachedSummaries) {
1163
1164
  // Objective-C method summaries are only applicable to ObjC and CF objects.
1165
2.98k
  if (!TrackObjCAndCFObjects)
1166
0
    return getDefaultSummary();
1167
1168
  // Look up a summary in our summary cache.
1169
2.98k
  const RetainSummary *Summ = CachedSummaries.find(ID, S);
1170
1171
2.98k
  if (!Summ) {
1172
858
    Summ = getStandardMethodSummary(MD, S, RetTy);
1173
1174
    // Annotations override defaults.
1175
858
    updateSummaryFromAnnotations(Summ, MD);
1176
1177
    // Memoize the summary.
1178
858
    CachedSummaries[ObjCSummaryKey(ID, S)] = Summ;
1179
858
  }
1180
1181
2.98k
  return Summ;
1182
2.98k
}
1183
1184
97
void RetainSummaryManager::InitializeClassMethodSummaries() {
1185
97
  ArgEffects ScratchArgs = AF.getEmptyMap();
1186
1187
  // Create the [NSAssertionHandler currentHander] summary.
1188
97
  addClassMethSummary("NSAssertionHandler", "currentHandler",
1189
97
                getPersistentSummary(RetEffect::MakeNotOwned(ObjKind::ObjC),
1190
97
                                     ScratchArgs));
1191
1192
  // Create the [NSAutoreleasePool addObject:] summary.
1193
97
  ScratchArgs = AF.add(ScratchArgs, 0, ArgEffect(Autorelease));
1194
97
  addClassMethSummary("NSAutoreleasePool", "addObject",
1195
97
                      getPersistentSummary(RetEffect::MakeNoRet(), ScratchArgs,
1196
97
                                           ArgEffect(DoNothing),
1197
97
                                           ArgEffect(Autorelease)));
1198
97
}
1199
1200
97
void RetainSummaryManager::InitializeMethodSummaries() {
1201
1202
97
  ArgEffects ScratchArgs = AF.getEmptyMap();
1203
  // Create the "init" selector.  It just acts as a pass-through for the
1204
  // receiver.
1205
97
  const RetainSummary *InitSumm = getPersistentSummary(
1206
97
      ObjCInitRetE, ScratchArgs, ArgEffect(DecRef, ObjKind::ObjC));
1207
97
  addNSObjectMethSummary(GetNullarySelector("init", Ctx), InitSumm);
1208
1209
  // awakeAfterUsingCoder: behaves basically like an 'init' method.  It
1210
  // claims the receiver and returns a retained object.
1211
97
  addNSObjectMethSummary(GetUnarySelector("awakeAfterUsingCoder", Ctx),
1212
97
                         InitSumm);
1213
1214
  // The next methods are allocators.
1215
97
  const RetainSummary *AllocSumm = getPersistentSummary(ObjCAllocRetE,
1216
97
                                                        ScratchArgs);
1217
97
  const RetainSummary *CFAllocSumm =
1218
97
    getPersistentSummary(RetEffect::MakeOwned(ObjKind::CF), ScratchArgs);
1219
1220
  // Create the "retain" selector.
1221
97
  RetEffect NoRet = RetEffect::MakeNoRet();
1222
97
  const RetainSummary *Summ = getPersistentSummary(
1223
97
      NoRet, ScratchArgs, ArgEffect(IncRef, ObjKind::ObjC));
1224
97
  addNSObjectMethSummary(GetNullarySelector("retain", Ctx), Summ);
1225
1226
  // Create the "release" selector.
1227
97
  Summ = getPersistentSummary(NoRet, ScratchArgs,
1228
97
                              ArgEffect(DecRef, ObjKind::ObjC));
1229
97
  addNSObjectMethSummary(GetNullarySelector("release", Ctx), Summ);
1230
1231
  // Create the -dealloc summary.
1232
97
  Summ = getPersistentSummary(NoRet, ScratchArgs, ArgEffect(Dealloc,
1233
97
                                                            ObjKind::ObjC));
1234
97
  addNSObjectMethSummary(GetNullarySelector("dealloc", Ctx), Summ);
1235
1236
  // Create the "autorelease" selector.
1237
97
  Summ = getPersistentSummary(NoRet, ScratchArgs, ArgEffect(Autorelease,
1238
97
                                                            ObjKind::ObjC));
1239
97
  addNSObjectMethSummary(GetNullarySelector("autorelease", Ctx), Summ);
1240
1241
  // For NSWindow, allocated objects are (initially) self-owned.
1242
  // FIXME: For now we opt for false negatives with NSWindow, as these objects
1243
  //  self-own themselves.  However, they only do this once they are displayed.
1244
  //  Thus, we need to track an NSWindow's display status.
1245
  //  This is tracked in <rdar://problem/6062711>.
1246
  //  See also http://llvm.org/bugs/show_bug.cgi?id=3714.
1247
97
  const RetainSummary *NoTrackYet =
1248
97
      getPersistentSummary(RetEffect::MakeNoRet(), ScratchArgs,
1249
97
                           ArgEffect(StopTracking), ArgEffect(StopTracking));
1250
1251
97
  addClassMethSummary("NSWindow", "alloc", NoTrackYet);
1252
1253
  // For NSPanel (which subclasses NSWindow), allocated objects are not
1254
  //  self-owned.
1255
  // FIXME: For now we don't track NSPanels. object for the same reason
1256
  //   as for NSWindow objects.
1257
97
  addClassMethSummary("NSPanel", "alloc", NoTrackYet);
1258
1259
  // For NSNull, objects returned by +null are singletons that ignore
1260
  // retain/release semantics.  Just don't track them.
1261
  // <rdar://problem/12858915>
1262
97
  addClassMethSummary("NSNull", "null", NoTrackYet);
1263
1264
  // Don't track allocated autorelease pools, as it is okay to prematurely
1265
  // exit a method.
1266
97
  addClassMethSummary("NSAutoreleasePool", "alloc", NoTrackYet);
1267
97
  addClassMethSummary("NSAutoreleasePool", "allocWithZone", NoTrackYet, false);
1268
97
  addClassMethSummary("NSAutoreleasePool", "new", NoTrackYet);
1269
1270
  // Create summaries QCRenderer/QCView -createSnapShotImageOfType:
1271
97
  addInstMethSummary("QCRenderer", AllocSumm, "createSnapshotImageOfType");
1272
97
  addInstMethSummary("QCView", AllocSumm, "createSnapshotImageOfType");
1273
1274
  // Create summaries for CIContext, 'createCGImage' and
1275
  // 'createCGLayerWithSize'.  These objects are CF objects, and are not
1276
  // automatically garbage collected.
1277
97
  addInstMethSummary("CIContext", CFAllocSumm, "createCGImage", "fromRect");
1278
97
  addInstMethSummary("CIContext", CFAllocSumm, "createCGImage", "fromRect",
1279
97
                     "format", "colorSpace");
1280
97
  addInstMethSummary("CIContext", CFAllocSumm, "createCGLayerWithSize", "info");
1281
97
}
1282
1283
const RetainSummary *
1284
666
RetainSummaryManager::getMethodSummary(const ObjCMethodDecl *MD) {
1285
666
  const ObjCInterfaceDecl *ID = MD->getClassInterface();
1286
666
  Selector S = MD->getSelector();
1287
666
  QualType ResultTy = MD->getReturnType();
1288
1289
666
  ObjCMethodSummariesTy *CachedSummaries;
1290
666
  if (MD->isInstanceMethod())
1291
568
    CachedSummaries = &ObjCMethodSummaries;
1292
98
  else
1293
98
    CachedSummaries = &ObjCClassMethodSummaries;
1294
1295
666
  return getMethodSummary(S, ID, MD, ResultTy, *CachedSummaries);
1296
666
}