Coverage Report

Created: 2018-12-14 11:24

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/ADT/SetOperations.h
Line
Count
Source
1
//===-- llvm/ADT/SetOperations.h - Generic Set Operations -------*- 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
// This file defines generic set operations that may be used on set's of
11
// different types, and different element types.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_ADT_SETOPERATIONS_H
16
#define LLVM_ADT_SETOPERATIONS_H
17
18
namespace llvm {
19
20
/// set_union(A, B) - Compute A := A u B, return whether A changed.
21
///
22
template <class S1Ty, class S2Ty>
23
53.0M
bool set_union(S1Ty &S1, const S2Ty &S2) {
24
53.0M
  bool Changed = false;
25
53.0M
26
53.0M
  for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end();
27
102M
       SI != SE; 
++SI49.2M
)
28
49.2M
    if (S1.insert(*SI).second)
29
40.5M
      Changed = true;
30
53.0M
31
53.0M
  return Changed;
32
53.0M
}
bool llvm::set_union<llvm::DenseSet<unsigned int, llvm::DenseMapInfo<unsigned int> >, llvm::SmallVector<unsigned int, 16u> >(llvm::DenseSet<unsigned int, llvm::DenseMapInfo<unsigned int> >&, llvm::SmallVector<unsigned int, 16u> const&)
Line
Count
Source
23
53.0M
bool set_union(S1Ty &S1, const S2Ty &S2) {
24
53.0M
  bool Changed = false;
25
53.0M
26
53.0M
  for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end();
27
102M
       SI != SE; 
++SI49.1M
)
28
49.1M
    if (S1.insert(*SI).second)
29
40.5M
      Changed = true;
30
53.0M
31
53.0M
  return Changed;
32
53.0M
}
bool llvm::set_union<llvm::DenseSet<llvm::Value const*, llvm::DenseMapInfo<llvm::Value const*> >, llvm::DenseSet<llvm::Value const*, llvm::DenseMapInfo<llvm::Value const*> > >(llvm::DenseSet<llvm::Value const*, llvm::DenseMapInfo<llvm::Value const*> >&, llvm::DenseSet<llvm::Value const*, llvm::DenseMapInfo<llvm::Value const*> > const&)
Line
Count
Source
23
53
bool set_union(S1Ty &S1, const S2Ty &S2) {
24
53
  bool Changed = false;
25
53
26
53
  for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end();
27
120
       SI != SE; 
++SI67
)
28
67
    if (S1.insert(*SI).second)
29
67
      Changed = true;
30
53
31
53
  return Changed;
32
53
}
bool llvm::set_union<llvm::SmallMapVector<lld::elf::OutputSection const*, lld::elf::MipsGotSection::FileGot::PageBlock, 16u>, llvm::SmallMapVector<lld::elf::OutputSection const*, lld::elf::MipsGotSection::FileGot::PageBlock, 16u> >(llvm::SmallMapVector<lld::elf::OutputSection const*, lld::elf::MipsGotSection::FileGot::PageBlock, 16u>&, llvm::SmallMapVector<lld::elf::OutputSection const*, lld::elf::MipsGotSection::FileGot::PageBlock, 16u> const&)
Line
Count
Source
23
59
bool set_union(S1Ty &S1, const S2Ty &S2) {
24
59
  bool Changed = false;
25
59
26
59
  for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end();
27
74
       SI != SE; 
++SI15
)
28
15
    if (S1.insert(*SI).second)
29
14
      Changed = true;
30
59
31
59
  return Changed;
