Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/ADT/ImmutableList.h
Line
Count
Source (jump to first uncovered line)
1
//==--- ImmutableList.h - Immutable (functional) list interface --*- C++ -*-==//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file defines the ImmutableList class.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_ADT_IMMUTABLELIST_H
14
#define LLVM_ADT_IMMUTABLELIST_H
15
16
#include "llvm/ADT/FoldingSet.h"
17
#include "llvm/Support/Allocator.h"
18
#include <cassert>
19
#include <cstdint>
20
#include <new>
21
22
namespace llvm {
23
24
template <typename T> class ImmutableListFactory;
25
26
template <typename T>
27
class ImmutableListImpl : public FoldingSetNode {
28
  friend class ImmutableListFactory<T>;
29
30
  T Head;
31
  const ImmutableListImpl* Tail;
32
33
  template <typename ElemT>
34
  ImmutableListImpl(ElemT &&head, const ImmutableListImpl *tail = nullptr)
35
2.29k
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
llvm::ImmutableListImpl<clang::ento::MemRegion const*>::ImmutableListImpl<clang::ento::MemRegion const*&>(clang::ento::MemRegion const*&&&, llvm::ImmutableListImpl<clang::ento::MemRegion const*> const*)
Line
Count
Source
35
46
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
UninitializedObjectChecker.cpp:llvm::ImmutableListImpl<clang::ento::FieldNode const&>::ImmutableListImpl<(anonymous namespace)::RegularField const&>((anonymous namespace)::RegularField const&&&, llvm::ImmutableListImpl<clang::ento::FieldNode const&> const*)
Line
Count
Source
35
138
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
UninitializedObjectChecker.cpp:llvm::ImmutableListImpl<clang::ento::FieldNode const&>::ImmutableListImpl<(anonymous namespace)::BaseClass const&>((anonymous namespace)::BaseClass const&&&, llvm::ImmutableListImpl<clang::ento::FieldNode const&> const*)
Line
Count
Source
35
39
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
UninitializedPointee.cpp:llvm::ImmutableListImpl<clang::ento::FieldNode const&>::ImmutableListImpl<(anonymous namespace)::LocField const&>((anonymous namespace)::LocField const&&&, llvm::ImmutableListImpl<clang::ento::FieldNode const&> const*)
Line
Count
Source
35
62
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
UninitializedPointee.cpp:llvm::ImmutableListImpl<clang::ento::FieldNode const&>::ImmutableListImpl<(anonymous namespace)::CyclicLocField const&>((anonymous namespace)::CyclicLocField const&&&, llvm::ImmutableListImpl<clang::ento::FieldNode const&> const*)
Line
Count
Source
35
6
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
UninitializedPointee.cpp:llvm::ImmutableListImpl<clang::ento::FieldNode const&>::ImmutableListImpl<(anonymous namespace)::NeedsCastLocField const&>((anonymous namespace)::NeedsCastLocField const&&&, llvm::ImmutableListImpl<clang::ento::FieldNode const&> const*)
Line
Count
Source
35
15
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
llvm::ImmutableListImpl<clang::CXXBaseSpecifier const*>::ImmutableListImpl<clang::CXXBaseSpecifier const*&>(clang::CXXBaseSpecifier const*&&&, llvm::ImmutableListImpl<clang::CXXBaseSpecifier const*> const*)
Line
Count
Source
35
22
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
llvm::ImmutableListImpl<clang::ento::SVal>::ImmutableListImpl<clang::ento::SVal&>(clang::ento::SVal&&&, llvm::ImmutableListImpl<clang::ento::SVal> const*)
Line
Count
Source
35
1.83k
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
llvm::ImmutableListImpl<LoopState>::ImmutableListImpl<LoopState&>(LoopState&&&, llvm::ImmutableListImpl<LoopState> const*)
Line
Count
Source
35
130
    : Head(std::forward<ElemT>(head)), Tail(tail) {}
36
37
public:
38
  ImmutableListImpl(const ImmutableListImpl &) = delete;
39
  ImmutableListImpl &operator=(const ImmutableListImpl &) = delete;
40
41
17.7k
  const T& getHead() const { return Head; }
llvm::ImmutableListImpl<clang::ento::SVal>::getHead() const
Line
Count
Source
41
5.81k
  const T& getHead() const { return Head; }
llvm::ImmutableListImpl<clang::ento::MemRegion const*>::getHead() const
Line
Count
Source
41
33
  const T& getHead() const { return Head; }
llvm::ImmutableListImpl<clang::ento::FieldNode const&>::getHead() const
Line
Count
Source
41
1.07k
  const T& getHead() const { return Head; }
llvm::ImmutableListImpl<LoopState>::getHead() const
Line
Count
Source
41
10.8k
  const T& getHead() const { return Head; }
llvm::ImmutableListImpl<clang::CXXBaseSpecifier const*>::getHead() const
Line
Count
Source
41
21
  const T& getHead() const { return Head; }
42
6.78k
  const ImmutableListImpl* getTail() const { return Tail; }
llvm::ImmutableListImpl<clang::ento::MemRegion const*>::getTail() const
Line
Count
Source
42
29
  const ImmutableListImpl* getTail() const { return Tail; }
llvm::ImmutableListImpl<clang::ento::FieldNode const&>::getTail() const
Line
Count
Source
42
776
  const ImmutableListImpl* getTail() const { return Tail; }
llvm::ImmutableListImpl<LoopState>::getTail() const
Line
Count
Source
42
165
  const ImmutableListImpl* getTail() const { return Tail; }
llvm::ImmutableListImpl<clang::ento::SVal>::getTail() const
Line
Count
Source
42
5.79k
  const ImmutableListImpl* getTail() const { return Tail; }
llvm::ImmutableListImpl<clang::CXXBaseSpecifier const*>::getTail() const
Line
Count
Source
42
21
  const ImmutableListImpl* getTail() const { return Tail; }
43
44
  static inline void Profile(FoldingSetNodeID& ID, const T& H,
45
3.21k
                             const ImmutableListImpl* L){
46
3.21k
    ID.AddPointer(L);
47
3.21k
    ID.Add(H);
48
3.21k
  }
llvm::ImmutableListImpl<clang::ento::SVal>::Profile(llvm::FoldingSetNodeID&, clang::ento::SVal const&, llvm::ImmutableListImpl<clang::ento::SVal> const*)
Line
Count
Source
45
2.41k
                             const ImmutableListImpl* L){
46
2.41k
    ID.AddPointer(L);
47
2.41k
    ID.Add(H);
48
2.41k
  }
llvm::ImmutableListImpl<clang::CXXBaseSpecifier const*>::Profile(llvm::FoldingSetNodeID&, clang::CXXBaseSpecifier const* const&, llvm::ImmutableListImpl<clang::CXXBaseSpecifier const*> const*)
Line
Count
Source
45
35
                             const ImmutableListImpl* L){
46
35
    ID.AddPointer(L);
47
35
    ID.Add(H);
48
35
  }
