Coverage Report

Created: 2021-09-21 08:58

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/CodeGen/EHScopeStack.h
Line
Count
Source (jump to first uncovered line)
1
//===-- EHScopeStack.h - Stack for cleanup IR generation --------*- 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
// These classes should be the minimum interface required for other parts of
10
// CodeGen to emit cleanups.  The implementation is in CGCleanup.cpp and other
11
// implemenentation details that are not widely needed are in CGCleanup.h.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_CLANG_LIB_CODEGEN_EHSCOPESTACK_H
16
#define LLVM_CLANG_LIB_CODEGEN_EHSCOPESTACK_H
17
18
#include "clang/Basic/LLVM.h"
19
#include "llvm/ADT/STLExtras.h"
20
#include "llvm/ADT/SmallVector.h"
21
#include "llvm/IR/BasicBlock.h"
22
#include "llvm/IR/Instructions.h"
23
#include "llvm/IR/Value.h"
24
25
namespace clang {
26
namespace CodeGen {
27
28
class CodeGenFunction;
29
30
/// A branch fixup.  These are required when emitting a goto to a
31
/// label which hasn't been emitted yet.  The goto is optimistically
32
/// emitted as a branch to the basic block for the label, and (if it
33
/// occurs in a scope with non-trivial cleanups) a fixup is added to
34
/// the innermost cleanup.  When a (normal) cleanup is popped, any
35
/// unresolved fixups in that scope are threaded through the cleanup.
36
struct BranchFixup {
37
  /// The block containing the terminator which needs to be modified
38
  /// into a switch if this fixup is resolved into the current scope.
39
  /// If null, LatestBranch points directly to the destination.
40
  llvm::BasicBlock *OptimisticBranchBlock;
41
42
  /// The ultimate destination of the branch.
43
  ///
44
  /// This can be set to null to indicate that this fixup was
45
  /// successfully resolved.
46
  llvm::BasicBlock *Destination;
47
48
  /// The destination index value.
49
  unsigned DestinationIndex;
50
51
  /// The initial branch of the fixup.
52
  llvm::BranchInst *InitialBranch;
53
};
54
55
template <class T> struct InvariantValue {
56
  typedef T type;
57
  typedef T saved_type;
58
  static bool needsSaving(type value) { return false; }
59
374
  static saved_type save(CodeGenFunction &CGF, type value) { return value; }
clang::CodeGen::InvariantValue<clang::QualType>::save(clang::CodeGen::CodeGenFunction&, clang::QualType)
Line
Count
Source
59
130
  static saved_type save(CodeGenFunction &CGF, type value) { return value; }
clang::CodeGen::InvariantValue<void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>::save(clang::CodeGen::CodeGenFunction&, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType))
Line
Count
Source
59
122
  static saved_type save(CodeGenFunction &CGF, type value) { return value; }
clang::CodeGen::InvariantValue<bool>::save(clang::CodeGen::CodeGenFunction&, bool)
Line
Count
Source
59
122
  static saved_type save(CodeGenFunction &CGF, type value) { return value; }
Unexecuted instantiation: clang::CodeGen::InvariantValue<clang::CharUnits>::save(clang::CodeGen::CodeGenFunction&, clang::CharUnits)
60
505
  static type restore(CodeGenFunction &CGF, saved_type value) { return value; }
clang::CodeGen::InvariantValue<clang::QualType>::restore(clang::CodeGen::CodeGenFunction&, clang::QualType)
Line
Count
Source
60
171
  static type restore(CodeGenFunction &CGF, saved_type value) { return value; }
clang::CodeGen::InvariantValue<void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>::restore(clang::CodeGen::CodeGenFunction&, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType))
Line
Count
Source
60
167
  static type restore(CodeGenFunction &CGF, saved_type value) { return value; }
clang::CodeGen::InvariantValue<bool>::restore(clang::CodeGen::CodeGenFunction&, bool)
Line
Count
Source
60
167
  static type restore(CodeGenFunction &CGF, saved_type value) { return value; }
Unexecuted instantiation: clang::CodeGen::InvariantValue<clang::CharUnits>::restore(clang::CodeGen::CodeGenFunction&, clang::CharUnits)
61
};
62
63
/// A metaprogramming class for ensuring that a value will dominate an
64
/// arbitrary position in a function.
65
template <class T> struct DominatingValue : InvariantValue<T> {};
66
67
template <class T, bool mightBeInstruction =
68
            std::is_base_of<llvm::Value, T>::value &&
69
            !std::is_base_of<llvm::Constant, T>::value &&
70
            !std::is_base_of<llvm::BasicBlock, T>::value>
