Coverage Report

Created: 2020-09-22 08:39

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