llvm::ImmutableListImpl<clang::ento::MemRegion const*>::Profile(llvm::FoldingSetNodeID&, clang::ento::MemRegion const* const&, llvm::ImmutableListImpl<clang::ento::MemRegion const*> const*)
Line
Count
Source
45
60
                             const ImmutableListImpl* L){
46
60
    ID.AddPointer(L);
47
60
    ID.Add(H);
48
60
  }
llvm::ImmutableListImpl<clang::ento::FieldNode const&>::Profile(llvm::FoldingSetNodeID&, clang::ento::FieldNode const&, llvm::ImmutableListImpl<clang::ento::FieldNode const&> const*)
Line
Count
Source
45
451
                             const ImmutableListImpl* L){
46
451
    ID.AddPointer(L);
47
451
    ID.Add(H);
48
451
  }
llvm::ImmutableListImpl<LoopState>::Profile(llvm::FoldingSetNodeID&, LoopState const&, llvm::ImmutableListImpl<LoopState> const*)
Line
Count
Source
45
247
                             const ImmutableListImpl* L){
46
247
    ID.AddPointer(L);
47
247
    ID.Add(H);
48
247
  }
49
50
502
  void Profile(FoldingSetNodeID& ID) {
51
502
    Profile(ID, Head, Tail);
52
502
  }
llvm::ImmutableListImpl<clang::ento::SVal>::Profile(llvm::FoldingSetNodeID&)
Line
Count
Source
50
333
  void Profile(FoldingSetNodeID& ID) {
51
333
    Profile(ID, Head, Tail);
52
333
  }
llvm::ImmutableListImpl<clang::CXXBaseSpecifier const*>::Profile(llvm::FoldingSetNodeID&)
Line
Count
Source
50
7
  void Profile(FoldingSetNodeID& ID) {
51
7
    Profile(ID, Head, Tail);
52
7
  }
llvm::ImmutableListImpl<clang::ento::MemRegion const*>::Profile(llvm::FoldingSetNodeID&)
Line
Count
Source
50
7
  void Profile(FoldingSetNodeID& ID) {
51
7
    Profile(ID, Head, Tail);
52
7
  }
llvm::ImmutableListImpl<clang::ento::FieldNode const&>::Profile(llvm::FoldingSetNodeID&)
Line
Count
Source
50
96
  void Profile(FoldingSetNodeID& ID) {
51
96
    Profile(ID, Head, Tail);
52
96
  }
llvm::ImmutableListImpl<LoopState>::Profile(llvm::FoldingSetNodeID&)
Line
Count
Source
50
59
  void Profile(FoldingSetNodeID& ID) {
51
59
    Profile(ID, Head, Tail);
52
59
  }