71
struct DominatingPointer;
72
template <class T> struct DominatingPointer<T,false> : InvariantValue<T*> {};
73
// template <class T> struct DominatingPointer<T,true> at end of file
74
75
template <class T> struct DominatingValue<T*> : DominatingPointer<T> {};
76
77
enum CleanupKind : unsigned {
78
  /// Denotes a cleanup that should run when a scope is exited using exceptional
79
  /// control flow (a throw statement leading to stack unwinding, ).
80
  EHCleanup = 0x1,
81
82
  /// Denotes a cleanup that should run when a scope is exited using normal
83
  /// control flow (falling off the end of the scope, return, goto, ...).
84
  NormalCleanup = 0x2,
85
86
  NormalAndEHCleanup = EHCleanup | NormalCleanup,
87
88
  LifetimeMarker = 0x8,
89
  NormalEHLifetimeMarker = LifetimeMarker | NormalAndEHCleanup,
90
};
91
92
/// A stack of scopes which respond to exceptions, including cleanups
93
/// and catch blocks.
94
class EHScopeStack {
95
public:
96
  /* Should switch to alignof(uint64_t) instead of 8, when EHCleanupScope can */
97
  enum { ScopeStackAlignment = 8 };
98
99
  /// A saved depth on the scope stack.  This is necessary because
100
  /// pushing scopes onto the stack invalidates iterators.
101
  class stable_iterator {
102
    friend class EHScopeStack;
103
104
    /// Offset from StartOfData to EndOfBuffer.
105
    ptrdiff_t Size;
106
107
5.79M
    stable_iterator(ptrdiff_t Size) : Size(Size) {}
108
109
  public:
110
142
    static stable_iterator invalid() { return stable_iterator(-1); }
111
4.06M
    stable_iterator() : Size(-1) {}
112
113
1.22M
    bool isValid() const { return Size >= 0; }
114
115
    /// Returns true if this scope encloses I.
116
    /// Returns false if I is invalid.
117
    /// This scope must be valid.
118
247k
    bool encloses(stable_iterator I) const { return Size <= I.Size; }
119
120
    /// Returns true if this scope strictly encloses I: that is,
121
    /// if it encloses I and is not I.
122
    /// Returns false is I is invalid.
123
    /// This scope must be valid.
124
61.9k
    bool strictlyEncloses(stable_iterator I) const { return Size < I.Size; }
125
126
255k
    friend bool operator==(stable_iterator A, stable_iterator B) {
127
255k
      return A.Size == B.Size;
128
255k
    }
129
2.14M
    friend bool operator!=(stable_iterator A, stable_iterator B) {
130
2.14M
      return A.Size != B.Size;
131
2.14M
    }
132
  };
133
134
  /// Information for lazily generating a cleanup.  Subclasses must be
135
  /// POD-like: cleanups will not be destructed, and they will be
136
  /// allocated on the cleanup stack and freely copied and moved
137
  /// around.
138
  ///
139
  /// Cleanup implementations should generally be declared in an
140
  /// anonymous namespace.
141
  class Cleanup {
142
    // Anchor the construction vtable.
143
    virtual void anchor();
144
145
  protected:
146
    ~Cleanup() = default;
147
148
  public:
149
    Cleanup(const Cleanup &) = default;
150
0
    Cleanup(Cleanup &&) {}
151
50.9k
    Cleanup() = default;
152
153
0
    virtual bool isRedundantBeforeReturn() { return false; }
154
155
    /// Generation flags.
156
    class Flags {
157
      enum {
158
        F_IsForEH = 0x1,
159
        F_IsNormalCleanupKind = 0x2,
160
        F_IsEHCleanupKind = 0x4,
161
        F_HasExitSwitch = 0x8,
162
      };
163
      unsigned flags;
164
165
    public:
166
45.9k
      Flags() : flags(0) {}
167
168
      /// isForEH - true if the current emission is for an EH cleanup.
169
21.2k
      bool isForEHCleanup() const { return flags & F_IsForEH; }
170
20.9k
      bool isForNormalCleanup() const { return !isForEHCleanup(); }
171
8.13k
      void setIsForEHCleanup() { flags |= F_IsForEH; }
172
173
0
      bool isNormalCleanupKind() const { return flags & F_IsNormalCleanupKind; }
174
44.3k
      void setIsNormalCleanupKind() { flags |= F_IsNormalCleanupKind; }
175
176
      /// isEHCleanupKind - true if the cleanup was pushed as an EH
177
      /// cleanup.
178
0
      bool isEHCleanupKind() const { return flags & F_IsEHCleanupKind; }
179
41.8k
      void setIsEHCleanupKind() { flags |= F_IsEHCleanupKind; }
180
181
82
      bool hasExitSwitch() const { return flags & F_HasExitSwitch; }
182
356
      void setHasExitSwitch() { flags |= F_HasExitSwitch; }
183
    };
184
185
    /// Emit the cleanup.  For normal cleanups, this is run in the
186
    /// same EH context as when the cleanup was pushed, i.e. the
187
    /// immediately-enclosing context of the cleanup scope.  For
188
    /// EH cleanups, this is run in a terminate context.
189
    ///
190
    // \param flags cleanup kind.
191
    virtual void Emit(CodeGenFunction &CGF, Flags flags) = 0;
192
  };
193
194
  /// ConditionalCleanup stores the saved form of its parameters,
195
  /// then restores them and performs the cleanup.
196
  template <class T, class... As>
197
  class ConditionalCleanup final : public Cleanup {
198
    typedef std::tuple<typename DominatingValue<As>::saved_type...> SavedTuple;
199
    SavedTuple Saved;
200
201
    template <std::size_t... Is>
202
268
    T restore(CodeGenFunction &CGF, std::index_sequence<Is...>) {
203
      // It's important that the restores are emitted in order. The braced init
204
      // list guarantees that.
205
268
      return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...};
206
268
    }
Unexecuted instantiation: CGBuiltin.cpp:(anonymous namespace)::CallObjCArcUse clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::CallObjCArcUse, llvm::Value*>::restore<0ul>(clang::CodeGen::CodeGenFunction&, std::__1::integer_sequence<unsigned long, 0ul>)
CGCall.cpp:(anonymous namespace)::DestroyUnpassedArg clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::DestroyUnpassedArg, clang::CodeGen::Address, clang::QualType>::restore<0ul, 1ul>(clang::CodeGen::CodeGenFunction&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>)
Line
Count
Source
202
4
    T restore(CodeGenFunction &CGF, std::index_sequence<Is...>) {
203
      // It's important that the restores are emitted in order. The braced init
204
      // list guarantees that.
205
4
      return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...};
206
4
    }
clang::CodeGen::CodeGenFunction::CallLifetimeEnd clang::CodeGen::EHScopeStack::ConditionalCleanup<clang::CodeGen::CodeGenFunction::CallLifetimeEnd, clang::CodeGen::Address, llvm::Value*>::restore<0ul, 1ul>(clang::CodeGen::CodeGenFunction&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>)
Line
Count
Source
202
80
    T restore(CodeGenFunction &CGF, std::index_sequence<Is...>) {
203
      // It's important that the restores are emitted in order. The braced init
204
      // list guarantees that.
205
80
      return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...};
206
80
    }
CGDecl.cpp:(anonymous namespace)::DestroyObject clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::DestroyObject, clang::CodeGen::Address, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>::restore<0ul, 1ul, 2ul, 3ul>(clang::CodeGen::CodeGenFunction&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul>)
Line
Count
Source
202
167
    T restore(CodeGenFunction &CGF, std::index_sequence<Is...>) {
203
      // It's important that the restores are emitted in order. The braced init
204
      // list guarantees that.
205
167
      return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...};
206
167
    }
Unexecuted instantiation: CGDecl.cpp:(anonymous namespace)::IrregularPartialArrayDestroy clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::IrregularPartialArrayDestroy, llvm::Value*, clang::CodeGen::Address, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>::restore<0ul, 1ul, 2ul, 3ul, 4ul>(clang::CodeGen::CodeGenFunction&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul>)
Unexecuted instantiation: CGDecl.cpp:(anonymous namespace)::RegularPartialArrayDestroy clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::RegularPartialArrayDestroy, llvm::Value*, llvm::Value*, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>::restore<0ul, 1ul, 2ul, 3ul, 4ul>(clang::CodeGen::CodeGenFunction&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul>)
CGException.cpp:(anonymous namespace)::FreeException clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::FreeException, llvm::Value*>::restore<0ul>(clang::CodeGen::CodeGenFunction&, std::__1::integer_sequence<unsigned long, 0ul>)
Line
Count
Source
202
2
    T restore(CodeGenFunction &CGF, std::index_sequence<Is...>) {
203
      // It's important that the restores are emitted in order. The braced init
204
      // list guarantees that.
205
2
      return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...};
206
2
    }
CGObjC.cpp:(anonymous namespace)::CallObjCRelease clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::CallObjCRelease, llvm::Value*>::restore<0ul>(clang::CodeGen::CodeGenFunction&, std::__1::integer_sequence<unsigned long, 0ul>)
Line
Count
Source
202
15
    T restore(CodeGenFunction &CGF, std::index_sequence<Is...>) {
203
      // It's important that the restores are emitted in order. The braced init
204
      // list guarantees that.
205
15
      return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...};
206
15
    }
207
208
268
    void Emit(CodeGenFunction &CGF, Flags flags) override {
209
268
      restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags);
210
268
    }
Unexecuted instantiation: CGBuiltin.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::CallObjCArcUse, llvm::Value*>::Emit(clang::CodeGen::CodeGenFunction&, clang::CodeGen::EHScopeStack::Cleanup::Flags)
CGCall.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::DestroyUnpassedArg, clang::CodeGen::Address, clang::QualType>::Emit(clang::CodeGen::CodeGenFunction&, clang::CodeGen::EHScopeStack::Cleanup::Flags)
Line
Count
Source
208
4
    void Emit(CodeGenFunction &CGF, Flags flags) override {
209
4
      restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags);
210
4
    }