32
59
}
bool llvm::set_union<llvm::MapVector<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long, llvm::DenseMap<std::__1::pair<lld::elf::Symbol*, long long>, unsigned int, llvm::DenseMapInfo<std::__1::pair<lld::elf::Symbol*, long long> >, llvm::detail::DenseMapPair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned int> >, std::__1::vector<std::__1::pair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long>, std::__1::allocator<std::__1::pair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long> > > >, llvm::MapVector<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long, llvm::DenseMap<std::__1::pair<lld::elf::Symbol*, long long>, unsigned int, llvm::DenseMapInfo<std::__1::pair<lld::elf::Symbol*, long long> >, llvm::detail::DenseMapPair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned int> >, std::__1::vector<std::__1::pair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long>, std::__1::allocator<std::__1::pair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long> > > > >(llvm::MapVector<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long, llvm::DenseMap<std::__1::pair<lld::elf::Symbol*, long long>, unsigned int, llvm::DenseMapInfo<std::__1::pair<lld::elf::Symbol*, long long> >, llvm::detail::DenseMapPair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned int> >, std::__1::vector<std::__1::pair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long>, std::__1::allocator<std::__1::pair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long> > > >&, llvm::MapVector<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long, llvm::DenseMap<std::__1::pair<lld::elf::Symbol*, long long>, unsigned int, llvm::DenseMapInfo<std::__1::pair<lld::elf::Symbol*, long long> >, llvm::detail::DenseMapPair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned int> >, std::__1::vector<std::__1::pair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long>, std::__1::allocator<std::__1::pair<std::__1::pair<lld::elf::Symbol*, long long>, unsigned long> > > > const&)
Line
Count
Source
23
117
bool set_union(S1Ty &S1, const S2Ty &S2) {
24
117
  bool Changed = false;
25
117
26
117
  for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end();
27
10.1k
       SI != SE; 
++SI10.0k
)
28
10.0k
    if (S1.insert(*SI).second)
29
10.0k
      Changed = true;
30
117
31
117
  return Changed;
32
117
}
bool llvm::set_union<llvm::MapVector<lld::elf::Symbol*, unsigned long, llvm::DenseMap<lld::elf::Symbol*, unsigned int, llvm::DenseMapInfo<lld::elf::Symbol*>, llvm::detail::DenseMapPair<lld::elf::Symbol*, unsigned int> >, std::__1::vector<std::__1::pair<lld::elf::Symbol*, unsigned long>, std::__1::allocator<std::__1::pair<lld::elf::Symbol*, unsigned long> > > >, llvm::MapVector<lld::elf::Symbol*, unsigned long, llvm::DenseMap<lld::elf::Symbol*, unsigned int, llvm::DenseMapInfo<lld::elf::Symbol*>, llvm::detail::DenseMapPair<lld::elf::Symbol*, unsigned int> >, std::__1::vector<std::__1::pair<lld::elf::Symbol*, unsigned long>, std::__1::allocator<std::__1::pair<lld::elf::Symbol*, unsigned long> > > > >(llvm::MapVector<lld::elf::Symbol*, unsigned long, llvm::DenseMap<lld::elf::Symbol*, unsigned int, llvm::DenseMapInfo<lld::elf::Symbol*>, llvm::detail::DenseMapPair<lld::elf::Symbol*, unsigned int> >, std::__1::vector<std::__1::pair<lld::elf::Symbol*, unsigned long>, std::__1::allocator<std::__1::pair<lld::elf::Symbol*, unsigned long> > > >&, llvm::MapVector<lld::elf::Symbol*, unsigned long, llvm::DenseMap<lld::elf::Symbol*, unsigned int, llvm::DenseMapInfo<lld::elf::Symbol*>, llvm::detail::DenseMapPair<lld::elf::Symbol*, unsigned int> >, std::__1::vector<std::__1::pair<lld::elf::Symbol*, unsigned long>, std::__1::allocator<std::__1::pair<lld::elf::Symbol*, unsigned long> > > > const&)
Line
Count
Source
23
352
bool set_union(S1Ty &S1, const S2Ty &S2) {
24
352
  bool Changed = false;
25
352
26
352
  for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end();
27
461
       SI != SE; 
++SI109
)
28
109
    if (S1.insert(*SI).second)
29
104
      Changed = true;
30
352
31
352
  return Changed;