53
};
54
55
/// ImmutableList - This class represents an immutable (functional) list.
56
///  It is implemented as a smart pointer (wraps ImmutableListImpl), so it
57
///  it is intended to always be copied by value as if it were a pointer.
58
///  This interface matches ImmutableSet and ImmutableMap.  ImmutableList
59
///  objects should almost never be created directly, and instead should
60
///  be created by ImmutableListFactory objects that manage the lifetime
61
///  of a group of lists.  When the factory object is reclaimed, all lists
62
///  created by that factory are released as well.
63
template <typename T>
64
class ImmutableList {
65
public:
66
  using value_type = T;
67
  using Factory = ImmutableListFactory<T>;
68
69
  static_assert(std::is_trivially_destructible<T>::value,
70
                "T must be trivially destructible!");
71
72
private:
73
  const ImmutableListImpl<T>* X;
74
75
public:
76
  // This constructor should normally only be called by ImmutableListFactory<T>.
77
  // There may be cases, however, when one needs to extract the internal pointer
78
  // and reconstruct a list object from that pointer.
79
16.5k
  ImmutableList(const ImmutableListImpl<T>* x = nullptr) : X(x) {}
llvm::ImmutableList<clang::ento::MemRegion const*>::ImmutableList(llvm::ImmutableListImpl<clang::ento::MemRegion const*> const*)
Line
Count
Source
79
181
  ImmutableList(const ImmutableListImpl<T>* x = nullptr) : X(x) {}
llvm::ImmutableList<clang::ento::FieldNode const&>::ImmutableList(llvm::ImmutableListImpl<clang::ento::FieldNode const&> const*)
Line
Count
Source
79
1.77k
  ImmutableList(const ImmutableListImpl<T>* x = nullptr) : X(x) {}
llvm::ImmutableList<clang::CXXBaseSpecifier const*>::ImmutableList(llvm::ImmutableListImpl<clang::CXXBaseSpecifier const*> const*)
Line
Count
Source
79
71
  ImmutableList(const ImmutableListImpl<T>* x = nullptr) : X(x) {}
llvm::ImmutableList<clang::ento::SVal>::ImmutableList(llvm::ImmutableListImpl<clang::ento::SVal> const*)
Line
Count
Source
79
6.38k
  ImmutableList(const ImmutableListImpl<T>* x = nullptr) : X(x) {}
llvm::ImmutableList<LoopState>::ImmutableList(llvm::ImmutableListImpl<LoopState> const*)
Line
Count
Source
79
8.12k
  ImmutableList(const ImmutableListImpl<T>* x = nullptr) : X(x) {}
80
81
8.54k
  const ImmutableListImpl<T>* getInternalPointer() const {
82
8.54k
    return X;
83
8.54k
  }
llvm::ImmutableList<clang::ento::SVal>::getInternalPointer() const
Line
Count
Source
81
6.62k
  const ImmutableListImpl<T>* getInternalPointer() const {
82
6.62k
    return X;
83
6.62k
  }
llvm::ImmutableList<clang::CXXBaseSpecifier const*>::getInternalPointer() const
Line
Count
Source
81
65
  const ImmutableListImpl<T>* getInternalPointer() const {
82
65
    return X;
83
65
  }
llvm::ImmutableList<clang::ento::MemRegion const*>::getInternalPointer() const
Line
Count
Source
81
135
  const ImmutableListImpl<T>* getInternalPointer() const {
82
135
    return X;
83
135
  }
llvm::ImmutableList<clang::ento::FieldNode const&>::getInternalPointer() const
Line
Count
Source
81
1.18k
  const ImmutableListImpl<T>* getInternalPointer() const {
82
1.18k
    return X;
83
1.18k
  }
llvm::ImmutableList<LoopState>::getInternalPointer() const
Line
Count
Source
81
541
  const ImmutableListImpl<T>* getInternalPointer() const {
82
541
    return X;
83
541
  }
84
85
  class iterator {
86
    const ImmutableListImpl<T>* L = nullptr;
87
88
  public:
89
4.03k
    iterator() = default;
Unexecuted instantiation: llvm::ImmutableList<clang::ento::MemRegion const*>::iterator::iterator()
llvm::ImmutableList<clang::ento::FieldNode const&>::iterator::iterator()
Line
Count
Source
89
828
    iterator() = default;
llvm::ImmutableList<clang::ento::SVal>::iterator::iterator()
Line
Count
Source
89
3.19k
    iterator() = default;
llvm::ImmutableList<clang::CXXBaseSpecifier const*>::iterator::iterator()
Line
Count
Source
89
11
    iterator() = default;
90
4.03k
    iterator(ImmutableList l) : L(l.getInternalPointer()) {}
Unexecuted instantiation: llvm::ImmutableList<clang::ento::MemRegion const*>::iterator::iterator(llvm::ImmutableList<clang::ento::MemRegion const*>)
llvm::ImmutableList<clang::ento::FieldNode const&>::iterator::iterator(llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
90
828
    iterator(ImmutableList l) : L(l.getInternalPointer()) {}
llvm::ImmutableList<clang::ento::SVal>::iterator::iterator(llvm::ImmutableList<clang::ento::SVal>)
Line
Count
Source
90
3.19k
    iterator(ImmutableList l) : L(l.getInternalPointer()) {}
llvm::ImmutableList<clang::CXXBaseSpecifier const*>::iterator::iterator(llvm::ImmutableList<clang::CXXBaseSpecifier const*>)
Line
Count
Source
90
7
    iterator(ImmutableList l) : L(l.getInternalPointer()) {}
91
92
6.30k
    iterator& operator++() { L = L->getTail(); return *this; }
Unexecuted instantiation: llvm::ImmutableList<clang::ento::MemRegion const*>::iterator::operator++()
llvm::ImmutableList<clang::ento::FieldNode const&>::iterator::operator++()
Line
Count
Source
92
488
    iterator& operator++() { L = L->getTail(); return *this; }
llvm::ImmutableList<clang::ento::SVal>::iterator::operator++()
Line
Count
Source
92
5.79k
    iterator& operator++() { L = L->getTail(); return *this; }
llvm::ImmutableList<clang::CXXBaseSpecifier const*>::iterator::operator++()
Line
Count
Source
92
21
    iterator& operator++() { L = L->getTail(); return *this; }
93
4.14k
    bool operator==(const iterator& I) const { return L == I.L; }
94
4.54k
    bool operator!=(const iterator& I) const { return L != I.L; }
Unexecuted instantiation: llvm::ImmutableList<clang::ento::MemRegion const*>::iterator::operator!=(llvm::ImmutableList<clang::ento::MemRegion const*>::iterator const&) const
llvm::ImmutableList<clang::ento::FieldNode const&>::iterator::operator!=(llvm::ImmutableList<clang::ento::FieldNode const&>::iterator const&) const
Line
Count
Source
94
1.31k
    bool operator!=(const iterator& I) const { return L != I.L; }
llvm::ImmutableList<clang::ento::SVal>::iterator::operator!=(llvm::ImmutableList<clang::ento::SVal>::iterator const&) const
Line
Count
Source
94
3.19k
    bool operator!=(const iterator& I) const { return L != I.L; }
llvm::ImmutableList<clang::CXXBaseSpecifier const*>::iterator::operator!=(llvm::ImmutableList<clang::CXXBaseSpecifier const*>::iterator const&) const
Line
Count
Source
94
30
    bool operator!=(const iterator& I) const { return L != I.L; }
95
6.33k
    const value_type& operator*() const { return L->getHead(); }
llvm::ImmutableList<clang::ento::SVal>::iterator::operator*() const
Line
Count
Source
95
5.81k
    const value_type& operator*() const { return L->getHead(); }
Unexecuted instantiation: llvm::ImmutableList<clang::ento::MemRegion const*>::iterator::operator*() const
llvm::ImmutableList<clang::ento::FieldNode const&>::iterator::operator*() const
Line
Count
Source
95
492
    const value_type& operator*() const { return L->getHead(); }
llvm::ImmutableList<clang::CXXBaseSpecifier const*>::iterator::operator*() const
Line
Count
Source
95
21
    const value_type& operator*() const { return L->getHead(); }
96
    const typename std::remove_reference<value_type>::type* operator->() const {
97
      return &L->getHead();
98
    }
99
100
    ImmutableList getList() const { return L; }
101
  };
102
103
  /// begin - Returns an iterator referring to the head of the list, or
104
  ///  an iterator denoting the end of the list if the list is empty.
105
4.03k
  iterator begin() const { return iterator(X); }
llvm::ImmutableList<clang::ento::SVal>::begin() const
Line
Count
Source
105
3.19k
  iterator begin() const { return iterator(X); }
llvm::ImmutableList<clang::CXXBaseSpecifier const*>::begin() const
Line
Count
Source
105
7
  iterator begin() const { return iterator(X); }
Unexecuted instantiation: llvm::ImmutableList<clang::ento::MemRegion const*>::begin() const
llvm::ImmutableList<clang::ento::FieldNode const&>::begin() const
Line
Count
Source
105
828
  iterator begin() const { return iterator(X); }
106
107
  /// end - Returns an iterator denoting the end of the list.  This iterator
108
  ///  does not refer to a valid list element.
109
4.02k
  iterator end() const { return iterator(); }
llvm::ImmutableList<clang::ento::SVal>::end() const
Line
Count
Source
109
3.19k
  iterator end() const { return iterator(); }
llvm::ImmutableList<clang::CXXBaseSpecifier const*>::end() const
Line
Count
Source
109
7
  iterator end() const { return iterator(); }
Unexecuted instantiation: llvm::ImmutableList<clang::ento::MemRegion const*>::end() const
llvm::ImmutableList<clang::ento::FieldNode const&>::end() const
Line
Count
Source
109
828
  iterator end() const { return iterator(); }
110
111
  /// isEmpty - Returns true if the list is empty.
112
8.24k
  bool isEmpty() const { return !X; }
llvm::ImmutableList<clang::ento::MemRegion const*>::isEmpty() const
Line
Count
Source
112
46
  bool isEmpty() const { return !X; }
llvm::ImmutableList<clang::ento::FieldNode const&>::isEmpty() const
Line
Count
Source
112
508
  bool isEmpty() const { return !X; }
llvm::ImmutableList<LoopState>::isEmpty() const
Line
Count
Source
112
7.69k
  bool isEmpty() const { return !X; }
113
114
  bool contains(const T& V) const {
115
    for (iterator I = begin(), E = end(); I != E; ++I) {
116
      if (*I == V)
117
        return true;
118
    }
119
    return false;
120
  }
121
122
  /// isEqual - Returns true if two lists are equal.  Because all lists created
123
  ///  from the same ImmutableListFactory are uniqued, this has O(1) complexity
124
  ///  because it the contents of the list do not need to be compared.  Note
125
  ///  that you should only compare two lists created from the same
126
  ///  ImmutableListFactory.
127
  bool isEqual(const ImmutableList& L) const { return X == L.X; }
128
129
  bool operator==(const ImmutableList& L) const { return isEqual(L); }
130
131
  /// getHead - Returns the head of the list.
132
11.4k
  const T& getHead() const {
133
11.4k
    assert(!isEmpty() && "Cannot get the head of an empty list.");
134
11.4k
    return X->getHead();
135
11.4k
  }
llvm::ImmutableList<clang::ento::MemRegion const*>::getHead() const
Line
Count
Source
132
33
  const T& getHead() const {
133
33
    assert(!isEmpty() && "Cannot get the head of an empty list.");
134
33
    return X->getHead();
135
33
  }
llvm::ImmutableList<clang::ento::FieldNode const&>::getHead() const
Line
Count
Source
132
580
  const T& getHead() const {
133
580
    assert(!isEmpty() && "Cannot get the head of an empty list.");
134
580
    return X->getHead();
135
580
  }
llvm::ImmutableList<LoopState>::getHead() const
Line
Count
Source
132
10.8k
  const T& getHead() const {
133
10.8k
    assert(!isEmpty() && "Cannot get the head of an empty list.");
134
10.8k
    return X->getHead();
135
10.8k
  }
136
137
  /// getTail - Returns the tail of the list, which is another (possibly empty)
138
  ///  ImmutableList.
139
482
  ImmutableList getTail() const {
140
482
    return X ? X->getTail() : 
nullptr0
;
141
482
  }
llvm::ImmutableList<clang::ento::MemRegion const*>::getTail() const
Line
Count
Source
139
29
  ImmutableList getTail() const {
140
29
    return X ? X->getTail() : 
nullptr0
;
141
29
  }
llvm::ImmutableList<clang::ento::FieldNode const&>::getTail() const
Line
Count
Source
139
288
  ImmutableList getTail() const {
140
288
    return X ? X->getTail() : 
nullptr0
;
141
288
  }
llvm::ImmutableList<LoopState>::getTail() const
Line
Count
Source
139
165
  ImmutableList getTail() const {
140
165
    return X ? X->getTail() : 
nullptr0
;
141
165
  }
142
143
  void Profile(FoldingSetNodeID& ID) const {
144
    ID.AddPointer(X);
145
  }
146
};
147
148
template <typename T>
149
class ImmutableListFactory {
150
  using ListTy = ImmutableListImpl<T>;
151
  using CacheTy = FoldingSet<ListTy>;
152
153
  CacheTy Cache;
154
  uintptr_t Allocator;
155
156
22.1k
  bool ownsAllocator() const {
157
22.1k
    return (Allocator & 0x1) == 0;
158
22.1k
  }
llvm::ImmutableListFactory<clang::ento::SVal>::ownsAllocator() const
Line
Count
Source
156
10.8k
  bool ownsAllocator() const {
157
10.8k
    return (Allocator & 0x1) == 0;
158
10.8k
  }
llvm::ImmutableListFactory<clang::CXXBaseSpecifier const*>::ownsAllocator() const
Line
Count
Source
156
10.8k
  bool ownsAllocator() const {
157
10.8k
    return (Allocator & 0x1) == 0;
158
10.8k
  }
llvm::ImmutableListFactory<clang::ento::MemRegion const*>::ownsAllocator() const
Line
Count
Source
156
37
  bool ownsAllocator() const {
157
37
    return (Allocator & 0x1) == 0;
158
37
  }
llvm::ImmutableListFactory<clang::ento::FieldNode const&>::ownsAllocator() const
Line
Count
Source
156
282
  bool ownsAllocator() const {
157
282
    return (Allocator & 0x1) == 0;
158
282
  }
llvm::ImmutableListFactory<LoopState>::ownsAllocator() const
Line
Count
Source
156
86
  bool ownsAllocator() const {
157
86
    return (Allocator & 0x1) == 0;
158
86
  }
159
160
2.57k
  BumpPtrAllocator& getAllocator() const {
161
2.57k
    return *reinterpret_cast<BumpPtrAllocator*>(Allocator & ~0x1);
162
2.57k
  }
llvm::ImmutableListFactory<clang::ento::SVal>::getAllocator() const
Line
Count
Source
160
1.83k
  BumpPtrAllocator& getAllocator() const {
161
1.83k
    return *reinterpret_cast<BumpPtrAllocator*>(Allocator & ~0x1);
162
1.83k
  }
llvm::ImmutableListFactory<clang::CXXBaseSpecifier const*>::getAllocator() const
Line
Count
Source
160
22
  BumpPtrAllocator& getAllocator() const {
161
22
    return *reinterpret_cast<BumpPtrAllocator*>(Allocator & ~0x1);
162
22
  }
llvm::ImmutableListFactory<clang::ento::MemRegion const*>::getAllocator() const
Line
Count
Source
160
46
  BumpPtrAllocator& getAllocator() const {
161
46
    return *reinterpret_cast<BumpPtrAllocator*>(Allocator & ~0x1);
162
46
  }
llvm::ImmutableListFactory<clang::ento::FieldNode const&>::getAllocator() const
Line
Count
Source
160
542
  BumpPtrAllocator& getAllocator() const {
161
542
    return *reinterpret_cast<BumpPtrAllocator*>(Allocator & ~0x1);
162
542
  }
llvm::ImmutableListFactory<LoopState>::getAllocator() const
Line
Count
Source
160
130
  BumpPtrAllocator& getAllocator() const {
161
130
    return *reinterpret_cast<BumpPtrAllocator*>(Allocator & ~0x1);
162
130
  }
163
164
public:
165
  ImmutableListFactory()
166
282
    : Allocator(reinterpret_cast<uintptr_t>(new BumpPtrAllocator())) {}
167
168
  ImmutableListFactory(BumpPtrAllocator& Alloc)
169
21.8k
  : Allocator(reinterpret_cast<uintptr_t>(&Alloc) | 0x1) {}
llvm::ImmutableListFactory<clang::ento::MemRegion const*>::ImmutableListFactory(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&)
Line
Count
Source
169
37
  : Allocator(reinterpret_cast<uintptr_t>(&Alloc) | 0x1) {}
llvm::ImmutableListFactory<LoopState>::ImmutableListFactory(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&)
Line
Count
Source
169
86
  : Allocator(reinterpret_cast<uintptr_t>(&Alloc) | 0x1) {}
llvm::ImmutableListFactory<clang::ento::SVal>::ImmutableListFactory(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&)
Line
Count
Source
169
10.8k
  : Allocator(reinterpret_cast<uintptr_t>(&Alloc) | 0x1) {}
llvm::ImmutableListFactory<clang::CXXBaseSpecifier const*>::ImmutableListFactory(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&)
Line
Count
Source
169
10.8k
  : Allocator(reinterpret_cast<uintptr_t>(&Alloc) | 0x1) {}
170
171
22.1k
  ~ImmutableListFactory() {
172
22.1k
    if (ownsAllocator()) 
delete &getAllocator()282
;
173
22.1k
  }
llvm::ImmutableListFactory<clang::ento::MemRegion const*>::~ImmutableListFactory()
Line
Count
Source
171
37
  ~ImmutableListFactory() {
172
37
    if (ownsAllocator()) 
delete &getAllocator()0
;
173
37
  }
llvm::ImmutableListFactory<clang::ento::FieldNode const&>::~ImmutableListFactory()
Line
Count
Source
171
282
  ~ImmutableListFactory() {
172
282
    if (ownsAllocator()) delete &getAllocator();
173
282
  }
llvm::ImmutableListFactory<clang::ento::SVal>::~ImmutableListFactory()
Line
Count
Source
171
10.8k
  ~ImmutableListFactory() {
172
10.8k
    if (ownsAllocator()) 
delete &getAllocator()0
;
173
10.8k
  }
llvm::ImmutableListFactory<clang::CXXBaseSpecifier const*>::~ImmutableListFactory()
Line
Count
Source
171
10.8k
  ~ImmutableListFactory() {
172
10.8k
    if (ownsAllocator()) 
delete &getAllocator()0
;
173
10.8k
  }
llvm::ImmutableListFactory<LoopState>::~ImmutableListFactory()
Line
Count
Source
171
86
  ~ImmutableListFactory() {
172
86
    if (ownsAllocator()) 
delete &getAllocator()0
;
173
86
  }
174
175
  template <typename ElemT>
176
2.70k
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
2.70k
    // Profile the new list to see if it already exists in our cache.
178
2.70k
    FoldingSetNodeID ID;
179
2.70k
    void* InsertPos;
180
2.70k
181
2.70k
    const ListTy* TailImpl = Tail.getInternalPointer();
182
2.70k
    ListTy::Profile(ID, Head, TailImpl);
183
2.70k
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
2.70k
185
2.70k
    if (!L) {
186
2.29k
      // The list does not exist in our cache.  Create it.
187
2.29k
      BumpPtrAllocator& A = getAllocator();
188
2.29k
      L = (ListTy*) A.Allocate<ListTy>();
189
2.29k
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
2.29k
191
2.29k
      // Insert the new list into the cache.
192
2.29k
      Cache.InsertNode(L, InsertPos);
193
2.29k
    }
194
2.70k
195
2.70k
    return L;
196
2.70k
  }
llvm::ImmutableList<clang::ento::SVal> llvm::ImmutableListFactory<clang::ento::SVal>::concat<clang::ento::SVal&>(clang::ento::SVal&&&, llvm::ImmutableList<clang::ento::SVal>)
Line
Count
Source
176
2.08k
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
2.08k
    // Profile the new list to see if it already exists in our cache.
178
2.08k
    FoldingSetNodeID ID;
179
2.08k
    void* InsertPos;
180
2.08k
181
2.08k
    const ListTy* TailImpl = Tail.getInternalPointer();
182
2.08k
    ListTy::Profile(ID, Head, TailImpl);
183
2.08k
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
2.08k
185
2.08k
    if (!L) {
186
1.83k
      // The list does not exist in our cache.  Create it.
187
1.83k
      BumpPtrAllocator& A = getAllocator();
188
1.83k
      L = (ListTy*) A.Allocate<ListTy>();
189
1.83k
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
1.83k
191
1.83k
      // Insert the new list into the cache.
192
1.83k
      Cache.InsertNode(L, InsertPos);
193
1.83k
    }
194
2.08k
195
2.08k
    return L;
196
2.08k
  }
