Coverage Report

Created: 2019-07-24 05:18

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