32
352
}
33
34
/// set_intersect(A, B) - Compute A := A ^ B
35
/// Identical to set_intersection, except that it works on set<>'s and
36
/// is nicer to use.  Functionally, this iterates through S1, removing
37
/// elements that are not contained in S2.
38
///
39
template <class S1Ty, class S2Ty>
40
570k
void set_intersect(S1Ty &S1, const S2Ty &S2) {
41
1.09M
   for (typename S1Ty::iterator I = S1.begin(); I != S1.end();) {
42
523k
     const auto &E = *I;
43
523k
     ++I;
44
523k
     if (!S2.count(E)) 
S1.erase(E)489k
; // Erase element if not in S2
45
523k
   }
46
570k
}
void llvm::set_intersect<llvm::SmallPtrSet<llvm::BasicBlock*, 4u>, llvm::SmallPtrSet<llvm::BasicBlock*, 4u> >(llvm::SmallPtrSet<llvm::BasicBlock*, 4u>&, llvm::SmallPtrSet<llvm::BasicBlock*, 4u> const&)
Line
Count
Source
40
48
void set_intersect(S1Ty &S1, const S2Ty &S2) {
41
110
   for (typename S1Ty::iterator I = S1.begin(); I != S1.end();) {
42
62
     const auto &E = *I;
43
62
     ++I;
44
62
     if (!S2.count(E)) 
S1.erase(E)22
; // Erase element if not in S2
45
62
   }
46
48
}
void llvm::set_intersect<llvm::SmallPtrSet<llvm::Value*, 4u>, llvm::SmallPtrSet<llvm::Value*, 4u> >(llvm::SmallPtrSet<llvm::Value*, 4u>&, llvm::SmallPtrSet<llvm::Value*, 4u> const&)
Line
Count
Source
40
570k
void set_intersect(S1Ty &S1, const S2Ty &S2) {
41
1.09M
   for (typename S1Ty::iterator I = S1.begin(); I != S1.end();) {
42
523k
     const auto &E = *I;
43
523k
     ++I;
44
523k
     if (!S2.count(E)) 
S1.erase(E)489k
; // Erase element if not in S2
45
523k
   }
46
570k
}
void llvm::set_intersect<llvm::DenseSet<llvm::Value const*, llvm::DenseMapInfo<llvm::Value const*> >, llvm::DenseSet<llvm::Value const*, llvm::DenseMapInfo<llvm::Value const*> > >(llvm::DenseSet<llvm::Value const*, llvm::DenseMapInfo<llvm::Value const*> >&, llvm::DenseSet<llvm::Value const*, llvm::DenseMapInfo<llvm::Value const*> > const&)
Line
Count
Source
40
58
void set_intersect(S1Ty &S1, const S2Ty &S2) {
41
168
   for (typename S1Ty::iterator I = S1.begin(); I != S1.end();) {
42
110
     const auto &E = *I;
43
110
     ++I;
44
110
     if (!S2.count(E)) 
S1.erase(E)33
; // Erase element if not in S2
45
110
   }
46
58
}
47
48
/// set_difference(A, B) - Return A - B
49
///
50
template <class S1Ty, class S2Ty>
51
51
S1Ty set_difference(const S1Ty &S1, const S2Ty &S2) {
52
51
  S1Ty Result;
53
51
  for (typename S1Ty::const_iterator SI = S1.begin(), SE = S1.end();
54
62
       SI != SE; 
++SI11
)
55
11
    if (!S2.count(*SI))       // if the element is not in set2
56
9
      Result.insert(*SI);
57
51
  return Result;
58
51
}
59
60
/// set_subtract(A, B) - Compute A := A - B
61
///
62
template <class S1Ty, class S2Ty>
63
53.0M
void set_subtract(S1Ty &S1, const S2Ty &S2) {
64
53.0M
  for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end();
65
74.6M
       SI != SE; 
++SI21.6M
)
66
21.6M
    S1.erase(*SI);
67
53.0M
}
68
69
} // End llvm namespace
70
71
#endif