llvm::ImmutableList<clang::CXXBaseSpecifier const*> llvm::ImmutableListFactory<clang::CXXBaseSpecifier const*>::concat<clang::CXXBaseSpecifier const*&>(clang::CXXBaseSpecifier const*&&&, llvm::ImmutableList<clang::CXXBaseSpecifier const*>)
Line
Count
Source
176
28
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
28
    // Profile the new list to see if it already exists in our cache.
178
28
    FoldingSetNodeID ID;
179
28
    void* InsertPos;
180
28
181
28
    const ListTy* TailImpl = Tail.getInternalPointer();
182
28
    ListTy::Profile(ID, Head, TailImpl);
183
28
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
28
185
28
    if (!L) {
186
22
      // The list does not exist in our cache.  Create it.
187
22
      BumpPtrAllocator& A = getAllocator();
188
22
      L = (ListTy*) A.Allocate<ListTy>();
189
22
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
22
191
22
      // Insert the new list into the cache.
192
22
      Cache.InsertNode(L, InsertPos);
193
22
    }
194
28
195
28
    return L;
196
28
  }
llvm::ImmutableList<clang::ento::MemRegion const*> llvm::ImmutableListFactory<clang::ento::MemRegion const*>::concat<clang::ento::MemRegion const*&>(clang::ento::MemRegion const*&&&, llvm::ImmutableList<clang::ento::MemRegion const*>)
Line
Count
Source
176
53
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
53
    // Profile the new list to see if it already exists in our cache.
