Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/include/llvm/ADT/ScopedHashTable.h
Line
Count
Source
1
//===- ScopedHashTable.h - A simple scoped hash table -----------*- 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 implements an efficient scoped hash table, which is useful for
11
// things like dominator-based optimizations.  This allows clients to do things
12
// like this:
13
//
14
//  ScopedHashTable<int, int> HT;
15
//  {
16
//    ScopedHashTableScope<int, int> Scope1(HT);
17
//    HT.insert(0, 0);
18
//    HT.insert(1, 1);
19
//    {
20
//      ScopedHashTableScope<int, int> Scope2(HT);
21
//      HT.insert(0, 42);
22
//    }
23
//  }
24
//
25
// Looking up the value for "0" in the Scope2 block will return 42.  Looking
26
// up the value for 0 before 42 is inserted or after Scope2 is popped will
27
// return 0.
28
//
29
//===----------------------------------------------------------------------===//
30
31
#ifndef LLVM_ADT_SCOPEDHASHTABLE_H
32
#define LLVM_ADT_SCOPEDHASHTABLE_H
33
34
#include "llvm/ADT/DenseMap.h"
35
#include "llvm/ADT/DenseMapInfo.h"
36
#include "llvm/Support/Allocator.h"
37
#include <cassert>
38
#include <new>
39
40
namespace llvm {
41
42
template <typename K, typename V, typename KInfo = DenseMapInfo<K>,
43
          typename AllocatorTy = MallocAllocator>
44
class ScopedHashTable;
45
46
template <typename K, typename V>
47
class ScopedHashTableVal {
48
  ScopedHashTableVal *NextInScope;
49
  ScopedHashTableVal *NextForKey;
50
  K Key;
51
  V Val;
52
53
36.5M
  ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {}
llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::ScopedHashTableVal(llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&, std::__1::pair<unsigned int, unsigned int> const&)
Line
Count
Source
53
1.04k
  ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {}
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::ScopedHashTableVal((anonymous namespace)::CallValue const&, std::__1::pair<llvm::Instruction*, unsigned int> const&)
Line
Count
Source
53
61.6k
  ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {}
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::ScopedHashTableVal(llvm::Value* const&, (anonymous namespace)::EarlyCSE::LoadValue const&)
Line
Count
Source
53
7.22M
  ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {}
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::ScopedHashTableVal((anonymous namespace)::SimpleValue const&, llvm::Value* const&)
Line
Count
Source
53
21.3M
  ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {}
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::ScopedHashTableVal(llvm::MachineInstr* const&, unsigned int const&)
Line
Count
Source
53
7.87M
  ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {}
54
55
public:
56
36.5M
  const K &getKey() const { return Key; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::getKey() const
Line
Count
Source
56
21.3M
  const K &getKey() const { return Key; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::getKey() const
Line
Count
Source
56
7.22M
  const K &getKey() const { return Key; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::getKey() const
Line
Count
Source
56
61.6k
  const K &getKey() const { return Key; }
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::getKey() const
Line
Count
Source
56
7.87M
  const K &getKey() const { return Key; }
llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::getKey() const
Line
Count
Source
56
1.04k
  const K &getKey() const { return Key; }
57
  const V &getValue() const { return Val; }
58
2.94M
  V &getValue() { return Val; }
llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::getValue()
Line
Count
Source
58
80
  V &getValue() { return Val; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::getValue()
Line
Count
Source
58
838k
  V &getValue() { return Val; }
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::getValue()
Line
Count
Source
58
544k
  V &getValue() { return Val; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::getValue()
Line
Count
Source
58
1.55M
  V &getValue() { return Val; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::getValue()
Line
Count
Source
58
3.27k
  V &getValue() { return Val; }
59
60
41.8M
  ScopedHashTableVal *getNextForKey() { return NextForKey; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::getNextForKey()
Line
Count
Source
60
64.7k
  ScopedHashTableVal *getNextForKey() { return NextForKey; }
llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::getNextForKey()
Line
Count
Source
60
1.08k
  ScopedHashTableVal *getNextForKey() { return NextForKey; }
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::getNextForKey()
Line
Count
Source
60
8.20M
  ScopedHashTableVal *getNextForKey() { return NextForKey; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::getNextForKey()
Line
Count
Source
60
8.56M
  ScopedHashTableVal *getNextForKey() { return NextForKey; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::getNextForKey()
Line
Count
Source
60
25.0M
  ScopedHashTableVal *getNextForKey() { return NextForKey; }
61
  const ScopedHashTableVal *getNextForKey() const { return NextForKey; }
62
36.5M
  ScopedHashTableVal *getNextInScope() { return NextInScope; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::getNextInScope()
Line
Count
Source
62
61.6k
  ScopedHashTableVal *getNextInScope() { return NextInScope; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::getNextInScope()
Line
Count
Source
62
21.3M
  ScopedHashTableVal *getNextInScope() { return NextInScope; }
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::getNextInScope()
Line
Count
Source
62
7.22M
  ScopedHashTableVal *getNextInScope() { return NextInScope; }
llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::getNextInScope()
Line
Count
Source
62
1.04k
  ScopedHashTableVal *getNextInScope() { return NextInScope; }
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::getNextInScope()
Line
Count
Source
62
7.87M
  ScopedHashTableVal *getNextInScope() { return NextInScope; }
63
64
  template <typename AllocatorTy>
65
  static ScopedHashTableVal *Create(ScopedHashTableVal *nextInScope,
66
                                    ScopedHashTableVal *nextForKey,
67
                                    const K &key, const V &val,
68
36.5M
                                    AllocatorTy &Allocator) {
69
36.5M
    ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>();
70
36.5M
    // Set up the value.
71
36.5M
    new (New) ScopedHashTableVal(key, val);
72
36.5M
    New->NextInScope = nextInScope;
73
36.5M
    New->NextForKey = nextForKey;
74
36.5M
    return New;
75
36.5M
  }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >* llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::Create<llvm::MallocAllocator>(llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >*, llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >*, (anonymous namespace)::CallValue const&, std::__1::pair<llvm::Instruction*, unsigned int> const&, llvm::MallocAllocator&)
Line
Count
Source
68
61.6k
                                    AllocatorTy &Allocator) {
69
61.6k
    ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>();
70
61.6k
    // Set up the value.
71
61.6k
    new (New) ScopedHashTableVal(key, val);
72
61.6k
    New->NextInScope = nextInScope;
73
61.6k
    New->NextForKey = nextForKey;
74
61.6k
    return New;
75
61.6k
  }
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>* llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::Create<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >(llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*, (anonymous namespace)::SimpleValue const&, llvm::Value* const&, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul>&)
Line
Count
Source
68
21.3M
                                    AllocatorTy &Allocator) {
69
21.3M
    ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>();
70
21.3M
    // Set up the value.
71
21.3M
    new (New) ScopedHashTableVal(key, val);
72
21.3M
    New->NextInScope = nextInScope;
73
21.3M
    New->NextForKey = nextForKey;
74
21.3M
    return New;
75
21.3M
  }
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>* llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::Create<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >(llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>*, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>*, llvm::MachineInstr* const&, unsigned int const&, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul>&)
Line
Count
Source
68
7.87M
                                    AllocatorTy &Allocator) {
69
7.87M
    ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>();
70
7.87M
    // Set up the value.
71
7.87M
    new (New) ScopedHashTableVal(key, val);
72
7.87M
    New->NextInScope = nextInScope;
73
7.87M
    New->NextForKey = nextForKey;
74
7.87M
    return New;
75
7.87M
  }
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>* llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::Create<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >(llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>*, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>*, llvm::Value* const&, (anonymous namespace)::EarlyCSE::LoadValue const&, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul>&)
Line
Count
Source
68
7.22M
                                    AllocatorTy &Allocator) {
69
7.22M
    ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>();
70
7.22M
    // Set up the value.
71
7.22M
    new (New) ScopedHashTableVal(key, val);
72
7.22M
    New->NextInScope = nextInScope;
73
7.22M
    New->NextForKey = nextForKey;
74
7.22M
    return New;
75
7.22M
  }
llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >* llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::Create<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >(llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >*, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >*, llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&, std::__1::pair<unsigned int, unsigned int> const&, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul>&)
Line
Count
Source
68
1.04k
                                    AllocatorTy &Allocator) {
69
1.04k
    ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>();
70
1.04k
    // Set up the value.
71
1.04k
    new (New) ScopedHashTableVal(key, val);
72
1.04k
    New->NextInScope = nextInScope;
73
1.04k
    New->NextForKey = nextForKey;
74
1.04k
    return New;
75
1.04k
  }
76
77
36.5M
  template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) {
78
36.5M
    // Free memory referenced by the item.
79
36.5M
    this->~ScopedHashTableVal();
80
36.5M
    Allocator.Deallocate(this);
81
36.5M
  }
void llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::Destroy<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul>&)
Line
Count
Source
77
1.04k
  template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) {
78
1.04k
    // Free memory referenced by the item.
79
1.04k
    this->~ScopedHashTableVal();
80
1.04k
    Allocator.Deallocate(this);
81
1.04k
  }
EarlyCSE.cpp:void llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::Destroy<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul>&)
Line
Count
Source
77
21.3M
  template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) {
78
21.3M
    // Free memory referenced by the item.
79
21.3M
    this->~ScopedHashTableVal();
80
21.3M
    Allocator.Deallocate(this);
81
21.3M
  }
EarlyCSE.cpp:void llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::Destroy<llvm::MallocAllocator>(llvm::MallocAllocator&)
Line
Count
Source
77
61.6k
  template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) {
78
61.6k
    // Free memory referenced by the item.
79
61.6k
    this->~ScopedHashTableVal();
80
61.6k
    Allocator.Deallocate(this);
81
61.6k
  }
void llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::Destroy<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul>&)
Line
Count
Source
77
7.87M
  template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) {
78
7.87M
    // Free memory referenced by the item.
79
7.87M
    this->~ScopedHashTableVal();
80
7.87M
    Allocator.Deallocate(this);
81
7.87M
  }
