Coverage Report

Created: 2018-09-19 20:53

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/ADT/TinyPtrVector.h
Line
Count
Source (jump to first uncovered line)
1
//===- llvm/ADT/TinyPtrVector.h - 'Normally tiny' vectors -------*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_ADT_TINYPTRVECTOR_H
11
#define LLVM_ADT_TINYPTRVECTOR_H
12
13
#include "llvm/ADT/ArrayRef.h"
14
#include "llvm/ADT/None.h"
15
#include "llvm/ADT/PointerUnion.h"
16
#include "llvm/ADT/SmallVector.h"
17
#include <cassert>
18
#include <cstddef>
19
#include <iterator>
20
#include <type_traits>
21
22
namespace llvm {
23
24
/// TinyPtrVector - This class is specialized for cases where there are
25
/// normally 0 or 1 element in a vector, but is general enough to go beyond that
26
/// when required.
27
///
28
/// NOTE: This container doesn't allow you to store a null pointer into it.
29
///
30
template <typename EltTy>
31
class TinyPtrVector {
32
public:
33
  using VecTy = SmallVector<EltTy, 4>;
34
  using value_type = typename VecTy::value_type;
35
  using PtrUnion = PointerUnion<EltTy, VecTy *>;
36
37
private:
38
  PtrUnion Val;
39
40
public:
41
250M
  TinyPtrVector() = default;
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::TinyPtrVector()
llvm::TinyPtrVector<llvm::MCSymbol*>::TinyPtrVector()
Line
Count
Source
41
36
  TinyPtrVector() = default;
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Metadata*>::TinyPtrVector()
llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::TinyPtrVector()
Line
Count
Source
41
5.20M
  TinyPtrVector() = default;
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::PHINode*>::TinyPtrVector()
llvm::TinyPtrVector<llvm::Instruction*>::TinyPtrVector()
Line
Count
Source
41
2.55k
  TinyPtrVector() = default;
llvm::TinyPtrVector<llvm::Function*>::TinyPtrVector()
Line
Count
Source
41
1
  TinyPtrVector() = default;
Unexecuted instantiation: llvm::TinyPtrVector<clang::ModuleMacro*>::TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DISubprogram const*>::TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<int*>::TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*>::TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<clang::ObjCPropertyDecl*>::TinyPtrVector()
llvm::TinyPtrVector<clang::ParsedAttr*>::TinyPtrVector()
Line
Count
Source
41
244M
  TinyPtrVector() = default;
Unexecuted instantiation: llvm::TinyPtrVector<void*>::TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<clang::serialization::ModuleFile*>::TinyPtrVector()
llvm::TinyPtrVector<clang::NamedDecl*>::TinyPtrVector()
Line
Count
Source
41
4
  TinyPtrVector() = default;
Unexecuted instantiation: llvm::TinyPtrVector<clang::ParmVarDecl*>::TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<clang::Module*>::TinyPtrVector()
llvm::TinyPtrVector<clang::CXXMethodDecl const*>::TinyPtrVector()
Line
Count
Source
41
89.3k
  TinyPtrVector() = default;
llvm::TinyPtrVector<clang::CXXRecordDecl const*>::TinyPtrVector()
Line
Count
Source
41
12.3k
  TinyPtrVector() = default;
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::TinyPtrVector()
llvm::TinyPtrVector<lld::elf::InputSection*>::TinyPtrVector()
Line
Count
Source
41
388k
  TinyPtrVector() = default;
42
43
315M
  ~TinyPtrVector() {
44
315M
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
3.77M
      delete V;
46
315M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::~TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::~TinyPtrVector()
llvm::TinyPtrVector<llvm::MCSymbol*>::~TinyPtrVector()
Line
Count
Source
43
36
  ~TinyPtrVector() {
44
36
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
0
      delete V;
46
36
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Metadata*>::~TinyPtrVector()
llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::~TinyPtrVector()
Line
Count
Source
43
5.20M
  ~TinyPtrVector() {
44
5.20M
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
0
      delete V;
46
5.20M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::~TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::PHINode*>::~TinyPtrVector()
llvm::TinyPtrVector<llvm::Instruction*>::~TinyPtrVector()
Line
Count
Source
43
2.55k
  ~TinyPtrVector() {
44
2.55k
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
1.38k
      delete V;
46
2.55k
  }
llvm::TinyPtrVector<llvm::Function*>::~TinyPtrVector()
Line
Count
Source
43
2
  ~TinyPtrVector() {
44
2
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
0
      delete V;
46
2
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::ModuleMacro*>::~TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DISubprogram const*>::~TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<int*>::~TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*>::~TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<clang::ObjCPropertyDecl*>::~TinyPtrVector()
llvm::TinyPtrVector<clang::ParsedAttr*>::~TinyPtrVector()
Line
Count
Source
43
310M
  ~TinyPtrVector() {
44
310M
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
3.77M
      delete V;
46
310M
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::serialization::ModuleFile*>::~TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<void*>::~TinyPtrVector()
Unexecuted instantiation: llvm::TinyPtrVector<clang::ParmVarDecl*>::~TinyPtrVector()
llvm::TinyPtrVector<clang::NamedDecl*>::~TinyPtrVector()
Line
Count
Source
43
4
  ~TinyPtrVector() {
44
4
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
0
      delete V;
46
4
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::Module*>::~TinyPtrVector()
llvm::TinyPtrVector<clang::CXXMethodDecl const*>::~TinyPtrVector()
Line
Count
Source
43
100k
  ~TinyPtrVector() {
44
100k
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
0
      delete V;
46
100k
  }
llvm::TinyPtrVector<clang::CXXRecordDecl const*>::~TinyPtrVector()
Line
Count
Source
43
12.3k
  ~TinyPtrVector() {
44
12.3k
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
4.87k
      delete V;
46
12.3k
  }
llvm::TinyPtrVector<lld::elf::InputSection*>::~TinyPtrVector()
Line
Count
Source
43
388k
  ~TinyPtrVector() {
44
388k
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
45
3
      delete V;
46
388k
  }
47
48
65.6M
  TinyPtrVector(const TinyPtrVector &RHS) : Val(RHS.Val) {
49
65.6M
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
50
1.22M
      Val = new VecTy(*V);
51
65.6M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::TinyPtrVector(llvm::TinyPtrVector<llvm::Value*> const&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::PHINode*>::TinyPtrVector(llvm::TinyPtrVector<llvm::PHINode*> const&)
llvm::TinyPtrVector<llvm::Function*>::TinyPtrVector(llvm::TinyPtrVector<llvm::Function*> const&)
Line
Count
Source
48
1
  TinyPtrVector(const TinyPtrVector &RHS) : Val(RHS.Val) {
49
1
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
50
0
      Val = new VecTy(*V);
51
1
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DISubprogram const*>::TinyPtrVector(llvm::TinyPtrVector<llvm::DISubprogram const*> const&)
Unexecuted instantiation: llvm::TinyPtrVector<int*>::TinyPtrVector(llvm::TinyPtrVector<int*> const&)
llvm::TinyPtrVector<clang::ParsedAttr*>::TinyPtrVector(llvm::TinyPtrVector<clang::ParsedAttr*> const&)
Line
Count
Source
48
65.6M
  TinyPtrVector(const TinyPtrVector &RHS) : Val(RHS.Val) {
49
65.6M
    if (VecTy *V = Val.template dyn_cast<VecTy*>())
50
1.22M
      Val = new VecTy(*V);
51
65.6M
  }
52
53
49.5k
  TinyPtrVector &operator=(const TinyPtrVector &RHS) {
54
49.5k
    if (this == &RHS)
55
0
      return *this;
56
49.5k
    if (RHS.empty()) {
57
48.4k
      this->clear();
58
48.4k
      return *this;
59
48.4k
    }
60
1.09k
61
1.09k
    // Try to squeeze into the single slot. If it won't fit, allocate a copied
62
1.09k
    // vector.
63
1.09k
    if (Val.template is<EltTy>()) {
64
1.09k
      if (RHS.size() == 1)
65
1.09k
        Val = RHS.front();
66
0
      else
67
0
        Val = new VecTy(*RHS.Val.template get<VecTy*>());
68
1.09k
      return *this;
69
1.09k
    }
70
0
71
0
    // If we have a full vector allocated, try to re-use it.
72
0
    if (RHS.Val.template is<EltTy>()) {
73
0
      Val.template get<VecTy*>()->clear();
74
0
      Val.template get<VecTy*>()->push_back(RHS.front());
75
0
    } else {
76
0
      *Val.template get<VecTy*>() = *RHS.Val.template get<VecTy*>();
77
0
    }
78
0
    return *this;
79
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::operator=(llvm::TinyPtrVector<llvm::BasicBlock*> const&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::operator=(llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*> const&)
llvm::TinyPtrVector<clang::ParsedAttr*>::operator=(llvm::TinyPtrVector<clang::ParsedAttr*> const&)
Line
Count
Source
53
49.5k
  TinyPtrVector &operator=(const TinyPtrVector &RHS) {
54
49.5k
    if (this == &RHS)
55
0
      return *this;
56
49.5k
    if (RHS.empty()) {
57
48.4k
      this->clear();
58
48.4k
      return *this;
59
48.4k
    }
60
1.09k
61
1.09k
    // Try to squeeze into the single slot. If it won't fit, allocate a copied
62
1.09k
    // vector.
63
1.09k
    if (Val.template is<EltTy>()) {
64
1.09k
      if (RHS.size() == 1)
65
1.09k
        Val = RHS.front();
66
0
      else
67
0
        Val = new VecTy(*RHS.Val.template get<VecTy*>());
68
1.09k
      return *this;
69
1.09k
    }
70
0
71
0
    // If we have a full vector allocated, try to re-use it.
72
0
    if (RHS.Val.template is<EltTy>()) {
73
0
      Val.template get<VecTy*>()->clear();
74
0
      Val.template get<VecTy*>()->push_back(RHS.front());
75
0
    } else {
76
0
      *Val.template get<VecTy*>() = *RHS.Val.template get<VecTy*>();
77
0
    }
78
0
    return *this;
79
0
  }
80
81
100k
  TinyPtrVector(TinyPtrVector &&RHS) : Val(RHS.Val) {
82
100k
    RHS.Val = (EltTy)nullptr;
83
100k
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::TinyPtrVector(llvm::TinyPtrVector<llvm::BasicBlock*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::MCSymbol*>::TinyPtrVector(llvm::TinyPtrVector<llvm::MCSymbol*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Metadata*>::TinyPtrVector(llvm::TinyPtrVector<llvm::Metadata*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::TinyPtrVector(llvm::TinyPtrVector<llvm::Value*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::PHINode*>::TinyPtrVector(llvm::TinyPtrVector<llvm::PHINode*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::TinyPtrVector(llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Instruction*>::TinyPtrVector(llvm::TinyPtrVector<llvm::Instruction*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::TinyPtrVector(llvm::TinyPtrVector<llvm::AnalysisKey*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DISubprogram const*>::TinyPtrVector(llvm::TinyPtrVector<llvm::DISubprogram const*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<int*>::TinyPtrVector(llvm::TinyPtrVector<int*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*>::TinyPtrVector(llvm::TinyPtrVector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<clang::ObjCPropertyDecl*>::TinyPtrVector(llvm::TinyPtrVector<clang::ObjCPropertyDecl*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<clang::ParsedAttr*>::TinyPtrVector(llvm::TinyPtrVector<clang::ParsedAttr*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<void*>::TinyPtrVector(llvm::TinyPtrVector<void*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<clang::serialization::ModuleFile*>::TinyPtrVector(llvm::TinyPtrVector<clang::serialization::ModuleFile*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<clang::NamedDecl*>::TinyPtrVector(llvm::TinyPtrVector<clang::NamedDecl*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<clang::ParmVarDecl*>::TinyPtrVector(llvm::TinyPtrVector<clang::ParmVarDecl*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<clang::Module*>::TinyPtrVector(llvm::TinyPtrVector<clang::Module*>&&)
llvm::TinyPtrVector<clang::CXXMethodDecl const*>::TinyPtrVector(llvm::TinyPtrVector<clang::CXXMethodDecl const*>&&)
Line
Count
Source
81
100k
  TinyPtrVector(TinyPtrVector &&RHS) : Val(RHS.Val) {
82
100k
    RHS.Val = (EltTy)nullptr;
83
100k
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::CXXRecordDecl const*>::TinyPtrVector(llvm::TinyPtrVector<clang::CXXRecordDecl const*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<clang::ModuleMacro*>::TinyPtrVector(llvm::TinyPtrVector<clang::ModuleMacro*>&&)
84
85
1.92M
  TinyPtrVector &operator=(TinyPtrVector &&RHS) {
86
1.92M
    if (this == &RHS)
87
0
      return *this;
88
1.92M
    if (RHS.empty()) {
89
1.92M
      this->clear();
90
1.92M
      return *this;
91
1.92M
    }
92
0
93
0
    // If this vector has been allocated on the heap, re-use it if cheap. If it
94
0
    // would require more copying, just delete it and we'll steal the other
95
0
    // side.
96
0
    if (VecTy *V = Val.template dyn_cast<VecTy*>()) {
97
0
      if (RHS.Val.template is<EltTy>()) {
98
0
        V->clear();
99
0
        V->push_back(RHS.front());
100
0
        RHS.Val = (EltTy)nullptr;
101
0
        return *this;
102
0
      }
103
0
      delete V;
104
0
    }
105
0
106
0
    Val = RHS.Val;
107
0
    RHS.Val = (EltTy)nullptr;
108
0
    return *this;
109
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::operator=(llvm::TinyPtrVector<llvm::AnalysisKey*>&&)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::MCSymbol*>::operator=(llvm::TinyPtrVector<llvm::MCSymbol*>&&)
llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::operator=(llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>&&)
Line
Count
Source
85
1.92M
  TinyPtrVector &operator=(TinyPtrVector &&RHS) {
86
1.92M
    if (this == &RHS)
87
0
      return *this;
88
1.92M
    if (RHS.empty()) {
89
1.92M
      this->clear();
90
1.92M
      return *this;
91
1.92M
    }
92
0
93
0
    // If this vector has been allocated on the heap, re-use it if cheap. If it
94
0
    // would require more copying, just delete it and we'll steal the other
95
0
    // side.
96
0
    if (VecTy *V = Val.template dyn_cast<VecTy*>()) {
97
0
      if (RHS.Val.template is<EltTy>()) {
98
0
        V->clear();
99
0
        V->push_back(RHS.front());
100
0
        RHS.Val = (EltTy)nullptr;
101
0
        return *this;
102
0
      }
103
0
      delete V;
104
0
    }
105
0
106
0
    Val = RHS.Val;
107
0
    RHS.Val = (EltTy)nullptr;
108
0
    return *this;
109
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::operator=(llvm::TinyPtrVector<llvm::Value*>&&)
llvm::TinyPtrVector<clang::ParsedAttr*>::operator=(llvm::TinyPtrVector<clang::ParsedAttr*>&&)
Line
Count
Source
85
21
  TinyPtrVector &operator=(TinyPtrVector &&RHS) {
86
21
    if (this == &RHS)
87
0
      return *this;
88
21
    if (RHS.empty()) {
89
21
      this->clear();
90
21
      return *this;
91
21
    }
92
0
93
0
    // If this vector has been allocated on the heap, re-use it if cheap. If it
94
0
    // would require more copying, just delete it and we'll steal the other
95
0
    // side.
96
0
    if (VecTy *V = Val.template dyn_cast<VecTy*>()) {
97
0
      if (RHS.Val.template is<EltTy>()) {
98
0
        V->clear();
99
0
        V->push_back(RHS.front());
100
0
        RHS.Val = (EltTy)nullptr;
101
0
        return *this;
102
0
      }
103
0
      delete V;
104
0
    }
105
0
106
0
    Val = RHS.Val;
107
0
    RHS.Val = (EltTy)nullptr;
108
0
    return *this;
109
0
  }
110
111
  TinyPtrVector(std::initializer_list<EltTy> IL)
112
      : Val(IL.size() == 0
113
                ? PtrUnion()
114
                : IL.size() == 1 ? PtrUnion(*IL.begin())
115
0
                                 : PtrUnion(new VecTy(IL.begin(), IL.end()))) {}
116
117
  /// Constructor from an ArrayRef.
118
  ///
119
  /// This also is a constructor for individual array elements due to the single
120
  /// element constructor for ArrayRef.
121
  explicit TinyPtrVector(ArrayRef<EltTy> Elts)
122
      : Val(Elts.empty()
123
                ? PtrUnion()
124
                : Elts.size() == 1
125
                      ? PtrUnion(Elts[0])
126
                      : PtrUnion(new VecTy(Elts.begin(), Elts.end()))) {}
127
128
  TinyPtrVector(size_t Count, EltTy Value)
129
      : Val(Count == 0 ? PtrUnion()
130
                       : Count == 1 ? PtrUnion(Value)
131
                                    : PtrUnion(new VecTy(Count, Value))) {}
132
133
  // implicit conversion operator to ArrayRef.
134
0
  operator ArrayRef<EltTy>() const {
135
0
    if (Val.isNull())
136
0
      return None;
137
0
    if (Val.template is<EltTy>())
138
0
      return *Val.getAddrOfPtr1();
139
0
    return *Val.template get<VecTy*>();
140
0
  }
141
142
  // implicit conversion operator to MutableArrayRef.
143
133
  operator MutableArrayRef<EltTy>() {
144
133
    if (Val.isNull())
145
21
      return None;
146
112
    if (Val.template is<EltTy>())
147
111
      return *Val.getAddrOfPtr1();
148
1
    return *Val.template get<VecTy*>();
149
1
  }
llvm::TinyPtrVector<llvm::MCSymbol*>::operator llvm::MutableArrayRef<llvm::MCSymbol*>()
Line
Count
Source
143
108
  operator MutableArrayRef<EltTy>() {
144
108
    if (Val.isNull())
145
0
      return None;
146
108
    if (Val.template is<EltTy>())
147
108
      return *Val.getAddrOfPtr1();
148
0
    return *Val.template get<VecTy*>();
149
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::operator llvm::MutableArrayRef<llvm::Value*>()
Unexecuted instantiation: llvm::TinyPtrVector<clang::ModuleMacro*>::operator llvm::MutableArrayRef<clang::ModuleMacro*>()
Unexecuted instantiation: llvm::TinyPtrVector<clang::Module*>::operator llvm::MutableArrayRef<clang::Module*>()
llvm::TinyPtrVector<lld::elf::InputSection*>::operator llvm::MutableArrayRef<lld::elf::InputSection*>()
Line
Count
Source
143
25
  operator MutableArrayRef<EltTy>() {
144
25
    if (Val.isNull())
145
21
      return None;
146
4
    if (Val.template is<EltTy>())
147
3
      return *Val.getAddrOfPtr1();
148
1
    return *Val.template get<VecTy*>();
149
1
  }
150
151
  // Implicit conversion to ArrayRef<U> if EltTy* implicitly converts to U*.
152
  template<typename U,
153
           typename std::enable_if<
154
               std::is_convertible<ArrayRef<EltTy>, ArrayRef<U>>::value,
155
               bool>::type = false>
156
  operator ArrayRef<U>() const {
157
    return operator ArrayRef<EltTy>();
158
  }
159
160
87.2M
  bool empty() const {
161
87.2M
    // This vector can be empty if it contains no element, or if it
162
87.2M
    // contains a pointer to an empty vector.
163
87.2M
    if (Val.isNull()) 
return true83.5M
;
164
3.74M
    if (VecTy *Vec = Val.template dyn_cast<VecTy*>())
165
2.35M
      return Vec->empty();
166
1.39M
    return false;
167
1.39M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::empty() const
llvm::TinyPtrVector<llvm::MCSymbol*>::empty() const
Line
Count
Source
160
108
  bool empty() const {
161
108
    // This vector can be empty if it contains no element, or if it
162
108
    // contains a pointer to an empty vector.
163
108
    if (Val.isNull()) 
return true36
;
164
72
    if (VecTy *Vec = Val.template dyn_cast<VecTy*>())
165
0
      return Vec->empty();
166
72
    return false;
167
72
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::empty() const
llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::empty() const
Line
Count
Source
160
2.92M
  bool empty() const {
161
2.92M
    // This vector can be empty if it contains no element, or if it
162
2.92M
    // contains a pointer to an empty vector.
163
2.92M
    if (Val.isNull()) return true;
164
0
    if (VecTy *Vec = Val.template dyn_cast<VecTy*>())
165
0
      return Vec->empty();
166
0
    return false;
167
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::empty() const
llvm::TinyPtrVector<llvm::Instruction*>::empty() const
Line
Count
Source
160
6.74k
  bool empty() const {
161
6.74k
    // This vector can be empty if it contains no element, or if it
162
6.74k
    // contains a pointer to an empty vector.
163
6.74k
    if (Val.isNull()) 
return true0
;
164
6.74k
    if (VecTy *Vec = Val.template dyn_cast<VecTy*>())
165
4.40k
      return Vec->empty();
166
2.33k
    return false;
167
2.33k
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::ObjCPropertyDecl*>::empty() const
llvm::TinyPtrVector<clang::ParsedAttr*>::empty() const
Line
Count
Source
160
84.3M
  bool empty() const {
161
84.3M
    // This vector can be empty if it contains no element, or if it
162
84.3M
    // contains a pointer to an empty vector.
163
84.3M
    if (Val.isNull()) 
return true80.5M
;
164
3.73M
    if (VecTy *Vec = Val.template dyn_cast<VecTy*>())
165
2.35M
      return Vec->empty();
166
1.38M
    return false;
167
1.38M
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::serialization::ModuleFile*>::empty() const
Unexecuted instantiation: llvm::TinyPtrVector<void*>::empty() const
Unexecuted instantiation: llvm::TinyPtrVector<clang::ParmVarDecl*>::empty() const
168
169
3.65k
  unsigned size() const {
170
3.65k
    if (empty())
171
0
      return 0;
172
3.65k
    if (Val.template is<EltTy>())
173
2.26k
      return 1;
174
1.38k
    return Val.template get<VecTy*>()->size();
175
1.38k
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::size() const
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::size() const
llvm::TinyPtrVector<llvm::Instruction*>::size() const
Line
Count
Source
169
2.55k
  unsigned size() const {
170
2.55k
    if (empty())
171
0
      return 0;
172
2.55k
    if (Val.template is<EltTy>())
173
1.16k
      return 1;
174
1.38k
    return Val.template get<VecTy*>()->size();
175
1.38k
  }
llvm::TinyPtrVector<clang::ParsedAttr*>::size() const
Line
Count
Source
169
1.09k
  unsigned size() const {
170
1.09k
    if (empty())
171
0
      return 0;
172
1.09k
    if (Val.template is<EltTy>())
173
1.09k
      return 1;
174
0
    return Val.template get<VecTy*>()->size();
175
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<void*>::size() const
Unexecuted instantiation: llvm::TinyPtrVector<clang::ParmVarDecl*>::size() const
176
177
  using iterator = EltTy *;
178
  using const_iterator = const EltTy *;
179
  using reverse_iterator = std::reverse_iterator<iterator>;
180
  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
181
182
696M
  iterator begin() {
183
696M
    if (Val.template is<EltTy>())
184
690M
      return Val.getAddrOfPtr1();
185
6.31M
186
6.31M
    return Val.template get<VecTy *>()->begin();
187
6.31M
  }
llvm::TinyPtrVector<clang::ParsedAttr*>::begin()
Line
Count
Source
182
691M
  iterator begin() {
183
691M
    if (Val.template is<EltTy>())
184
684M
      return Val.getAddrOfPtr1();
185
6.30M
186
6.30M
    return Val.template get<VecTy *>()->begin();
187
6.30M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::MCSymbol*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Metadata*>::begin()
llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::begin()
Line
Count
Source
182
4.38M
  iterator begin() {
183
4.38M
    if (Val.template is<EltTy>())
184
4.38M
      return Val.getAddrOfPtr1();
185
0
186
0
    return Val.template get<VecTy *>()->begin();
187
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::PHINode*>::begin()
llvm::TinyPtrVector<llvm::Instruction*>::begin()
Line
Count
Source
182
1.40k
  iterator begin() {
183
1.40k
    if (Val.template is<EltTy>())
184
0
      return Val.getAddrOfPtr1();
185
1.40k
186
1.40k
    return Val.template get<VecTy *>()->begin();
187
1.40k
  }
llvm::TinyPtrVector<llvm::Function*>::begin()
Line
Count
Source
182
2
  iterator begin() {
183
2
    if (Val.template is<EltTy>())
184
2
      return Val.getAddrOfPtr1();
185
0
186
0
    return Val.template get<VecTy *>()->begin();
187
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DISubprogram const*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<int*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<clang::ObjCPropertyDecl*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<clang::serialization::ModuleFile*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<void*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<clang::NamedDecl*>::begin()
Unexecuted instantiation: llvm::TinyPtrVector<clang::Module*>::begin()
llvm::TinyPtrVector<clang::CXXMethodDecl const*>::begin()
Line
Count
Source
182
1.00M
  iterator begin() {
183
1.00M
    if (Val.template is<EltTy>())
184
998k
      return Val.getAddrOfPtr1();
185
3.52k
186
3.52k
    return Val.template get<VecTy *>()->begin();
187
3.52k
  }
llvm::TinyPtrVector<clang::CXXRecordDecl const*>::begin()
Line
Count
Source
182
61.5k
  iterator begin() {
183
61.5k
    if (Val.template is<EltTy>())
184
56.8k
      return Val.getAddrOfPtr1();
185
4.66k
186
4.66k
    return Val.template get<VecTy *>()->begin();
187
4.66k
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::ModuleMacro*>::begin()
llvm::TinyPtrVector<lld::elf::InputSection*>::begin()
Line
Count
Source
182
669
  iterator begin() {
183
669
    if (Val.template is<EltTy>())
184
668
      return Val.getAddrOfPtr1();
185
1
186
1
    return Val.template get<VecTy *>()->begin();
187
1
  }
188
189
350M
  iterator end() {
190
350M
    if (Val.template is<EltTy>())
191
344M
      return begin() + (Val.isNull() ? 
0339M
:
15.08M
);
192
6.68M
193
6.68M
    return Val.template get<VecTy *>()->end();
194
6.68M
  }
llvm::TinyPtrVector<clang::ParsedAttr*>::end()
Line
Count
Source
189
348M
  iterator end() {
190
348M
    if (Val.template is<EltTy>())
191
341M
      return begin() + (Val.isNull() ? 
0336M
:
14.57M
);
192
6.67M
193
6.67M
    return Val.template get<VecTy *>()->end();
194
6.67M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::MCSymbol*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Metadata*>::end()
llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::end()
Line
Count
Source
189
2.19M
  iterator end() {
190
2.19M
    if (Val.template is<EltTy>())
191
2.19M
      return begin() + (Val.isNull() ? 0 : 
10
);
192
0
193
0
    return Val.template get<VecTy *>()->end();
194
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::PHINode*>::end()
llvm::TinyPtrVector<llvm::Instruction*>::end()
Line
Count
Source
189
1.40k
  iterator end() {
190
1.40k
    if (Val.template is<EltTy>())
191
0
      return begin() + (Val.isNull() ? 0 : 1);
192
1.40k
193
1.40k
    return Val.template get<VecTy *>()->end();
194
1.40k
  }
llvm::TinyPtrVector<llvm::Function*>::end()
Line
Count
Source
189
1
  iterator end() {
190
1
    if (Val.template is<EltTy>())
191
1
      return begin() + (Val.isNull() ? 
00
: 1);
192
0
193
0
    return Val.template get<VecTy *>()->end();
194
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DISubprogram const*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<int*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<clang::ObjCPropertyDecl*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<clang::serialization::ModuleFile*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<void*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<clang::NamedDecl*>::end()
Unexecuted instantiation: llvm::TinyPtrVector<clang::Module*>::end()
llvm::TinyPtrVector<clang::CXXMethodDecl const*>::end()
Line
Count
Source
189
502k
  iterator end() {
190
502k
    if (Val.template is<EltTy>())
191
499k
      return begin() + (Val.isNull() ? 
00
: 1);
192
3.52k
193
3.52k
    return Val.template get<VecTy *>()->end();
194
3.52k
  }
llvm::TinyPtrVector<clang::CXXRecordDecl const*>::end()
Line
Count
Source
189
47.2k
  iterator end() {
190
47.2k
    if (Val.template is<EltTy>())
191
37.9k
      return begin() + (Val.isNull() ? 
024.6k
:
113.2k
);
192
9.33k
193
9.33k
    return Val.template get<VecTy *>()->end();
194
9.33k
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::ModuleMacro*>::end()
llvm::TinyPtrVector<lld::elf::InputSection*>::end()
Line
Count
Source
189
335
  iterator end() {
190
335
    if (Val.template is<EltTy>())
191
334
      return begin() + (Val.isNull() ? 
0322
:
112
);
192
1
193
1
    return Val.template get<VecTy *>()->end();
194
1
  }
195
196
63.6M
  const_iterator begin() const {
197
63.6M
    return (const_iterator)const_cast<TinyPtrVector*>(this)->begin();
198
63.6M
  }
llvm::TinyPtrVector<clang::ParsedAttr*>::begin() const
Line
Count
Source
196
63.0M
  const_iterator begin() const {
197
63.0M
    return (const_iterator)const_cast<TinyPtrVector*>(this)->begin();
198
63.0M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::begin() const
llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::begin() const
Line
Count
Source
196
21.0k
  const_iterator begin() const {
197
21.0k
    return (const_iterator)const_cast<TinyPtrVector*>(this)->begin();
198
21.0k
  }
llvm::TinyPtrVector<llvm::Function*>::begin() const
Line
Count
Source
196
1
  const_iterator begin() const {
197
1
    return (const_iterator)const_cast<TinyPtrVector*>(this)->begin();
198
1
  }
Unexecuted instantiation: llvm::TinyPtrVector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*>::begin() const
Unexecuted instantiation: llvm::TinyPtrVector<void*>::begin() const
llvm::TinyPtrVector<clang::CXXMethodDecl const*>::begin() const
Line
Count
Source
196
502k
  const_iterator begin() const {
197
502k
    return (const_iterator)const_cast<TinyPtrVector*>(this)->begin();
198
502k
  }
llvm::TinyPtrVector<clang::CXXRecordDecl const*>::begin() const
Line
Count
Source
196
2.05k
  const_iterator begin() const {
197
2.05k
    return (const_iterator)const_cast<TinyPtrVector*>(this)->begin();
198
2.05k
  }
199
200
67.1M
  const_iterator end() const {
201
67.1M
    return (const_iterator)const_cast<TinyPtrVector*>(this)->end();
202
67.1M
  }
llvm::TinyPtrVector<clang::ParsedAttr*>::end() const
Line
Count
Source
200
66.6M
  const_iterator end() const {
201
66.6M
    return (const_iterator)const_cast<TinyPtrVector*>(this)->end();
202
66.6M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::end() const
llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::end() const
Line
Count
Source
200
21.0k
  const_iterator end() const {
201
21.0k
    return (const_iterator)const_cast<TinyPtrVector*>(this)->end();
202
21.0k
  }
llvm::TinyPtrVector<llvm::Function*>::end() const
Line
Count
Source
200
1
  const_iterator end() const {
201
1
    return (const_iterator)const_cast<TinyPtrVector*>(this)->end();
202
1
  }
Unexecuted instantiation: llvm::TinyPtrVector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*>::end() const
llvm::TinyPtrVector<clang::CXXMethodDecl const*>::end() const
Line
Count
Source
200
502k
  const_iterator end() const {
201
502k
    return (const_iterator)const_cast<TinyPtrVector*>(this)->end();
202
502k
  }
llvm::TinyPtrVector<clang::CXXRecordDecl const*>::end() const
Line
Count
Source
200
4.11k
  const_iterator end() const {
201
4.11k
    return (const_iterator)const_cast<TinyPtrVector*>(this)->end();
202
4.11k
  }
203
204
  reverse_iterator rbegin() { return reverse_iterator(end()); }
205
  reverse_iterator rend() { return reverse_iterator(begin()); }
206
207
  const_reverse_iterator rbegin() const {
208
    return const_reverse_iterator(end());
209
  }
210
211
  const_reverse_iterator rend() const {
212
    return const_reverse_iterator(begin());
213
  }
214
215
0
  EltTy operator[](unsigned i) const {
216
0
    assert(!Val.isNull() && "can't index into an empty vector");
217
0
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
218
0
      assert(i == 0 && "tinyvector index out of range");
219
0
      return V;
220
0
    }
221
0
222
0
    assert(i < Val.template get<VecTy*>()->size() &&
223
0
           "tinyvector index out of range");
224
0
    return (*Val.template get<VecTy*>())[i];
225
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::ParsedAttr*>::operator[](unsigned int) const
Unexecuted instantiation: llvm::TinyPtrVector<clang::ParmVarDecl*>::operator[](unsigned int) const
226
227
1.09k
  EltTy front() const {
228
1.09k
    assert(!empty() && "vector empty");
229
1.09k
    if (EltTy V = Val.template dyn_cast<EltTy>())
230
1.09k
      return V;
231
0
    return Val.template get<VecTy*>()->front();
232
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::front() const
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::front() const
Unexecuted instantiation: llvm::TinyPtrVector<llvm::MCSymbol*>::front() const
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::front() const
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::front() const
Unexecuted instantiation: llvm::TinyPtrVector<clang::ObjCPropertyDecl*>::front() const
llvm::TinyPtrVector<clang::ParsedAttr*>::front() const
Line
Count
Source
227
1.09k
  EltTy front() const {
228
1.09k
    assert(!empty() && "vector empty");
229
1.09k
    if (EltTy V = Val.template dyn_cast<EltTy>())
230
1.09k
      return V;
231
0
    return Val.template get<VecTy*>()->front();
232
0
  }
233
234
0
  EltTy back() const {
235
0
    assert(!empty() && "vector empty");
236
0
    if (EltTy V = Val.template dyn_cast<EltTy>())
237
0
      return V;
238
0
    return Val.template get<VecTy*>()->back();
239
0
  }
240
241
7.32M
  void push_back(EltTy NewVal) {
242
7.32M
    assert(NewVal && "Can't add a null value");
243
7.32M
244
7.32M
    // If we have nothing, add something.
245
7.32M
    if (Val.isNull()) {
246
4.37M
      Val = NewVal;
247
4.37M
      return;
248
4.37M
    }
249
2.94M
250
2.94M
    // If we have a single value, convert to a vector.
251
2.94M
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
252
2.38M
      Val = new VecTy();
253
2.38M
      Val.template get<VecTy*>()->push_back(V);
254
2.38M
    }
255
2.94M
256
2.94M
    // Add the new value, we know we have a vector.
257
2.94M
    Val.template get<VecTy*>()->push_back(NewVal);
258
2.94M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::push_back(llvm::BasicBlock*)
llvm::TinyPtrVector<llvm::MCSymbol*>::push_back(llvm::MCSymbol*)
Line
Count
Source
241
36
  void push_back(EltTy NewVal) {
242
36
    assert(NewVal && "Can't add a null value");
243
36
244
36
    // If we have nothing, add something.
245
36
    if (Val.isNull()) {
246
36
      Val = NewVal;
247
36
      return;
248
36
    }
249
0
250
0
    // If we have a single value, convert to a vector.
251
0
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
252
0
      Val = new VecTy();
253
0
      Val.template get<VecTy*>()->push_back(V);
254
0
    }
255
0
256
0
    // Add the new value, we know we have a vector.
257
0
    Val.template get<VecTy*>()->push_back(NewVal);
258
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Metadata*>::push_back(llvm::Metadata*)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::push_back(llvm::Value*)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::PHINode*>::push_back(llvm::PHINode*)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::push_back(llvm::DbgVariableIntrinsic*)
llvm::TinyPtrVector<llvm::Instruction*>::push_back(llvm::Instruction*)
Line
Count
Source
241
4.18k
  void push_back(EltTy NewVal) {
242
4.18k
    assert(NewVal && "Can't add a null value");
243
4.18k
244
4.18k
    // If we have nothing, add something.
245
4.18k
    if (Val.isNull()) {
246
2.55k
      Val = NewVal;
247
2.55k
      return;
248
2.55k
    }
249
1.63k
250
1.63k
    // If we have a single value, convert to a vector.
251
1.63k
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
252
1.38k
      Val = new VecTy();
253
1.38k
      Val.template get<VecTy*>()->push_back(V);
254
1.38k
    }
255
1.63k
256
1.63k
    // Add the new value, we know we have a vector.
257
1.63k
    Val.template get<VecTy*>()->push_back(NewVal);
258
1.63k
  }
llvm::TinyPtrVector<llvm::Function*>::push_back(llvm::Function*)
Line
Count
Source
241
1
  void push_back(EltTy NewVal) {
242
1
    assert(NewVal && "Can't add a null value");
243
1
244
1
    // If we have nothing, add something.
245
1
    if (Val.isNull()) {
246
1
      Val = NewVal;
247
1
      return;
248
1
    }
249
0
250
0
    // If we have a single value, convert to a vector.
251
0
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
252
0
      Val = new VecTy();
253
0
      Val.template get<VecTy*>()->push_back(V);
254
0
    }
255
0
256
0
    // Add the new value, we know we have a vector.
257
0
    Val.template get<VecTy*>()->push_back(NewVal);
258
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::DISubprogram const*>::push_back(llvm::DISubprogram const*)
Unexecuted instantiation: llvm::TinyPtrVector<int*>::push_back(int*)
Unexecuted instantiation: llvm::TinyPtrVector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*>::push_back(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, llvm::TypeIdSummary> const*)
Unexecuted instantiation: llvm::TinyPtrVector<clang::ObjCPropertyDecl*>::push_back(clang::ObjCPropertyDecl*)
llvm::TinyPtrVector<clang::ParsedAttr*>::push_back(clang::ParsedAttr*)
Line
Count
Source
241
7.20M
  void push_back(EltTy NewVal) {
242
7.20M
    assert(NewVal && "Can't add a null value");
243
7.20M
244
7.20M
    // If we have nothing, add something.
245
7.20M
    if (Val.isNull()) {
246
4.27M
      Val = NewVal;
247
4.27M
      return;
248
4.27M
    }
249
2.93M
250
2.93M
    // If we have a single value, convert to a vector.
251
2.93M
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
252
2.37M
      Val = new VecTy();
253
2.37M
      Val.template get<VecTy*>()->push_back(V);
254
2.37M
    }
255
2.93M
256
2.93M
    // Add the new value, we know we have a vector.
257
2.93M
    Val.template get<VecTy*>()->push_back(NewVal);
258
2.93M
  }
Unexecuted instantiation: llvm::TinyPtrVector<void*>::push_back(void*)
llvm::TinyPtrVector<clang::NamedDecl*>::push_back(clang::NamedDecl*)
Line
Count
Source
241
4
  void push_back(EltTy NewVal) {
242
4
    assert(NewVal && "Can't add a null value");
243
4
244
4
    // If we have nothing, add something.
245
4
    if (Val.isNull()) {
246
4
      Val = NewVal;
247
4
      return;
248
4
    }
249
0
250
0
    // If we have a single value, convert to a vector.
251
0
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
252
0
      Val = new VecTy();
253
0
      Val.template get<VecTy*>()->push_back(V);
254
0
    }
255
0
256
0
    // Add the new value, we know we have a vector.
257
0
    Val.template get<VecTy*>()->push_back(NewVal);
258
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::ParmVarDecl*>::push_back(clang::ParmVarDecl*)
Unexecuted instantiation: llvm::TinyPtrVector<clang::Module*>::push_back(clang::Module*)
llvm::TinyPtrVector<clang::CXXMethodDecl const*>::push_back(clang::CXXMethodDecl const*)
Line
Count
Source
241
89.9k
  void push_back(EltTy NewVal) {
242
89.9k
    assert(NewVal && "Can't add a null value");
243
89.9k
244
89.9k
    // If we have nothing, add something.
245
89.9k
    if (Val.isNull()) {
246
89.3k
      Val = NewVal;
247
89.3k
      return;
248
89.3k
    }
249
551
250
551
    // If we have a single value, convert to a vector.
251
551
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
252
371
      Val = new VecTy();
253
371
      Val.template get<VecTy*>()->push_back(V);
254
371
    }
255
551
256
551
    // Add the new value, we know we have a vector.
257
551
    Val.template get<VecTy*>()->push_back(NewVal);
258
551
  }
llvm::TinyPtrVector<clang::CXXRecordDecl const*>::push_back(clang::CXXRecordDecl const*)
Line
Count
Source
241
21.5k
  void push_back(EltTy NewVal) {
242
21.5k
    assert(NewVal && "Can't add a null value");
243
21.5k
244
21.5k
    // If we have nothing, add something.
245
21.5k
    if (Val.isNull()) {
246
12.3k
      Val = NewVal;
247
12.3k
      return;
248
12.3k
    }
249
9.25k
250
9.25k
    // If we have a single value, convert to a vector.
251
9.25k
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
252
4.87k
      Val = new VecTy();
253
4.87k
      Val.template get<VecTy*>()->push_back(V);
254
4.87k
    }
255
9.25k
256
9.25k
    // Add the new value, we know we have a vector.
257
9.25k
    Val.template get<VecTy*>()->push_back(NewVal);
258
9.25k
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::ModuleMacro*>::push_back(clang::ModuleMacro*)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::push_back(llvm::AnalysisKey*)
llvm::TinyPtrVector<lld::elf::InputSection*>::push_back(lld::elf::InputSection*)
Line
Count
Source
241
121
  void push_back(EltTy NewVal) {
242
121
    assert(NewVal && "Can't add a null value");
243
121
244
121
    // If we have nothing, add something.
245
121
    if (Val.isNull()) {
246
118
      Val = NewVal;
247
118
      return;
248
118
    }
249
3
250
3
    // If we have a single value, convert to a vector.
251
3
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
252
3
      Val = new VecTy();
253
3
      Val.template get<VecTy*>()->push_back(V);
254
3
    }
255
3
256
3
    // Add the new value, we know we have a vector.
257
3
    Val.template get<VecTy*>()->push_back(NewVal);
258
3
  }
259
260
  void pop_back() {
261
    // If we have a single value, convert to empty.
262
    if (Val.template is<EltTy>())
263
      Val = (EltTy)nullptr;
264
    else if (VecTy *Vec = Val.template get<VecTy*>())
265
      Vec->pop_back();
266
  }
267
268
120M
  void clear() {
269
120M
    // If we have a single value, convert to empty.
270
120M
    if (Val.template is<EltTy>()) {
271
120M
      Val = (EltTy)nullptr;
272
120M
    } else 
if (VecTy *391k
Vec391k
= Val.template dyn_cast<VecTy*>()) {
273
391k
      // If we have a vector form, just clear it.
274
391k
      Vec->clear();
275
391k
    }
276
120M
    // Otherwise, we're already empty.
277
120M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::clear()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::MCSymbol*>::clear()
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::clear()
llvm::TinyPtrVector<llvm::DbgVariableIntrinsic*>::clear()
Line
Count
Source
268
2.81M
  void clear() {
269
2.81M
    // If we have a single value, convert to empty.
270
2.81M
    if (Val.template is<EltTy>()) {
271
2.81M
      Val = (EltTy)nullptr;
272
2.81M
    } else 
if (VecTy *0
Vec0
= Val.template dyn_cast<VecTy*>()) {
273
0
      // If we have a vector form, just clear it.
274
0
      Vec->clear();
275
0
    }
276
2.81M
    // Otherwise, we're already empty.
277
2.81M
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::Value*>::clear()
llvm::TinyPtrVector<llvm::Instruction*>::clear()
Line
Count
Source
268
2.55k
  void clear() {
269
2.55k
    // If we have a single value, convert to empty.
270
2.55k
    if (Val.template is<EltTy>()) {
271
1.16k
      Val = (EltTy)nullptr;
272
1.38k
    } else if (VecTy *Vec = Val.template dyn_cast<VecTy*>()) {
273
1.38k
      // If we have a vector form, just clear it.
274
1.38k
      Vec->clear();
275
1.38k
    }
276
2.55k
    // Otherwise, we're already empty.
277
2.55k
  }
llvm::TinyPtrVector<clang::ParsedAttr*>::clear()
Line
Count
Source
268
118M
  void clear() {
269
118M
    // If we have a single value, convert to empty.
270
118M
    if (Val.template is<EltTy>()) {
271
117M
      Val = (EltTy)nullptr;
272
117M
    } else 
if (VecTy *390k
Vec390k
= Val.template dyn_cast<VecTy*>()) {
273
390k
      // If we have a vector form, just clear it.
274
390k
      Vec->clear();
275
390k
    }
276
118M
    // Otherwise, we're already empty.
277
118M
  }
Unexecuted instantiation: llvm::TinyPtrVector<clang::serialization::ModuleFile*>::clear()
Unexecuted instantiation: llvm::TinyPtrVector<void*>::clear()
Unexecuted instantiation: llvm::TinyPtrVector<clang::ModuleMacro*>::clear()
278
279
25.1k
  iterator erase(iterator I) {
280
25.1k
    assert(I >= begin() && "Iterator to erase is out of bounds.");
281
25.1k
    assert(I < end() && "Erasing at past-the-end iterator.");
282
25.1k
283
25.1k
    // If we have a single value, convert to empty.
284
25.1k
    if (Val.template is<EltTy>()) {
285
21.9k
      if (I == begin())
286
21.9k
        Val = (EltTy)nullptr;
287
21.9k
    } else 
if (VecTy *3.12k
Vec3.12k
= Val.template dyn_cast<VecTy*>()) {
288
3.12k
      // multiple items in a vector; just do the erase, there is no
289
3.12k
      // benefit to collapsing back to a pointer
290
3.12k
      return Vec->erase(I);
291
3.12k
    }
292
21.9k
    return end();
293
21.9k
  }
294
295
0
  iterator erase(iterator S, iterator E) {
296
0
    assert(S >= begin() && "Range to erase is out of bounds.");
297
0
    assert(S <= E && "Trying to erase invalid range.");
298
0
    assert(E <= end() && "Trying to erase past the end.");
299
0
300
0
    if (Val.template is<EltTy>()) {
301
0
      if (S == begin() && S != E)
302
0
        Val = (EltTy)nullptr;
303
0
    } else if (VecTy *Vec = Val.template dyn_cast<VecTy*>()) {
304
0
      return Vec->erase(S, E);
305
0
    }
306
0
    return end();
307
0
  }
Unexecuted instantiation: llvm::TinyPtrVector<llvm::AnalysisKey*>::erase(llvm::AnalysisKey**, llvm::AnalysisKey**)
Unexecuted instantiation: llvm::TinyPtrVector<llvm::BasicBlock*>::erase(llvm::BasicBlock**, llvm::BasicBlock**)
Unexecuted instantiation: llvm::TinyPtrVector<void*>::erase(void**, void**)
Unexecuted instantiation: llvm::TinyPtrVector<clang::Module*>::erase(clang::Module**, clang::Module**)
Unexecuted instantiation: llvm::TinyPtrVector<clang::ModuleMacro*>::erase(clang::ModuleMacro**, clang::ModuleMacro**)
308
309
  iterator insert(iterator I, const EltTy &Elt) {
310
    assert(I >= this->begin() && "Insertion iterator is out of bounds.");
311
    assert(I <= this->end() && "Inserting past the end of the vector.");
312
    if (I == end()) {
313
      push_back(Elt);
314
      return std::prev(end());
315
    }
316
    assert(!Val.isNull() && "Null value with non-end insert iterator.");
317
    if (EltTy V = Val.template dyn_cast<EltTy>()) {
318
      assert(I == begin());
319
      Val = Elt;
320
      push_back(V);
321
      return begin();
322
    }
323
324
    return Val.template get<VecTy*>()->insert(I, Elt);
325
  }
326
327
  template<typename ItTy>
328
58.8M
  iterator insert(iterator I, ItTy From, ItTy To) {
329
58.8M
    assert(I >= this->begin() && "Insertion iterator is out of bounds.");
330
58.8M
    assert(I <= this->end() && "Inserting past the end of the vector.");
331
58.8M
    if (From == To)
332
57.9M
      return I;
333
864k
334
864k
    // If we have a single value, convert to a vector.
335
864k
    ptrdiff_t Offset = I - begin();
336
864k
    if (Val.isNull()) {
337
835k
      if (std::next(From) == To) {
338
685k
        Val = *From;
339
685k
        return begin();
340
685k
      }
341
149k
342
149k
      Val = new VecTy();
343
149k
    } else 
if (EltTy 29.6k
V29.6k
= Val.template dyn_cast<EltTy>()) {
344
18.1k
      Val = new VecTy();
345
18.1k
      Val.template get<VecTy*>()->push_back(V);
346
18.1k
    }
347
864k
    
return Val.template get<VecTy*>()->insert(begin() + Offset, From, To)179k
;
348
864k
  }
Unexecuted instantiation: llvm::MCSymbol** llvm::TinyPtrVector<llvm::MCSymbol*>::insert<llvm::MCSymbol**>(llvm::MCSymbol**, llvm::MCSymbol**, llvm::MCSymbol**)
clang::ParsedAttr** llvm::TinyPtrVector<clang::ParsedAttr*>::insert<clang::ParsedAttr**>(clang::ParsedAttr**, clang::ParsedAttr**, clang::ParsedAttr**)
Line
Count
Source
328
58.8M
  iterator insert(iterator I, ItTy From, ItTy To) {
329
58.8M
    assert(I >= this->begin() && "Insertion iterator is out of bounds.");
330
58.8M
    assert(I <= this->end() && "Inserting past the end of the vector.");
331
58.8M
    if (From == To)
332
57.9M
      return I;
333
864k
334
864k
    // If we have a single value, convert to a vector.
335
864k
    ptrdiff_t Offset = I - begin();
336
864k
    if (Val.isNull()) {
337
835k
      if (std::next(From) == To) {
338
685k
        Val = *From;
339
685k
        return begin();
340
685k
      }
341
149k
342
149k
      Val = new VecTy();
343
149k
    } else 
if (EltTy 29.6k
V29.6k
= Val.template dyn_cast<EltTy>()) {
344
18.1k
      Val = new VecTy();
345
18.1k
      Val.template get<VecTy*>()->push_back(V);
346
18.1k
    }
347
864k
    
return Val.template get<VecTy*>()->insert(begin() + Offset, From, To)179k
;
348
864k
  }
Unexecuted instantiation: clang::ParsedAttr** llvm::TinyPtrVector<clang::ParsedAttr*>::insert<clang::ParsedAttr* const*>(clang::ParsedAttr**, clang::ParsedAttr* const*, clang::ParsedAttr* const*)
Unexecuted instantiation: clang::serialization::ModuleFile** llvm::TinyPtrVector<clang::serialization::ModuleFile*>::insert<clang::serialization::ModuleFile**>(clang::serialization::ModuleFile**, clang::serialization::ModuleFile**, clang::serialization::ModuleFile**)
Unexecuted instantiation: clang::ModuleMacro** llvm::TinyPtrVector<clang::ModuleMacro*>::insert<clang::ModuleMacro* const*>(clang::ModuleMacro**, clang::ModuleMacro* const*, clang::ModuleMacro* const*)
Unexecuted instantiation: clang::ModuleMacro** llvm::TinyPtrVector<clang::ModuleMacro*>::insert<clang::ModuleMacro**>(clang::ModuleMacro**, clang::ModuleMacro**, clang::ModuleMacro**)
349
};
350
351
} // end namespace llvm
352
353
#endif // LLVM_ADT_TINYPTRVECTOR_H