178
53
    FoldingSetNodeID ID;
179
53
    void* InsertPos;
180
53
181
53
    const ListTy* TailImpl = Tail.getInternalPointer();
182
53
    ListTy::Profile(ID, Head, TailImpl);
183
53
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
53
185
53
    if (!L) {
186
46
      // The list does not exist in our cache.  Create it.
187
46
      BumpPtrAllocator& A = getAllocator();
188
46
      L = (ListTy*) A.Allocate<ListTy>();
189
46
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
46
191
46
      // Insert the new list into the cache.
192
46
      Cache.InsertNode(L, InsertPos);
193
46
    }
194
53
195
53
    return L;
196
53
  }
UninitializedObjectChecker.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::concat<(anonymous namespace)::RegularField const&>((anonymous namespace)::RegularField const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
176
178
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
178
    // Profile the new list to see if it already exists in our cache.
178
178
    FoldingSetNodeID ID;
179
178
    void* InsertPos;
180
178
181
178
    const ListTy* TailImpl = Tail.getInternalPointer();
182
178
    ListTy::Profile(ID, Head, TailImpl);
183
178
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
178
185
178
    if (!L) {
186
138
      // The list does not exist in our cache.  Create it.
187
138
      BumpPtrAllocator& A = getAllocator();
188
138
      L = (ListTy*) A.Allocate<ListTy>();
189
138
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
138
191
138
      // Insert the new list into the cache.
192
138
      Cache.InsertNode(L, InsertPos);
193
138
    }
194
178
195
178
    return L;
196
178
  }