EarlyCSE.cpp:void llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::Destroy<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul>&)
Line
Count
Source
77
7.22M
  template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) {
78
7.22M
    // Free memory referenced by the item.
79
7.22M
    this->~ScopedHashTableVal();
80
7.22M
    Allocator.Deallocate(this);
81
7.22M
  }
82
};
83
84
template <typename K, typename V, typename KInfo = DenseMapInfo<K>,
85
          typename AllocatorTy = MallocAllocator>
86
class ScopedHashTableScope {
87
  /// HT - The hashtable that we are active for.
88
  ScopedHashTable<K, V, KInfo, AllocatorTy> &HT;
89
90
  /// PrevScope - This is the scope that we are shadowing in HT.
91
  ScopedHashTableScope *PrevScope;
92
93
  /// LastValInScope - This is the last value that was inserted for this scope
94
  /// or null if none have been inserted yet.
95
  ScopedHashTableVal<K, V> *LastValInScope;
96
97
public:
98
  ScopedHashTableScope(ScopedHashTable<K, V, KInfo, AllocatorTy> &HT);
99
  ScopedHashTableScope(ScopedHashTableScope &) = delete;
100
  ScopedHashTableScope &operator=(ScopedHashTableScope &) = delete;
101
  ~ScopedHashTableScope();
102
103
  ScopedHashTableScope *getParentScope() { return PrevScope; }
104
  const ScopedHashTableScope *getParentScope() const { return PrevScope; }
105
106
private:
107
  friend class ScopedHashTable<K, V, KInfo, AllocatorTy>;
108
109
36.5M
  ScopedHashTableVal<K, V> *getLastValInScope() {
110
36.5M
    return LastValInScope;
111
36.5M
  }
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::getLastValInScope()
Line
Count
Source
109
61.6k
  ScopedHashTableVal<K, V> *getLastValInScope() {
110
61.6k
    return LastValInScope;
111
61.6k
  }
llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::getLastValInScope()
Line
Count
Source
109
1.04k
  ScopedHashTableVal<K, V> *getLastValInScope() {
110
1.04k
    return LastValInScope;
111
1.04k
  }
EarlyCSE.cpp:llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::getLastValInScope()
Line
Count
Source
109
7.22M
  ScopedHashTableVal<K, V> *getLastValInScope() {
110
7.22M
    return LastValInScope;
111
7.22M
  }
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::getLastValInScope()
Line
Count
Source
109
21.3M
  ScopedHashTableVal<K, V> *getLastValInScope() {
110
21.3M
    return LastValInScope;
111
21.3M
  }
llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::getLastValInScope()
Line
Count
Source
109
7.87M
  ScopedHashTableVal<K, V> *getLastValInScope() {
110
7.87M
    return LastValInScope;
111
7.87M
  }
112
113
36.5M
  void setLastValInScope(ScopedHashTableVal<K, V> *Val) {
114
36.5M
    LastValInScope = Val;
115
36.5M
  }
llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::setLastValInScope(llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>*)
Line
Count
Source
113
7.87M
  void setLastValInScope(ScopedHashTableVal<K, V> *Val) {
114
7.87M
    LastValInScope = Val;
115
7.87M
  }
llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::setLastValInScope(llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >*)
Line
Count
Source
113
1.04k
  void setLastValInScope(ScopedHashTableVal<K, V> *Val) {
114
1.04k
    LastValInScope = Val;
115
1.04k
  }
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::setLastValInScope(llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >*)
Line
Count
Source
113
61.6k
  void setLastValInScope(ScopedHashTableVal<K, V> *Val) {
114
61.6k
    LastValInScope = Val;
115
61.6k
  }
EarlyCSE.cpp:llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::setLastValInScope(llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>*)
Line
Count
Source
113
7.22M
  void setLastValInScope(ScopedHashTableVal<K, V> *Val) {
114
7.22M
    LastValInScope = Val;
115
7.22M
  }
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::setLastValInScope(llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*)
Line
Count
Source
113
21.3M
  void setLastValInScope(ScopedHashTableVal<K, V> *Val) {
114
21.3M
    LastValInScope = Val;
115
21.3M
  }
116
};
117
118
template <typename K, typename V, typename KInfo = DenseMapInfo<K>>
119
class ScopedHashTableIterator {
120
  ScopedHashTableVal<K, V> *Node;
121
122
public:
123
  ScopedHashTableIterator(ScopedHashTableVal<K, V> *node) : Node(node) {}
124
125
  V &operator*() const {
126
    assert(Node && "Dereference end()");
127
    return Node->getValue();
128
  }
129
  V *operator->() const {
130
    return &Node->getValue();
131
  }
132
133
  bool operator==(const ScopedHashTableIterator &RHS) const {
134
    return Node == RHS.Node;
135
  }
136
  bool operator!=(const ScopedHashTableIterator &RHS) const {
137
    return Node != RHS.Node;
138
  }
139
140
  inline ScopedHashTableIterator& operator++() {          // Preincrement
141
    assert(Node && "incrementing past end()");
142
    Node = Node->getNextForKey();
143
    return *this;
144
  }
145
  ScopedHashTableIterator operator++(int) {        // Postincrement
146
    ScopedHashTableIterator tmp = *this; ++*this; return tmp;
147
  }
148
};
149
150
template <typename K, typename V, typename KInfo, typename AllocatorTy>
151
class ScopedHashTable {
152
public:
153
  /// ScopeTy - This is a helpful typedef that allows clients to get easy access
154
  /// to the name of the scope for this hash table.
155
  using ScopeTy = ScopedHashTableScope<K, V, KInfo, AllocatorTy>;
156
  using size_type = unsigned;
157
158
private:
159
  friend class ScopedHashTableScope<K, V, KInfo, AllocatorTy>;
160
161
  using ValTy = ScopedHashTableVal<K, V>;
162
163
  DenseMap<K, ValTy*, KInfo> TopLevelMap;
164
  ScopeTy *CurScope = nullptr;
165
166
  AllocatorTy Allocator;
167
168
public:
169
4.05M
  ScopedHashTable() = default;
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::ScopedHashTable()
Line
Count
Source
169
1.33M
  ScopedHashTable() = default;
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::ScopedHashTable()
Line
Count
Source
169
33.5k
  ScopedHashTable() = default;
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::ScopedHashTable()
Line
Count
Source
169
1.33M
  ScopedHashTable() = default;
llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::ScopedHashTable()
Line
Count
Source
169
1.72k
  ScopedHashTable() = default;
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::ScopedHashTable()
Line
Count
Source
169
1.33M
  ScopedHashTable() = default;
170
  ScopedHashTable(AllocatorTy A) : Allocator(A) {}
171
  ScopedHashTable(const ScopedHashTable &) = delete;
172
  ScopedHashTable &operator=(const ScopedHashTable &) = delete;
173
174
4.05M
  ~ScopedHashTable() {
175
4.05M
    assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!");
176
4.05M
  }
llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::~ScopedHashTable()
Line
Count
Source
174
1.72k
  ~ScopedHashTable() {
175
1.72k
    assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!");
176
1.72k
  }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::~ScopedHashTable()
Line
Count
Source
174
1.33M
  ~ScopedHashTable() {
175
1.33M
    assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!");
176
1.33M
  }
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::~ScopedHashTable()
Line
Count
Source
174
33.4k
  ~ScopedHashTable() {
175
33.4k
    assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!");
176
33.4k
  }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::~ScopedHashTable()
Line
Count
Source
174
1.33M
  ~ScopedHashTable() {
175
1.33M
    assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!");
176
1.33M
  }
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::~ScopedHashTable()
Line
Count
Source
174
1.33M
  ~ScopedHashTable() {
175
1.33M
    assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!");
176
1.33M
  }
177
178
  /// Access to the allocator.
179
36.5M
  AllocatorTy &getAllocator() { return Allocator; }
llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::getAllocator()
Line
Count
Source
179
1.04k
  AllocatorTy &getAllocator() { return Allocator; }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::getAllocator()
Line
Count
Source
179
21.3M
  AllocatorTy &getAllocator() { return Allocator; }
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::getAllocator()
Line
Count
Source
179
7.22M
  AllocatorTy &getAllocator() { return Allocator; }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::getAllocator()
Line
Count
Source
179
61.6k
  AllocatorTy &getAllocator() { return Allocator; }
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::getAllocator()
Line
Count
Source
179
7.87M
  AllocatorTy &getAllocator() { return Allocator; }
180
  const AllocatorTy &getAllocator() const { return Allocator; }
181
182
  /// Return 1 if the specified key is in the table, 0 otherwise.
183
9.09M
  size_type count(const K &Key) const {
184
9.09M
    return TopLevelMap.count(Key);
185
9.09M
  }
186
187
26.6M
  V lookup(const K &Key) const {
188
26.6M
    auto I = TopLevelMap.find(Key);
189
26.6M
    if (I != TopLevelMap.end())
190
2.94M
      return I->second->getValue();
191
26.6M
192
23.6M
    return V();
193
26.6M
  }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::lookup((anonymous namespace)::CallValue const&) const
Line
Count
Source
187
61.8k
  V lookup(const K &Key) const {
188
61.8k
    auto I = TopLevelMap.find(Key);
189
61.8k
    if (I != TopLevelMap.end())
190
3.27k
      return I->second->getValue();
191
61.8k
192
58.5k
    return V();
193
61.8k
  }
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::lookup(llvm::Value* const&) const
Line
Count
Source
187
7.43M
  V lookup(const K &Key) const {
188
7.43M
    auto I = TopLevelMap.find(Key);
189
7.43M
    if (I != TopLevelMap.end())
190
1.55M
      return I->second->getValue();
191
7.43M
192
5.87M
    return V();
193
7.43M
  }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::lookup((anonymous namespace)::SimpleValue const&) const
Line
Count
Source
187
18.5M
  V lookup(const K &Key) const {
188
18.5M
    auto I = TopLevelMap.find(Key);
189
18.5M
    if (I != TopLevelMap.end())
190
838k
      return I->second->getValue();
191
18.5M
192
17.7M
    return V();
193
18.5M
  }
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::lookup(llvm::MachineInstr* const&) const
Line
Count
Source
187
544k
  V lookup(const K &Key) const {
188
544k
    auto I = TopLevelMap.find(Key);
189
544k
    if (I != TopLevelMap.end())
190
544k
      return I->second->getValue();
191
544k
192
0
    return V();
193
544k
  }
llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::lookup(llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&) const
Line
Count
Source
187
2.33k
  V lookup(const K &Key) const {
188
2.33k
    auto I = TopLevelMap.find(Key);
189
2.33k
    if (I != TopLevelMap.end())
190
80
      return I->second->getValue();
191
2.33k
192
2.25k
    return V();
193
2.33k
  }
194
195
36.5M
  void insert(const K &Key, const V &Val) {
196
36.5M
    insertIntoScope(CurScope, Key, Val);
197
36.5M
  }
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::insert(llvm::Value* const&, (anonymous namespace)::EarlyCSE::LoadValue const&)
Line
Count
Source
195
7.22M
  void insert(const K &Key, const V &Val) {
196
7.22M
    insertIntoScope(CurScope, Key, Val);
197
7.22M
  }
llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::insert(llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&, std::__1::pair<unsigned int, unsigned int> const&)
Line
Count
Source
195
1.04k
  void insert(const K &Key, const V &Val) {
196
1.04k
    insertIntoScope(CurScope, Key, Val);
197
1.04k
  }
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::insert(llvm::MachineInstr* const&, unsigned int const&)
Line
Count
Source
195
7.87M
  void insert(const K &Key, const V &Val) {
196
7.87M
    insertIntoScope(CurScope, Key, Val);
197
7.87M
  }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::insert((anonymous namespace)::SimpleValue const&, llvm::Value* const&)
Line
Count
Source
195
21.3M
  void insert(const K &Key, const V &Val) {
196
21.3M
    insertIntoScope(CurScope, Key, Val);
197
21.3M
  }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::insert((anonymous namespace)::CallValue const&, std::__1::pair<llvm::Instruction*, unsigned int> const&)
Line
Count
Source
195
61.6k
  void insert(const K &Key, const V &Val) {
196
61.6k
    insertIntoScope(CurScope, Key, Val);
197
61.6k
  }
198
199
  using iterator = ScopedHashTableIterator<K, V, KInfo>;
200
201
  iterator end() { return iterator(0); }
202
203
  iterator begin(const K &Key) {
204
    typename DenseMap<K, ValTy*, KInfo>::iterator I =
205
      TopLevelMap.find(Key);
206
    if (I == TopLevelMap.end()) return end();
207
    return iterator(I->second);
208
  }
209
210
  ScopeTy *getCurScope() { return CurScope; }
211
  const ScopeTy *getCurScope() const { return CurScope; }
212
213
  /// insertIntoScope - This inserts the specified key/value at the specified
214
  /// (possibly not the current) scope.  While it is ok to insert into a scope
215
  /// that isn't the current one, it isn't ok to insert *underneath* an existing
216
  /// value of the specified key.
217
36.5M
  void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) {
218
36.5M
    assert(S && "No scope active!");
219
36.5M
    ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key];
