Coverage Report

Created: 2020-02-15 09:57

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