Coverage Report

Created: 2021-09-21 08:58

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