220
36.5M
    KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val,
221
36.5M
                             Allocator);
222
36.5M
    S->setLastValInScope(KeyEntry);
223
36.5M
  }
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::insertIntoScope(llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >*, llvm::MachineInstr* const&, unsigned int const&)
Line
Count
Source
217
7.87M
  void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) {
218
7.87M
    assert(S && "No scope active!");
219
7.87M
    ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key];
220
7.87M
    KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val,
221
7.87M
                             Allocator);
222
7.87M
    S->setLastValInScope(KeyEntry);
223
7.87M
  }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::insertIntoScope(llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >*, (anonymous namespace)::SimpleValue const&, llvm::Value* const&)
Line
Count
Source
217
21.3M
  void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) {
218
21.3M
    assert(S && "No scope active!");
219
21.3M
    ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key];
220
21.3M
    KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val,
221
21.3M
                             Allocator);
222
21.3M
    S->setLastValInScope(KeyEntry);
223
21.3M
  }
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::insertIntoScope(llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >*, llvm::Value* const&, (anonymous namespace)::EarlyCSE::LoadValue const&)
Line
Count
Source
217
7.22M
  void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) {
218
7.22M
    assert(S && "No scope active!");
219
7.22M
    ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key];
220
7.22M
    KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val,
221
7.22M
                             Allocator);