clang::CodeGen::EHScopeStack::ConditionalCleanup<clang::CodeGen::CodeGenFunction::CallLifetimeEnd, clang::CodeGen::Address, llvm::Value*>::Emit(clang::CodeGen::CodeGenFunction&, clang::CodeGen::EHScopeStack::Cleanup::Flags)
Line
Count
Source
208
80
    void Emit(CodeGenFunction &CGF, Flags flags) override {
209
80
      restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags);
210
80
    }
CGDecl.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::DestroyObject, clang::CodeGen::Address, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>::Emit(clang::CodeGen::CodeGenFunction&, clang::CodeGen::EHScopeStack::Cleanup::Flags)
Line
Count
Source
208
167
    void Emit(CodeGenFunction &CGF, Flags flags) override {
209
167
      restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags);
210
167
    }
Unexecuted instantiation: CGDecl.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::IrregularPartialArrayDestroy, llvm::Value*, clang::CodeGen::Address, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>::Emit(clang::CodeGen::CodeGenFunction&, clang::CodeGen::EHScopeStack::Cleanup::Flags)
Unexecuted instantiation: CGDecl.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::RegularPartialArrayDestroy, llvm::Value*, llvm::Value*, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>::Emit(clang::CodeGen::CodeGenFunction&, clang::CodeGen::EHScopeStack::Cleanup::Flags)
CGException.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::FreeException, llvm::Value*>::Emit(clang::CodeGen::CodeGenFunction&, clang::CodeGen::EHScopeStack::Cleanup::Flags)
Line
Count
Source
208
2
    void Emit(CodeGenFunction &CGF, Flags flags) override {
209
2
      restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags);
210
2
    }
CGObjC.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::CallObjCRelease, llvm::Value*>::Emit(clang::CodeGen::CodeGenFunction&, clang::CodeGen::EHScopeStack::Cleanup::Flags)
Line
Count
Source
208
15
    void Emit(CodeGenFunction &CGF, Flags flags) override {
209
15
      restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags);
210
15
    }
211
212
  public:
213
    ConditionalCleanup(typename DominatingValue<As>::saved_type... A)
214
44
        : Saved(A...) {}
215
216
236
    ConditionalCleanup(SavedTuple Tuple) : Saved(std::move(Tuple)) {}
Unexecuted instantiation: CGBuiltin.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::CallObjCArcUse, llvm::Value*>::ConditionalCleanup(std::__1::tuple<llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >)
CGCall.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::DestroyUnpassedArg, clang::CodeGen::Address, clang::QualType>::ConditionalCleanup(std::__1::tuple<clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType>)
Line
Count
Source
216
8
    ConditionalCleanup(SavedTuple Tuple) : Saved(std::move(Tuple)) {}
clang::CodeGen::EHScopeStack::ConditionalCleanup<clang::CodeGen::CodeGenFunction::CallLifetimeEnd, clang::CodeGen::Address, llvm::Value*>::ConditionalCleanup(std::__1::tuple<clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >)
Line
Count
Source
216
78
    ConditionalCleanup(SavedTuple Tuple) : Saved(std::move(Tuple)) {}
CGDecl.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::DestroyObject, clang::CodeGen::Address, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>::ConditionalCleanup(std::__1::tuple<clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>)
Line
Count
Source
216
122
    ConditionalCleanup(SavedTuple Tuple) : Saved(std::move(Tuple)) {}
Unexecuted instantiation: CGDecl.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::IrregularPartialArrayDestroy, llvm::Value*, clang::CodeGen::Address, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>::ConditionalCleanup(std::__1::tuple<llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > >, clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>)
Unexecuted instantiation: CGDecl.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::RegularPartialArrayDestroy, llvm::Value*, llvm::Value*, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>::ConditionalCleanup(std::__1::tuple<llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > >, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > >, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>)
CGException.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::FreeException, llvm::Value*>::ConditionalCleanup(std::__1::tuple<llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >)
Line
Count
Source
216
13
    ConditionalCleanup(SavedTuple Tuple) : Saved(std::move(Tuple)) {}
CGObjC.cpp:clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::CallObjCRelease, llvm::Value*>::ConditionalCleanup(std::__1::tuple<llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >)
Line
Count
Source
216
15
    ConditionalCleanup(SavedTuple Tuple) : Saved(std::move(Tuple)) {}
217
  };
218
219
private:
220
  // The implementation for this class is in CGException.h and
221
  // CGException.cpp; the definition is here because it's used as a
222
  // member of CodeGenFunction.
223
224
  /// The start of the scope-stack buffer, i.e. the allocated pointer
225
  /// for the buffer.  All of these pointers are either simultaneously
226
  /// null or simultaneously valid.
227
  char *StartOfBuffer;
228
229
  /// The end of the buffer.
230
  char *EndOfBuffer;
231
232
  /// The first valid entry in the buffer.
233
  char *StartOfData;
234
235
  /// The innermost normal cleanup on the stack.
236
  stable_iterator InnermostNormalCleanup;
237
238
  /// The innermost EH scope on the stack.
239
  stable_iterator InnermostEHScope;
240
241
  /// The CGF this Stack belong to
242
  CodeGenFunction* CGF;
243
244
  /// The current set of branch fixups.  A branch fixup is a jump to
245
  /// an as-yet unemitted label, i.e. a label for which we don't yet
246
  /// know the EH stack depth.  Whenever we pop a cleanup, we have
247
  /// to thread all the current branch fixups through it.
248
  ///
249
  /// Fixups are recorded as the Use of the respective branch or
250
  /// switch statement.  The use points to the final destination.
251
  /// When popping out of a cleanup, these uses are threaded through
252
  /// the cleanup and adjusted to point to the new cleanup.
253
  ///
254
  /// Note that branches are allowed to jump into protected scopes
255
  /// in certain situations;  e.g. the following code is legal:
256
  ///     struct A { ~A(); }; // trivial ctor, non-trivial dtor
257
  ///     goto foo;
258
  ///     A a;
259
  ///    foo:
260
  ///     bar();
261
  SmallVector<BranchFixup, 8> BranchFixups;
262
263
  char *allocate(size_t Size);
264
  void deallocate(size_t Size);
265
266
  void *pushCleanup(CleanupKind K, size_t DataSize);
267
268
public:
269
  EHScopeStack()
270
    : StartOfBuffer(nullptr), EndOfBuffer(nullptr), StartOfData(nullptr),
271
      InnermostNormalCleanup(stable_end()), InnermostEHScope(stable_end()),
272
378k
      CGF(nullptr) {}
273
378k
  ~EHScopeStack() { delete[] StartOfBuffer; }
274
275
  /// Push a lazily-created cleanup on the stack.
276
49.0k
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
49.0k
    static_assert(alignof(T) <= ScopeStackAlignment,
278
49.0k
                  "Cleanup's alignment is too large.");
279
49.0k
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
49.0k
    Cleanup *Obj = new (Buffer) T(A...);
281
49.0k
    (void) Obj;
282
49.0k
  }
CGBlocks.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallBlockRelease, clang::CodeGen::Address, clang::CodeGen::BlockFieldFlags, bool, bool>(clang::CodeGen::CleanupKind, clang::CodeGen::Address, clang::CodeGen::BlockFieldFlags, bool, bool)
Line
Count
Source
276
537
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
537
    static_assert(alignof(T) <= ScopeStackAlignment,
278
537
                  "Cleanup's alignment is too large.");