UninitializedObjectChecker.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::concat<(anonymous namespace)::BaseClass const&>((anonymous namespace)::BaseClass const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
176
80
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
80
    // Profile the new list to see if it already exists in our cache.
178
80
    FoldingSetNodeID ID;
179
80
    void* InsertPos;
180
80
181
80
    const ListTy* TailImpl = Tail.getInternalPointer();
182
80
    ListTy::Profile(ID, Head, TailImpl);
183
80
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
80
185
80
    if (!L) {
186
39
      // The list does not exist in our cache.  Create it.
187
39
      BumpPtrAllocator& A = getAllocator();
188
39
      L = (ListTy*) A.Allocate<ListTy>();
189
39
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
39
191
39
      // Insert the new list into the cache.
192
39
      Cache.InsertNode(L, InsertPos);
193
39
    }
194
80
195
80
    return L;
196
80
  }
UninitializedPointee.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::concat<(anonymous namespace)::LocField const&>((anonymous namespace)::LocField const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
176
76
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
76
    // Profile the new list to see if it already exists in our cache.
178
76
    FoldingSetNodeID ID;
179
76
    void* InsertPos;
180
76
181
76
    const ListTy* TailImpl = Tail.getInternalPointer();
182
76
    ListTy::Profile(ID, Head, TailImpl);
183
76
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
76
185
76
    if (!L) {
186
62
      // The list does not exist in our cache.  Create it.
187
62
      BumpPtrAllocator& A = getAllocator();
188
62
      L = (ListTy*) A.Allocate<ListTy>();
189
62
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
62
191
62
      // Insert the new list into the cache.
192
62
      Cache.InsertNode(L, InsertPos);
193
62
    }
194
76
195
76
    return L;
196
76
  }