222
7.22M
    S->setLastValInScope(KeyEntry);
223
7.22M
  }
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::insertIntoScope(llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>*, (anonymous namespace)::CallValue const&, std::__1::pair<llvm::Instruction*, unsigned int> const&)
Line
Count
Source
217
61.6k
  void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) {
218
61.6k
    assert(S && "No scope active!");
219
61.6k
    ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key];
220
61.6k
    KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val,
221
61.6k
                             Allocator);
222
61.6k
    S->setLastValInScope(KeyEntry);
223
61.6k
  }
llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::insertIntoScope(llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >*, llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&, std::__1::pair<unsigned int, unsigned int> const&)
Line
Count
Source
217
1.04k
  void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) {
218
1.04k
    assert(S && "No scope active!");
219
1.04k
    ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key];
220
1.04k
    KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val,
221
1.04k
                             Allocator);
222
1.04k
    S->setLastValInScope(KeyEntry);
223
1.04k
  }
224
};
225
226
/// ScopedHashTableScope ctor - Install this as the current scope for the hash
227
/// table.
228
template <typename K, typename V, typename KInfo, typename Allocator>
229
ScopedHashTableScope<K, V, KInfo, Allocator>::
230
26.4M
  ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) {
231
26.4M
  PrevScope = HT.CurScope;
232
26.4M
  HT.CurScope = this;
233
26.4M
  LastValInScope = nullptr;
234
26.4M
}
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::ScopedHashTableScope(llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>&)
Line
Count
Source
230
7.53M
  ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) {
231
7.53M
  PrevScope = HT.CurScope;
232
7.53M
  HT.CurScope = this;
233
7.53M
  LastValInScope = nullptr;
234
7.53M
}
EarlyCSE.cpp:llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::ScopedHashTableScope(llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >&)
Line
Count
Source
230
7.53M
  ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) {
231
7.53M
  PrevScope = HT.CurScope;
232
7.53M
  HT.CurScope = this;
233
7.53M
  LastValInScope = nullptr;
234
7.53M
}
llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::ScopedHashTableScope(llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >&)
Line
Count
Source
230
13.8k
  ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) {
231
13.8k
  PrevScope = HT.CurScope;
232
13.8k
  HT.CurScope = this;
233
13.8k
  LastValInScope = nullptr;
234
13.8k
}
llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::ScopedHashTableScope(llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >&)
Line
Count
Source
230
3.82M
  ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) {
231
3.82M
  PrevScope = HT.CurScope;
232
3.82M
  HT.CurScope = this;
233
3.82M
  LastValInScope = nullptr;
234
3.82M
}
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::ScopedHashTableScope(llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >&)
Line
Count
Source
230
7.53M
  ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) {
231
7.53M
  PrevScope = HT.CurScope;
232
7.53M
  HT.CurScope = this;
233
7.53M
  LastValInScope = nullptr;
234
7.53M
}
235
236
template <typename K, typename V, typename KInfo, typename Allocator>
237
26.4M
ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() {
238
26.4M
  assert(HT.CurScope == this && "Scope imbalance!");
239
26.4M
  HT.CurScope = PrevScope;
240
26.4M
241
26.4M
  // Pop and delete all values corresponding to this scope.
242
62.9M
  while (ScopedHashTableVal<K, V> *
ThisEntry62.9M
= LastValInScope) {
243
36.5M
    // Pop this value out of the TopLevelMap.
244
36.5M
    if (
!ThisEntry->getNextForKey()36.5M
) {
245
31.2M
      assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry &&
246
31.2M
             "Scope imbalance!");
247
31.2M
      HT.TopLevelMap.erase(ThisEntry->getKey());
248
36.5M
    } else {
249
5.32M
      ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()];
250
5.32M
      assert(KeyEntry == ThisEntry && "Scope imbalance!");
251
5.32M
      KeyEntry = ThisEntry->getNextForKey();
252
5.32M
    }