279
537
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
537
    Cleanup *Obj = new (Buffer) T(A...);
281
537
    (void) Obj;
282
537
  }
CGCall.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CopyBackSwiftError, clang::CodeGen::Address, clang::CodeGen::Address>(clang::CodeGen::CleanupKind, clang::CodeGen::Address, clang::CodeGen::Address)
Line
Count
Source
276
16
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
16
    static_assert(alignof(T) <= ScopeStackAlignment,
278
16
                  "Cleanup's alignment is too large.");
279
16
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
16
    Cleanup *Obj = new (Buffer) T(A...);
281
16
    (void) Obj;
282
16
  }
CGCall.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::DestroyUnpassedArg, clang::CodeGen::Address, clang::QualType>(clang::CodeGen::CleanupKind, clang::CodeGen::Address, clang::QualType)
Line
Count
Source
276
174
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
174
    static_assert(alignof(T) <= ScopeStackAlignment,
278
174
                  "Cleanup's alignment is too large.");
279
174
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
174
    Cleanup *Obj = new (Buffer) T(A...);
281
174
    (void) Obj;
282
174
  }
void clang::CodeGen::EHScopeStack::pushCleanup<clang::CodeGen::CodeGenFunction::CallLifetimeEnd, clang::CodeGen::Address, llvm::Value*>(clang::CodeGen::CleanupKind, clang::CodeGen::Address, llvm::Value*)
Line
Count
Source
276
6.60k
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
6.60k
    static_assert(alignof(T) <= ScopeStackAlignment,
278
6.60k
                  "Cleanup's alignment is too large.");
279
6.60k
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
6.60k
    Cleanup *Obj = new (Buffer) T(A...);
281
6.60k
    (void) Obj;
282
6.60k
  }
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallBaseDtor, clang::CXXRecordDecl const*, bool>(clang::CodeGen::CleanupKind, clang::CXXRecordDecl const*, bool)
Line
Count
Source
276
1.23k
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
1.23k
    static_assert(alignof(T) <= ScopeStackAlignment,
278
1.23k
                  "Cleanup's alignment is too large.");
279
1.23k
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
1.23k
    Cleanup *Obj = new (Buffer) T(A...);
281
1.23k
    (void) Obj;
282
1.23k
  }
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallDtorDeleteConditional, llvm::Value*>(clang::CodeGen::CleanupKind, llvm::Value*)
Line
Count
Source
276
203
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
203
    static_assert(alignof(T) <= ScopeStackAlignment,
278
203
                  "Cleanup's alignment is too large.");
279
203
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
203
    Cleanup *Obj = new (Buffer) T(A...);
281
203
    (void) Obj;
282
203
  }
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallDtorDelete>(clang::CodeGen::CleanupKind)
Line
Count
Source
276
657
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
657
    static_assert(alignof(T) <= ScopeStackAlignment,
278
657
                  "Cleanup's alignment is too large.");
279
657
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
657
    Cleanup *Obj = new (Buffer) T(A...);
281
657
    (void) Obj;
282
657
  }
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::SanitizeDtorVTable, clang::CXXDestructorDecl const*>(clang::CodeGen::CleanupKind, clang::CXXDestructorDecl const*)
Line
Count
Source
276
18
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
18
    static_assert(alignof(T) <= ScopeStackAlignment,
278
18
                  "Cleanup's alignment is too large.");
279
18
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
18
    Cleanup *Obj = new (Buffer) T(A...);
281
18
    (void) Obj;
282
18
  }
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallBaseDtor, clang::CXXRecordDecl*, bool>(clang::CodeGen::CleanupKind, clang::CXXRecordDecl*, bool)
Line
Count
Source
276
1.38k
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
1.38k
    static_assert(alignof(T) <= ScopeStackAlignment,
278
1.38k
                  "Cleanup's alignment is too large.");
279
1.38k
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
1.38k
    Cleanup *Obj = new (Buffer) T(A...);
281
1.38k
    (void) Obj;
282
1.38k
  }
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::SanitizeDtorMembers, clang::CXXDestructorDecl const*>(clang::CodeGen::CleanupKind, clang::CXXDestructorDecl const*)
Line
Count
Source
276
88
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
88
    static_assert(alignof(T) <= ScopeStackAlignment,
278
88
                  "Cleanup's alignment is too large.");
279
88
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
88
    Cleanup *Obj = new (Buffer) T(A...);
281
88
    (void) Obj;
282
88
  }
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::DestroyField, clang::FieldDecl const*, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), unsigned int>(clang::CodeGen::CleanupKind, clang::FieldDecl const*, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), unsigned int)
Line
Count
Source
276
1.06k
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
1.06k
    static_assert(alignof(T) <= ScopeStackAlignment,
278
1.06k
                  "Cleanup's alignment is too large.");
279
1.06k
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
1.06k
    Cleanup *Obj = new (Buffer) T(A...);
281
1.06k
    (void) Obj;
282
1.06k
  }
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallDelegatingCtorDtor, clang::CXXDestructorDecl*, clang::CodeGen::Address, clang::CXXDtorType>(clang::CodeGen::CleanupKind, clang::CXXDestructorDecl*, clang::CodeGen::Address, clang::CXXDtorType)
Line
Count
Source
276
68
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
68
    static_assert(alignof(T) <= ScopeStackAlignment,
278
68
                  "Cleanup's alignment is too large.");
279
68
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
68
    Cleanup *Obj = new (Buffer) T(A...);
281
68
    (void) Obj;
282
68
  }
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallLocalDtor, clang::CXXDestructorDecl const*, clang::CodeGen::Address, clang::QualType>(clang::CodeGen::CleanupKind, clang::CXXDestructorDecl const*, clang::CodeGen::Address, clang::QualType)
Line
Count
Source
276
10
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
10
    static_assert(alignof(T) <= ScopeStackAlignment,
278
10
                  "Cleanup's alignment is too large.");
279
10
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
10
    Cleanup *Obj = new (Buffer) T(A...);
281
10
    (void) Obj;
282
10
  }
CGCoroutine.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallCoroDelete, clang::Expr*>(clang::CodeGen::CleanupKind, clang::Expr*)
Line
Count
Source
276
55
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
55
    static_assert(alignof(T) <= ScopeStackAlignment,
278
55
                  "Cleanup's alignment is too large.");
279
55
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
55
    Cleanup *Obj = new (Buffer) T(A...);
281
55
    (void) Obj;
282
55
  }
CGCoroutine.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallCoroEnd>(clang::CodeGen::CleanupKind)
Line
Count
Source
276
55
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
55
    static_assert(alignof(T) <= ScopeStackAlignment,
278
55
                  "Cleanup's alignment is too large.");
279
55
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
55
    Cleanup *Obj = new (Buffer) T(A...);
281
55
    (void) Obj;
282
55
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::DestroyNRVOVariableCXX, clang::CodeGen::Address, clang::QualType, clang::CXXDestructorDecl*, llvm::Value*>(clang::CodeGen::CleanupKind, clang::CodeGen::Address, clang::QualType, clang::CXXDestructorDecl*, llvm::Value*)
Line
Count
Source
276
210
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
210
    static_assert(alignof(T) <= ScopeStackAlignment,
278
210
                  "Cleanup's alignment is too large.");