UninitializedPointee.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::concat<(anonymous namespace)::CyclicLocField const&>((anonymous namespace)::CyclicLocField const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
176
6
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
6
    // Profile the new list to see if it already exists in our cache.
178
6
    FoldingSetNodeID ID;
179
6
    void* InsertPos;
180
6
181
6
    const ListTy* TailImpl = Tail.getInternalPointer();
182
6
    ListTy::Profile(ID, Head, TailImpl);
183
6
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
6
185
6
    if (!L) {
186
6
      // The list does not exist in our cache.  Create it.
187
6
      BumpPtrAllocator& A = getAllocator();
188
6
      L = (ListTy*) A.Allocate<ListTy>();
189
6
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
6
191
6
      // Insert the new list into the cache.
192
6
      Cache.InsertNode(L, InsertPos);
193
6
    }
194
6
195
6
    return L;
196
6
  }
UninitializedPointee.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::concat<(anonymous namespace)::NeedsCastLocField const&>((anonymous namespace)::NeedsCastLocField const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
176
15
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
15
    // Profile the new list to see if it already exists in our cache.
178
15
    FoldingSetNodeID ID;
179
15
    void* InsertPos;
180
15
181
15
    const ListTy* TailImpl = Tail.getInternalPointer();
182
15
    ListTy::Profile(ID, Head, TailImpl);
183
15
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
15
185
15
    if (!L) {
186
15
      // The list does not exist in our cache.  Create it.
187
15
      BumpPtrAllocator& A = getAllocator();
188
15
      L = (ListTy*) A.Allocate<ListTy>();
189
15
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
15
191
15
      // Insert the new list into the cache.
192
15
      Cache.InsertNode(L, InsertPos);
193
15
    }
194
15
195
15
    return L;
196
15
  }
llvm::ImmutableList<LoopState> llvm::ImmutableListFactory<LoopState>::concat<LoopState&>(LoopState&&&, llvm::ImmutableList<LoopState>)
Line
Count
Source
176
188
  LLVM_NODISCARD ImmutableList<T> concat(ElemT &&Head, ImmutableList<T> Tail) {
177
188
    // Profile the new list to see if it already exists in our cache.
178
188
    FoldingSetNodeID ID;
179
188
    void* InsertPos;
180
188
181
188
    const ListTy* TailImpl = Tail.getInternalPointer();
182
188
    ListTy::Profile(ID, Head, TailImpl);
183
188
    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
184
188
185
188
    if (!L) {
186
130
      // The list does not exist in our cache.  Create it.
187
130
      BumpPtrAllocator& A = getAllocator();
188
130
      L = (ListTy*) A.Allocate<ListTy>();
189
130
      new (L) ListTy(std::forward<ElemT>(Head), TailImpl);
190
130
191
130
      // Insert the new list into the cache.
192
130
      Cache.InsertNode(L, InsertPos);
193
130
    }
194
188
195
188
    return L;
196
188
  }