253
36.5M
254
36.5M
    // Pop this value out of the scope.
255
36.5M
    LastValInScope = ThisEntry->getNextInScope();
256
36.5M
257
36.5M
    // Delete this entry.
258
36.5M
    ThisEntry->Destroy(HT.getAllocator());
259
36.5M
  }
260
26.4M
}
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::~ScopedHashTableScope()
Line
Count
Source
237
7.53M
ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() {
238
7.53M
  assert(HT.CurScope == this && "Scope imbalance!");
239
7.53M
  HT.CurScope = PrevScope;
240
7.53M
241
7.53M
  // Pop and delete all values corresponding to this scope.
242
28.9M
  while (ScopedHashTableVal<K, V> *
ThisEntry28.9M
= LastValInScope) {
243
21.3M
    // Pop this value out of the TopLevelMap.
244
21.3M
    if (
!ThisEntry->getNextForKey()21.3M
) {
245
17.7M
      assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry &&
246
17.7M
             "Scope imbalance!");
247
17.7M
      HT.TopLevelMap.erase(ThisEntry->getKey());
248
21.3M
    } else {
249
3.64M
      ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()];
250
3.64M
      assert(KeyEntry == ThisEntry && "Scope imbalance!");
251
3.64M
      KeyEntry = ThisEntry->getNextForKey();
252
3.64M
    }