279
210
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
210
    Cleanup *Obj = new (Buffer) T(A...);
281
210
    (void) Obj;
282
210
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::DestroyNRVOVariableC, clang::CodeGen::Address, llvm::Value*, clang::QualType>(clang::CodeGen::CleanupKind, clang::CodeGen::Address, llvm::Value*, clang::QualType)
Line
Count
Source
276
5
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
5
    static_assert(alignof(T) <= ScopeStackAlignment,
278
5
                  "Cleanup's alignment is too large.");
279
5
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
5
    Cleanup *Obj = new (Buffer) T(A...);
281
5
    (void) Obj;
282
5
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::DestroyObject, clang::CodeGen::Address, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>(clang::CodeGen::CleanupKind, clang::CodeGen::Address, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool)
Line
Count
Source
276
14.3k
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
14.3k
    static_assert(alignof(T) <= ScopeStackAlignment,
278
14.3k
                  "Cleanup's alignment is too large.");
279
14.3k
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
14.3k
    Cleanup *Obj = new (Buffer) T(A...);
281
14.3k
    (void) Obj;
282
14.3k
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::ExtendGCLifetime, clang::VarDecl const*>(clang::CodeGen::CleanupKind, clang::VarDecl const*)
Line
Count
Source
276
1
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
1
    static_assert(alignof(T) <= ScopeStackAlignment,
278
1
                  "Cleanup's alignment is too large.");
279
1
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
1
    Cleanup *Obj = new (Buffer) T(A...);
281
1
    (void) Obj;
282
1
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallCleanupFunction, llvm::Constant*, clang::CodeGen::CGFunctionInfo const*, clang::VarDecl const*>(clang::CodeGen::CleanupKind, llvm::Constant*, clang::CodeGen::CGFunctionInfo const*, clang::VarDecl const*)
Line
Count
Source
276
8
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
8
    static_assert(alignof(T) <= ScopeStackAlignment,
278
8
                  "Cleanup's alignment is too large.");
279
8
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
8
    Cleanup *Obj = new (Buffer) T(A...);
281
8
    (void) Obj;
282
8
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallStackRestore, clang::CodeGen::Address>(clang::CodeGen::CleanupKind, clang::CodeGen::Address)
Line
Count
Source
276
1.58k
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
1.58k
    static_assert(alignof(T) <= ScopeStackAlignment,
278
1.58k
                  "Cleanup's alignment is too large.");
279
1.58k
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
1.58k
    Cleanup *Obj = new (Buffer) T(A...);
281
1.58k
    (void) Obj;
282
1.58k
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::DestroyObject, clang::CodeGen::Address, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>, clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>(clang::CodeGen::CleanupKind, clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool)
Line
Count
Source
276
15
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
15
    static_assert(alignof(T) <= ScopeStackAlignment,
278
15
                  "Cleanup's alignment is too large.");
279
15
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
15
    Cleanup *Obj = new (Buffer) T(A...);
281
15
    (void) Obj;
282
15
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::IrregularPartialArrayDestroy, llvm::Value*, clang::CodeGen::Address, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>(clang::CodeGen::CleanupKind, llvm::Value*, clang::CodeGen::Address, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType))
Line
Count
Source
276
72
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
72
    static_assert(alignof(T) <= ScopeStackAlignment,
278
72
                  "Cleanup's alignment is too large.");
279
72
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
72
    Cleanup *Obj = new (Buffer) T(A...);
281
72
    (void) Obj;
282
72
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::RegularPartialArrayDestroy, llvm::Value*, llvm::Value*, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>(clang::CodeGen::CleanupKind, llvm::Value*, llvm::Value*, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType))
Line
Count
Source
276
1.89k
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
1.89k
    static_assert(alignof(T) <= ScopeStackAlignment,
278
1.89k
                  "Cleanup's alignment is too large.");
279
1.89k
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
1.89k
    Cleanup *Obj = new (Buffer) T(A...);
281
1.89k
    (void) Obj;
282
1.89k
  }
Unexecuted instantiation: CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::ConsumeARCParameter, llvm::Value*, clang::CodeGen::ARCPreciseLifetime_t>(clang::CodeGen::CleanupKind, llvm::Value*, clang::CodeGen::ARCPreciseLifetime_t)
CGException.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::FreeException, llvm::Value*>(clang::CodeGen::CleanupKind, llvm::Value*)
Line
Count
Source
276
456
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
456
    static_assert(alignof(T) <= ScopeStackAlignment,
278
456
                  "Cleanup's alignment is too large.");
279
456
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
456
    Cleanup *Obj = new (Buffer) T(A...);
281
456
    (void) Obj;
282
456
  }
CGException.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::PerformFinally, clang::Stmt const*, llvm::AllocaInst*, llvm::FunctionCallee, llvm::FunctionCallee, llvm::AllocaInst*>(clang::CodeGen::CleanupKind, clang::Stmt const*, llvm::AllocaInst*, llvm::FunctionCallee, llvm::FunctionCallee, llvm::AllocaInst*)
Line
Count
Source
276
11
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
11
    static_assert(alignof(T) <= ScopeStackAlignment,
278
11
                  "Cleanup's alignment is too large.");
279
11
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
11
    Cleanup *Obj = new (Buffer) T(A...);
281
11
    (void) Obj;
282
11
  }
CGException.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallEndCatchForFinally, llvm::Value*, llvm::FunctionCallee>(clang::CodeGen::CleanupKind, llvm::Value*, llvm::FunctionCallee)
Line
Count
Source
276
9
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
9
    static_assert(alignof(T) <= ScopeStackAlignment,
278
9
                  "Cleanup's alignment is too large.");
279
9
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
9
    Cleanup *Obj = new (Buffer) T(A...);
281
9
    (void) Obj;
282
9
  }
CGException.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::PerformSEHFinally, llvm::Function*>(clang::CodeGen::CleanupKind, llvm::Function*)
Line
Count
Source
276
82
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
82
    static_assert(alignof(T) <= ScopeStackAlignment,
278
82
                  "Cleanup's alignment is too large.");
279
82
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
82
    Cleanup *Obj = new (Buffer) T(A...);
281
82
    (void) Obj;
282
82
  }
CGExprCXX.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallArrayDelete, llvm::Value*, clang::FunctionDecl const*, llvm::Value*, clang::QualType, clang::CharUnits>(clang::CodeGen::CleanupKind, llvm::Value*, clang::FunctionDecl const*, llvm::Value*, clang::QualType, clang::CharUnits)
Line
Count
Source
276
250
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
250
    static_assert(alignof(T) <= ScopeStackAlignment,
278
250
                  "Cleanup's alignment is too large.");
279
250
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
250
    Cleanup *Obj = new (Buffer) T(A...);
281
250
    (void) Obj;
282
250
  }
CGExprCXX.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallObjectDelete, llvm::Value*, clang::FunctionDecl const*, clang::QualType>(clang::CodeGen::CleanupKind, llvm::Value*, clang::FunctionDecl const*, clang::QualType)
Line
Count
Source
276
540
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
540
    static_assert(alignof(T) <= ScopeStackAlignment,
278
540
                  "Cleanup's alignment is too large.");
279
540
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
540
    Cleanup *Obj = new (Buffer) T(A...);
281
540
    (void) Obj;
282
540
  }