197
198
  template <typename ElemT>
199
2.70k
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
2.70k
    return concat(std::forward<ElemT>(Data), L);
201
2.70k
  }
llvm::ImmutableList<clang::ento::SVal> llvm::ImmutableListFactory<clang::ento::SVal>::add<clang::ento::SVal&>(clang::ento::SVal&&&, llvm::ImmutableList<clang::ento::SVal>)
Line
Count
Source
199
2.08k
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
2.08k
    return concat(std::forward<ElemT>(Data), L);
201
2.08k
  }
llvm::ImmutableList<clang::CXXBaseSpecifier const*> llvm::ImmutableListFactory<clang::CXXBaseSpecifier const*>::add<clang::CXXBaseSpecifier const*&>(clang::CXXBaseSpecifier const*&&&, llvm::ImmutableList<clang::CXXBaseSpecifier const*>)
Line
Count
Source
199
28
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
28
    return concat(std::forward<ElemT>(Data), L);
201
28
  }
llvm::ImmutableList<clang::ento::MemRegion const*> llvm::ImmutableListFactory<clang::ento::MemRegion const*>::add<clang::ento::MemRegion const*&>(clang::ento::MemRegion const*&&&, llvm::ImmutableList<clang::ento::MemRegion const*>)
Line
Count
Source
199
53
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
53
    return concat(std::forward<ElemT>(Data), L);
201
53
  }
UninitializedObjectChecker.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::add<(anonymous namespace)::RegularField const&>((anonymous namespace)::RegularField const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
199
178
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
178
    return concat(std::forward<ElemT>(Data), L);
201
178
  }
UninitializedObjectChecker.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::add<(anonymous namespace)::BaseClass const&>((anonymous namespace)::BaseClass const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
199
80
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
80
    return concat(std::forward<ElemT>(Data), L);
201
80
  }
UninitializedPointee.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::add<(anonymous namespace)::LocField const&>((anonymous namespace)::LocField const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
199
76
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
76
    return concat(std::forward<ElemT>(Data), L);
201
76
  }
UninitializedPointee.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::add<(anonymous namespace)::CyclicLocField const&>((anonymous namespace)::CyclicLocField const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
199
6
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
6
    return concat(std::forward<ElemT>(Data), L);
201
6
  }
UninitializedPointee.cpp:llvm::ImmutableList<clang::ento::FieldNode const&> llvm::ImmutableListFactory<clang::ento::FieldNode const&>::add<(anonymous namespace)::NeedsCastLocField const&>((anonymous namespace)::NeedsCastLocField const&&&, llvm::ImmutableList<clang::ento::FieldNode const&>)
Line
Count
Source
199
15
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
15
    return concat(std::forward<ElemT>(Data), L);
201
15
  }
llvm::ImmutableList<LoopState> llvm::ImmutableListFactory<LoopState>::add<LoopState&>(LoopState&&&, llvm::ImmutableList<LoopState>)
Line
Count
Source
199
188
  LLVM_NODISCARD ImmutableList<T> add(ElemT &&Data, ImmutableList<T> L) {
200
188
    return concat(std::forward<ElemT>(Data), L);
201
188
  }
202
203
  template <typename ...CtorArgs>
204
  LLVM_NODISCARD ImmutableList<T> emplace(ImmutableList<T> Tail,
205
                                          CtorArgs &&...Args) {
206
    return concat(T(std::forward<CtorArgs>(Args)...), Tail);
207
  }
208
209
1.11k
  ImmutableList<T> getEmptyList() const {
210
1.11k
    return ImmutableList<T>(nullptr);
211
1.11k
  }
llvm::ImmutableListFactory<clang::ento::SVal>::getEmptyList() const
Line
Count
Source
209
1.09k
  ImmutableList<T> getEmptyList() const {
210
1.09k
    return ImmutableList<T>(nullptr);
211
1.09k
  }
llvm::ImmutableListFactory<clang::CXXBaseSpecifier const*>::getEmptyList() const
Line
Count
Source
209
12
  ImmutableList<T> getEmptyList() const {
210
12
    return ImmutableList<T>(nullptr);
211
12
  }
212
213
  template <typename ElemT>
214
  ImmutableList<T> create(ElemT &&Data) {
215
    return concat(std::forward<ElemT>(Data), getEmptyList());
216
  }
217
};
218
219
//===----------------------------------------------------------------------===//
220
// Partially-specialized Traits.
221
//===----------------------------------------------------------------------===//
222
223
template<typename T> struct DenseMapInfo;
224
template<typename T> struct DenseMapInfo<ImmutableList<T>> {
225
  static inline ImmutableList<T> getEmptyKey() {
226
    return reinterpret_cast<ImmutableListImpl<T>*>(-1);
227
  }
228
229
  static inline ImmutableList<T> getTombstoneKey() {
230
    return reinterpret_cast<ImmutableListImpl<T>*>(-2);
231
  }
232
233
  static unsigned getHashValue(ImmutableList<T> X) {
234
    uintptr_t PtrVal = reinterpret_cast<uintptr_t>(X.getInternalPointer());
235
    return (unsigned((uintptr_t)PtrVal) >> 4) ^
236
           (unsigned((uintptr_t)PtrVal) >> 9);
237
  }
238
239
  static bool isEqual(ImmutableList<T> X1, ImmutableList<T> X2) {
240
    return X1 == X2;
241
  }
242
};
243
244
} // end namespace llvm
245
246
#endif // LLVM_ADT_IMMUTABLELIST_H