253
21.3M
254
21.3M
    // Pop this value out of the scope.
255
21.3M
    LastValInScope = ThisEntry->getNextInScope();
256
21.3M
257
21.3M
    // Delete this entry.
258
21.3M
    ThisEntry->Destroy(HT.getAllocator());
259
21.3M
  }
260
7.53M
}
llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::~ScopedHashTableScope()
Line
Count
Source
237
3.82M
ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() {
238
3.82M
  assert(HT.CurScope == this && "Scope imbalance!");
239
3.82M
  HT.CurScope = PrevScope;
240
3.82M
241
3.82M
  // Pop and delete all values corresponding to this scope.
242
11.6M
  while (ScopedHashTableVal<K, V> *
ThisEntry11.6M
= LastValInScope) {
243
7.87M
    // Pop this value out of the TopLevelMap.
244
7.87M
    if (
!ThisEntry->getNextForKey()7.87M
) {
245
7.54M
      assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry &&
246
7.54M
             "Scope imbalance!");
247
7.54M
      HT.TopLevelMap.erase(ThisEntry->getKey());
248
7.87M
    } else {
249
328k
      ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()];
250
328k
      assert(KeyEntry == ThisEntry && "Scope imbalance!");
251
328k
      KeyEntry = ThisEntry->getNextForKey();
252
328k
    }