CGObjC.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::DestroyIvar, llvm::Value*, clang::ObjCIvarDecl const*, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), unsigned int>(clang::CodeGen::CleanupKind, llvm::Value*, clang::ObjCIvarDecl const*, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), unsigned int)
Line
Count
Source
276
111
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
111
    static_assert(alignof(T) <= ScopeStackAlignment,
278
111
                  "Cleanup's alignment is too large.");
279
111
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
111
    Cleanup *Obj = new (Buffer) T(A...);
281
111
    (void) Obj;
282
111
  }
CGObjC.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::FinishARCDealloc>(clang::CodeGen::CleanupKind)
Line
Count
Source
276
8
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
8
    static_assert(alignof(T) <= ScopeStackAlignment,
278
8
                  "Cleanup's alignment is too large.");
279
8
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
8
    Cleanup *Obj = new (Buffer) T(A...);
281
8
    (void) Obj;
282
8
  }
CGObjC.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallObjCRelease, llvm::Value*>(clang::CodeGen::CleanupKind, llvm::Value*)
Line
Count
Source
276
282
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
282
    static_assert(alignof(T) <= ScopeStackAlignment,
278
282
                  "Cleanup's alignment is too large.");
279
282
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
282
    Cleanup *Obj = new (Buffer) T(A...);
281
282
    (void) Obj;
282
282
  }
CGObjC.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallObjCAutoreleasePoolObject, llvm::Value*>(clang::CodeGen::CleanupKind, llvm::Value*)
Line
Count
Source
276
100
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
100
    static_assert(alignof(T) <= ScopeStackAlignment,
278
100
                  "Cleanup's alignment is too large.");
279
100
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
100
    Cleanup *Obj = new (Buffer) T(A...);
281
100
    (void) Obj;
282
100
  }
CGObjC.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallObjCMRRAutoreleasePoolObject, llvm::Value*>(clang::CodeGen::CleanupKind, llvm::Value*)
Line
Count
Source
276
17
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
17
    static_assert(alignof(T) <= ScopeStackAlignment,
278
17
                  "Cleanup's alignment is too large.");
279
17
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
17
    Cleanup *Obj = new (Buffer) T(A...);
281
17
    (void) Obj;
282
17
  }
CGObjCMac.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::PerformFragileFinally, clang::Stmt const*, clang::CodeGen::Address, clang::CodeGen::Address, clang::CodeGen::Address, (anonymous namespace)::ObjCTypesHelper*>(clang::CodeGen::CleanupKind, clang::Stmt const*, clang::CodeGen::Address, clang::CodeGen::Address, clang::CodeGen::Address, (anonymous namespace)::ObjCTypesHelper*)
Line
Count
Source
276
41
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
41
    static_assert(alignof(T) <= ScopeStackAlignment,
278
41
                  "Cleanup's alignment is too large.");
279
41
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
41
    Cleanup *Obj = new (Buffer) T(A...);
281
41
    (void) Obj;
282
41
  }
CGObjCRuntime.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallObjCEndCatch, bool, llvm::FunctionCallee>(clang::CodeGen::CleanupKind, bool, llvm::FunctionCallee)
Line
Count
Source
276
176
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
176
    static_assert(alignof(T) <= ScopeStackAlignment,
278
176
                  "Cleanup's alignment is too large.");
279
176
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
176
    Cleanup *Obj = new (Buffer) T(A...);
281
176
    (void) Obj;
282
176
  }
void clang::CodeGen::EHScopeStack::pushCleanup<clang::CodeGen::CatchRetScope, llvm::CatchPadInst*>(clang::CodeGen::CleanupKind, llvm::CatchPadInst*)
Line
Count
Source
276
125
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
125
    static_assert(alignof(T) <= ScopeStackAlignment,
278
125
                  "Cleanup's alignment is too large.");
279
125
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
125
    Cleanup *Obj = new (Buffer) T(A...);
281
125
    (void) Obj;
282
125
  }
CGObjCRuntime.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallSyncExit, llvm::FunctionCallee, llvm::Value*>(clang::CodeGen::CleanupKind, llvm::FunctionCallee, llvm::Value*)
Line
Count
Source
276
7
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
7
    static_assert(alignof(T) <= ScopeStackAlignment,
278
7
                  "Cleanup's alignment is too large.");
279
7
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
7
    Cleanup *Obj = new (Buffer) T(A...);
281
7
    (void) Obj;
282
7
  }
CGOpenMPRuntime.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CleanupTy, clang::CodeGen::PrePostActionTy*>(clang::CodeGen::CleanupKind, clang::CodeGen::PrePostActionTy*)
Line
Count
Source
276
15.7k
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
15.7k
    static_assert(alignof(T) <= ScopeStackAlignment,
278
15.7k
                  "Cleanup's alignment is too large.");
279
15.7k
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
15.7k
    Cleanup *Obj = new (Buffer) T(A...);
281
15.7k
    (void) Obj;
282
15.7k
  }
CGOpenMPRuntime.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::DoacrossCleanupTy, llvm::FunctionCallee, llvm::ArrayRef<llvm::Value*> >(clang::CodeGen::CleanupKind, llvm::FunctionCallee, llvm::ArrayRef<llvm::Value*>)
Line
Count
Source
276
28
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
28
    static_assert(alignof(T) <= ScopeStackAlignment,
278
28
                  "Cleanup's alignment is too large.");
279
28
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
28
    Cleanup *Obj = new (Buffer) T(A...);
281
28
    (void) Obj;
282
28
  }
CGOpenMPRuntime.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(clang::CodeGen::CodeGenFunction&, clang::VarDecl const*)::OMPAllocateCleanupTy, llvm::FunctionCallee, unsigned int, clang::CodeGen::Address, clang::Expr*>(clang::CodeGen::CleanupKind, llvm::FunctionCallee, unsigned int, clang::CodeGen::Address, clang::Expr*)
Line
Count
Source
276
60
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
60
    static_assert(alignof(T) <= ScopeStackAlignment,
278
60
                  "Cleanup's alignment is too large.");
279
60
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
60
    Cleanup *Obj = new (Buffer) T(A...);
281
60
    (void) Obj;
282
60
  }
CGOpenMPRuntimeGPU.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<clang::CodeGen::CGOpenMPRuntimeGPU::emitFunctionProlog(clang::CodeGen::CodeGenFunction&, clang::Decl const*)::GlobalizationScope>(clang::CodeGen::CleanupKind)
Line
Count
Source
276
21
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
21
    static_assert(alignof(T) <= ScopeStackAlignment,
278
21
                  "Cleanup's alignment is too large.");
279
21
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
21
    Cleanup *Obj = new (Buffer) T(A...);
281
21
    (void) Obj;
282
21
  }
Unexecuted instantiation: void clang::CodeGen::EHScopeStack::pushCleanup<clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::OMPAllocateCleanupTy, llvm::CallInst*>(clang::CodeGen::CleanupKind, llvm::CallInst*)
ItaniumCXXABI.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallEndCatch, bool>(clang::CodeGen::CleanupKind, bool)
Line
Count
Source
276
352
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
352
    static_assert(alignof(T) <= ScopeStackAlignment,
278
352
                  "Cleanup's alignment is too large.");
279
352
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
352
    Cleanup *Obj = new (Buffer) T(A...);
281
352
    (void) Obj;
282
352
  }