253
7.87M
254
7.87M
    // Pop this value out of the scope.
255
7.87M
    LastValInScope = ThisEntry->getNextInScope();
256
7.87M
257
7.87M
    // Delete this entry.
258
7.87M
    ThisEntry->Destroy(HT.getAllocator());
259
7.87M
  }
260
3.82M
}
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::~ScopedHashTableScope()
Line
Count
Source
237
7.53M
ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() {
238
7.53M
  assert(HT.CurScope == this && "Scope imbalance!");
239
7.53M
  HT.CurScope = PrevScope;
240
7.53M
241
7.53M
  // Pop and delete all values corresponding to this scope.
242
7.59M
  while (ScopedHashTableVal<K, V> *
ThisEntry7.59M
= LastValInScope) {
243
61.6k
    // Pop this value out of the TopLevelMap.
244
61.6k
    if (
!ThisEntry->getNextForKey()61.6k
) {
245
58.5k
      assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry &&
246
58.5k
             "Scope imbalance!");
247
58.5k
      HT.TopLevelMap.erase(ThisEntry->getKey());
248
61.6k
    } else {
249
3.11k
      ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()];
250
3.11k
      assert(KeyEntry == ThisEntry && "Scope imbalance!");
251
3.11k
      KeyEntry = ThisEntry->getNextForKey();
252
3.11k
    }
253
61.6k
254
61.6k
    // Pop this value out of the scope.
255
61.6k
    LastValInScope = ThisEntry->getNextInScope();
256
61.6k
257
61.6k
    // Delete this entry.
258
61.6k
    ThisEntry->Destroy(HT.getAllocator());
259
61.6k
  }
260
7.53M
}
EarlyCSE.cpp:llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::~ScopedHashTableScope()
Line
Count
Source
237
7.53M
ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() {
238
7.53M
  assert(HT.CurScope == this && "Scope imbalance!");
239
7.53M
  HT.CurScope = PrevScope;
240
7.53M
241
7.53M
  // Pop and delete all values corresponding to this scope.
242
14.7M
  while (ScopedHashTableVal<K, V> *
ThisEntry14.7M
= LastValInScope) {
243
7.22M
    // Pop this value out of the TopLevelMap.
244
7.22M
    if (
!ThisEntry->getNextForKey()7.22M
) {
245
5.87M
      assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry &&
246
5.87M
             "Scope imbalance!");
247
5.87M
      HT.TopLevelMap.erase(ThisEntry->getKey());
248
7.22M
    } else {
249
1.34M
      ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()];
250
1.34M
      assert(KeyEntry == ThisEntry && "Scope imbalance!");
251
1.34M
      KeyEntry = ThisEntry->getNextForKey();
252
1.34M
    }
253
7.22M
254
7.22M
    // Pop this value out of the scope.
255
7.22M
    LastValInScope = ThisEntry->getNextInScope();
256
7.22M
257
7.22M
    // Delete this entry.
258
7.22M
    ThisEntry->Destroy(HT.getAllocator());
259
7.22M
  }
260
7.53M
}
llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::~ScopedHashTableScope()
Line
Count
Source
237
13.8k
ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() {
238
13.8k
  assert(HT.CurScope == this && "Scope imbalance!");
239
13.8k
  HT.CurScope = PrevScope;
240
13.8k
241
13.8k
  // Pop and delete all values corresponding to this scope.
242
14.8k
  while (ScopedHashTableVal<K, V> *
ThisEntry14.8k
= LastValInScope) {
243
1.04k
    // Pop this value out of the TopLevelMap.
244
1.04k
    if (
!ThisEntry->getNextForKey()1.04k
) {
245
1.00k
      assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry &&
246
1.00k
             "Scope imbalance!");
247
1.00k
      HT.TopLevelMap.erase(ThisEntry->getKey());
248
1.04k
    } else {
249
39
      ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()];
250
39
      assert(KeyEntry == ThisEntry && "Scope imbalance!");
251
39
      KeyEntry = ThisEntry->getNextForKey();
252
39
    }
253
1.04k
254
1.04k
    // Pop this value out of the scope.
255
1.04k
    LastValInScope = ThisEntry->getNextInScope();
256
1.04k
257
1.04k
    // Delete this entry.
258
1.04k
    ThisEntry->Destroy(HT.getAllocator());
259
1.04k
  }
260
13.8k
}
261
262
} // end namespace llvm
263
264
#endif // LLVM_ADT_SCOPEDHASHTABLE_H