ItaniumCXXABI.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallGuardAbort, llvm::GlobalVariable*>(clang::CodeGen::CleanupKind, llvm::GlobalVariable*)
Line
Count
Source
276
174
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
174
    static_assert(alignof(T) <= ScopeStackAlignment,
278
174
                  "Cleanup's alignment is too large.");
279
174
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
174
    Cleanup *Obj = new (Buffer) T(A...);
281
174
    (void) Obj;
282
174
  }
MicrosoftCXXABI.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::ResetGuardBit, clang::CodeGen::ConstantAddress, unsigned int>(clang::CodeGen::CleanupKind, clang::CodeGen::ConstantAddress, unsigned int)
Line
Count
Source
276
58
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
58
    static_assert(alignof(T) <= ScopeStackAlignment,
278
58
                  "Cleanup's alignment is too large.");
279
58
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
58
    Cleanup *Obj = new (Buffer) T(A...);
281
58
    (void) Obj;
282
58
  }
MicrosoftCXXABI.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallInitThreadAbort, clang::CodeGen::ConstantAddress>(clang::CodeGen::CleanupKind, clang::CodeGen::ConstantAddress)
Line
Count
Source
276
37
  template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
277
37
    static_assert(alignof(T) <= ScopeStackAlignment,
278
37
                  "Cleanup's alignment is too large.");
279
37
    void *Buffer = pushCleanup(Kind, sizeof(T));
280
37
    Cleanup *Obj = new (Buffer) T(A...);
281
37
    (void) Obj;
282
37
  }
283
284
  /// Push a lazily-created cleanup on the stack. Tuple version.
285
  template <class T, class... As>
286
236
  void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) {
287
236
    static_assert(alignof(T) <= ScopeStackAlignment,
288
236
                  "Cleanup's alignment is too large.");
289
236
    void *Buffer = pushCleanup(Kind, sizeof(T));
290
236
    Cleanup *Obj = new (Buffer) T(std::move(A));
291
236
    (void) Obj;
292
236
  }
CGCall.cpp:void clang::CodeGen::EHScopeStack::pushCleanupTuple<clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::DestroyUnpassedArg, clang::CodeGen::Address, clang::QualType>, clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType>(clang::CodeGen::CleanupKind, std::__1::tuple<clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType>)
Line
Count
Source
286
8
  void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) {
287
8
    static_assert(alignof(T) <= ScopeStackAlignment,
288
8
                  "Cleanup's alignment is too large.");
289
8
    void *Buffer = pushCleanup(Kind, sizeof(T));
290
8
    Cleanup *Obj = new (Buffer) T(std::move(A));
291
8
    (void) Obj;
292
8
  }
void clang::CodeGen::EHScopeStack::pushCleanupTuple<clang::CodeGen::EHScopeStack::ConditionalCleanup<clang::CodeGen::CodeGenFunction::CallLifetimeEnd, clang::CodeGen::Address, llvm::Value*>, clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >(clang::CodeGen::CleanupKind, std::__1::tuple<clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >)
Line
Count
Source
286
78
  void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) {
287
78
    static_assert(alignof(T) <= ScopeStackAlignment,
288
78
                  "Cleanup's alignment is too large.");
289
78
    void *Buffer = pushCleanup(Kind, sizeof(T));
290
78
    Cleanup *Obj = new (Buffer) T(std::move(A));
291
78
    (void) Obj;
292
78
  }
CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanupTuple<clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::DestroyObject, clang::CodeGen::Address, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>, clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>(clang::CodeGen::CleanupKind, std::__1::tuple<clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType), bool>)
Line
Count
Source
286
122
  void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) {
287
122
    static_assert(alignof(T) <= ScopeStackAlignment,
288
122
                  "Cleanup's alignment is too large.");
289
122
    void *Buffer = pushCleanup(Kind, sizeof(T));
290
122
    Cleanup *Obj = new (Buffer) T(std::move(A));
291
122
    (void) Obj;
292
122
  }
Unexecuted instantiation: CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanupTuple<clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::IrregularPartialArrayDestroy, llvm::Value*, clang::CodeGen::Address, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > >, clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>(clang::CodeGen::CleanupKind, std::__1::tuple<llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > >, clang::CodeGen::DominatingValue<clang::CodeGen::Address>::saved_type, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>)
Unexecuted instantiation: CGDecl.cpp:void clang::CodeGen::EHScopeStack::pushCleanupTuple<clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::RegularPartialArrayDestroy, llvm::Value*, llvm::Value*, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > >, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > >, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>(clang::CodeGen::CleanupKind, std::__1::tuple<llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > >, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > >, clang::QualType, clang::CharUnits, void (*)(clang::CodeGen::CodeGenFunction&, clang::CodeGen::Address, clang::QualType)>)
CGException.cpp:void clang::CodeGen::EHScopeStack::pushCleanupTuple<clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::FreeException, llvm::Value*>, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >(clang::CodeGen::CleanupKind, std::__1::tuple<llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >)
Line
Count
Source
286
13
  void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) {
287
13
    static_assert(alignof(T) <= ScopeStackAlignment,
288
13
                  "Cleanup's alignment is too large.");
289
13
    void *Buffer = pushCleanup(Kind, sizeof(T));
290
13
    Cleanup *Obj = new (Buffer) T(std::move(A));
291
13
    (void) Obj;
292
13
  }
CGObjC.cpp:void clang::CodeGen::EHScopeStack::pushCleanupTuple<clang::CodeGen::EHScopeStack::ConditionalCleanup<(anonymous namespace)::CallObjCRelease, llvm::Value*>, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >(clang::CodeGen::CleanupKind, std::__1::tuple<llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >)
Line
Count
Source
286
15
  void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) {
287
15
    static_assert(alignof(T) <= ScopeStackAlignment,
288
15
                  "Cleanup's alignment is too large.");
289
15
    void *Buffer = pushCleanup(Kind, sizeof(T));
290
15
    Cleanup *Obj = new (Buffer) T(std::move(A));
291
15
    (void) Obj;
292
15
  }
293
294
  // Feel free to add more variants of the following:
295
296
  /// Push a cleanup with non-constant storage requirements on the
297
  /// stack.  The cleanup type must provide an additional static method:
298
  ///   static size_t getExtraSize(size_t);
299
  /// The argument to this method will be the value N, which will also
300
  /// be passed as the first argument to the constructor.
301
  ///
302
  /// The data stored in the extra storage must obey the same
303
  /// restrictions as normal cleanup member data.
304
  ///
305
  /// The pointer returned from this method is valid until the cleanup
306
  /// stack is modified.
307
  template <class T, class... As>
308
837
  T *pushCleanupWithExtra(CleanupKind Kind, size_t N, As... A) {
309
837
    static_assert(alignof(T) <= ScopeStackAlignment,
310
837
                  "Cleanup's alignment is too large.");
311
837
    void *Buffer = pushCleanup(Kind, sizeof(T) + T::getExtraSize(N));
312
837
    return new (Buffer) T(N, A...);
313
837
  }
CGExprCXX.cpp:(anonymous namespace)::CallDeleteDuringNew<EnterNewDeleteCleanup(clang::CodeGen::CodeGenFunction&, clang::CXXNewExpr const*, clang::CodeGen::Address, llvm::Value*, clang::CharUnits, clang::CodeGen::CallArgList const&)::DirectCleanupTraits>* clang::CodeGen::EHScopeStack::pushCleanupWithExtra<(anonymous namespace)::CallDeleteDuringNew<EnterNewDeleteCleanup(clang::CodeGen::CodeGenFunction&, clang::CXXNewExpr const*, clang::CodeGen::Address, llvm::Value*, clang::CharUnits, clang::CodeGen::CallArgList const&)::DirectCleanupTraits>, clang::FunctionDecl*, llvm::Value*, llvm::Value*, bool, clang::CharUnits>(clang::CodeGen::CleanupKind, unsigned long, clang::FunctionDecl*, llvm::Value*, llvm::Value*, bool, clang::CharUnits)
Line
Count
Source
308
831
  T *pushCleanupWithExtra(CleanupKind Kind, size_t N, As... A) {
309
831
    static_assert(alignof(T) <= ScopeStackAlignment,
310
831
                  "Cleanup's alignment is too large.");
311
831
    void *Buffer = pushCleanup(Kind, sizeof(T) + T::getExtraSize(N));
312
831
    return new (Buffer) T(N, A...);
313
831
  }
CGExprCXX.cpp:(anonymous namespace)::CallDeleteDuringNew<EnterNewDeleteCleanup(clang::CodeGen::CodeGenFunction&, clang::CXXNewExpr const*, clang::CodeGen::Address, llvm::Value*, clang::CharUnits, clang::CodeGen::CallArgList const&)::ConditionalCleanupTraits>* clang::CodeGen::EHScopeStack::pushCleanupWithExtra<(anonymous namespace)::CallDeleteDuringNew<EnterNewDeleteCleanup(clang::CodeGen::CodeGenFunction&, clang::CXXNewExpr const*, clang::CodeGen::Address, llvm::Value*, clang::CharUnits, clang::CodeGen::CallArgList const&)::ConditionalCleanupTraits>, clang::FunctionDecl*, clang::CodeGen::DominatingValue<clang::CodeGen::RValue>::saved_type, clang::CodeGen::DominatingValue<clang::CodeGen::RValue>::saved_type, bool, clang::CharUnits>(clang::CodeGen::CleanupKind, unsigned long, clang::FunctionDecl*, clang::CodeGen::DominatingValue<clang::CodeGen::RValue>::saved_type, clang::CodeGen::DominatingValue<clang::CodeGen::RValue>::saved_type, bool, clang::CharUnits)
Line
Count
Source
308
6
  T *pushCleanupWithExtra(CleanupKind Kind, size_t N, As... A) {
309
6
    static_assert(alignof(T) <= ScopeStackAlignment,
310
6
                  "Cleanup's alignment is too large.");
311
6
    void *Buffer = pushCleanup(Kind, sizeof(T) + T::getExtraSize(N));
312
6
    return new (Buffer) T(N, A...);
313
6
  }
314
315
574
  void pushCopyOfCleanup(CleanupKind Kind, const void *Cleanup, size_t Size) {
316
574
    void *Buffer = pushCleanup(Kind, Size);
317
574
    std::memcpy(Buffer, Cleanup, Size);
318
574
  }
319
320
378k
  void setCGF(CodeGenFunction *inCGF) { CGF = inCGF; }
321
322
  /// Pops a cleanup scope off the stack.  This is private to CGCleanup.cpp.
323
  void popCleanup();
324
325
  /// Push a set of catch handlers on the stack.  The catch is
326
  /// uninitialized and will need to have the given number of handlers
327
  /// set on it.
328
  class EHCatchScope *pushCatch(unsigned NumHandlers);
329
330
  /// Pops a catch scope off the stack.  This is private to CGException.cpp.
331
  void popCatch();
332
333
  /// Push an exceptions filter on the stack.
334
  class EHFilterScope *pushFilter(unsigned NumFilters);
335
336
  /// Pops an exceptions filter off the stack.
337
  void popFilter();
338
339
  /// Push a terminate handler on the stack.
340
  void pushTerminate();
341
342
  /// Pops a terminate handler off the stack.
343
  void popTerminate();
344
345
  // Returns true iff the current scope is either empty or contains only
346
  // lifetime markers, i.e. no real cleanup code
347
  bool containsOnlyLifetimeMarkers(stable_iterator Old) const;
348
349
  /// Determines whether the exception-scopes stack is empty.
350
696k
  bool empty() const { return StartOfData == EndOfBuffer; }
351
352
  bool requiresLandingPad() const;
353
354
  /// Determines whether there are any normal cleanups on the stack.
355
57.4k
  bool hasNormalCleanups() const {
356
57.4k
    return InnermostNormalCleanup != stable_end();
357
57.4k
  }
358
359
  /// Returns the innermost normal cleanup on the stack, or
360
  /// stable_end() if there are no normal cleanups.
361
722k
  stable_iterator getInnermostNormalCleanup() const {
362
722k
    return InnermostNormalCleanup;
363
722k
  }
364
  stable_iterator getInnermostActiveNormalCleanup() const;
365
366
328k
  stable_iterator getInnermostEHScope() const {
367
328k
    return InnermostEHScope;
368
328k
  }
369
370
371
  /// An unstable reference to a scope-stack depth.  Invalidated by
372
  /// pushes but not pops.
373
  class iterator;
374
375
  /// Returns an iterator pointing to the innermost EH scope.
376
  iterator begin() const;
377
378
  /// Returns an iterator pointing to the outermost EH scope.
379
  iterator end() const;
380
381
  /// Create a stable reference to the top of the EH stack.  The
382
  /// returned reference is valid until that scope is popped off the
383
  /// stack.
384
3.54M
  stable_iterator stable_begin() const {
385
3.54M
    return stable_iterator(EndOfBuffer - StartOfData);
386
3.54M
  }
387
388
  /// Create a stable reference to the bottom of the EH stack.
389
2.23M
  static stable_iterator stable_end() {
390
2.23M
    return stable_iterator(0);
391
2.23M
  }
392
393
  /// Translates an iterator into a stable_iterator.
394
  stable_iterator stabilize(iterator it) const;
395
396
  /// Turn a stable reference to a scope depth into a unstable pointer
397
  /// to the EH stack.
398
  iterator find(stable_iterator save) const;
399
400
  /// Add a branch fixup to the current cleanup scope.
401
3.00k
  BranchFixup &addBranchFixup() {
402
3.00k
    assert(hasNormalCleanups() && "adding fixup in scope without cleanups");
403
0
    BranchFixups.push_back(BranchFixup());
404
3.00k
    return BranchFixups.back();
405
3.00k
  }
406
407
157k
  unsigned getNumBranchFixups() const { return BranchFixups.size(); }
408
3.02k
  BranchFixup &getBranchFixup(unsigned I) {
409
3.02k
    assert(I < getNumBranchFixups());
410
0
    return BranchFixups[I];
411
3.02k
  }
412
413
  /// Pops lazily-removed fixups from the end of the list.  This
414
  /// should only be called by procedures which have just popped a
415
  /// cleanup or resolved one or more fixups.
416
  void popNullFixups();
417
418
  /// Clears the branch-fixups list.  This should only be called by
419
  /// ResolveAllBranchFixups.
420
4
  void clearFixups() { BranchFixups.clear(); }
421
};
422
423
} // namespace CodeGen
424
} // namespace clang
425
426
#endif