/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 | 272 | 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 | 96 | 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 | 88 | static saved_type save(CodeGenFunction &CGF, type value) { return value; } |
clang::CodeGen::InvariantValue<bool>::save(clang::CodeGen::CodeGenFunction&, bool) Line | Count | Source | 59 | 88 | static saved_type save(CodeGenFunction &CGF, type value) { return value; } |
Unexecuted instantiation: clang::CodeGen::InvariantValue<clang::CharUnits>::save(clang::CodeGen::CodeGenFunction&, clang::CharUnits) |
60 | 409 | 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 | 139 | 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 | 135 | static type restore(CodeGenFunction &CGF, saved_type value) { return value; } |
clang::CodeGen::InvariantValue<bool>::restore(clang::CodeGen::CodeGenFunction&, bool) Line | Count | Source | 60 | 135 | 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.16M | stable_iterator(ptrdiff_t Size) : Size(Size) {} |
108 | | |
109 | | public: |
110 | 154 | static stable_iterator invalid() { return stable_iterator(-1); } |
111 | 3.66M | stable_iterator() : Size(-1) {} |
112 | | |
113 | 1.20M | 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 | 185k | 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 | 57.8k | bool strictlyEncloses(stable_iterator I) const { return Size < I.Size; } |
125 | | |
126 | 193k | friend bool operator==(stable_iterator A, stable_iterator B) { |
127 | 193k | return A.Size == B.Size; |
128 | 193k | } |
129 | 1.99M | friend bool operator!=(stable_iterator A, stable_iterator B) { |
130 | 1.99M | return A.Size != B.Size; |
131 | 1.99M | } |
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 | 48.8k | 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 | 43.6k | Flags() : flags(0) {} |
167 | | |
168 | | /// isForEH - true if the current emission is for an EH cleanup. |
169 | 21.5k | bool isForEHCleanup() const { return flags & F_IsForEH; } |
170 | 21.2k | bool isForNormalCleanup() const { return !isForEHCleanup(); } |
171 | 7.47k | void setIsForEHCleanup() { flags |= F_IsForEH; } |
172 | | |
173 | 0 | bool isNormalCleanupKind() const { return flags & F_IsNormalCleanupKind; } |
174 | 42.4k | 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 | 18.9k | void setIsEHCleanupKind() { flags |= F_IsEHCleanupKind; } |
180 | | |
181 | 82 | bool hasExitSwitch() const { return flags & F_HasExitSwitch; } |
182 | 605 | 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 | 207 | 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 | 207 | return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...}; |
206 | 207 | } 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 | 51 | 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 | 51 | return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...}; | 206 | 51 | } |
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 | 135 | 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 | 135 | return T{DominatingValue<As>::restore(CGF, std::get<Is>(Saved))...}; | 206 | 135 | } |
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 | 207 | void Emit(CodeGenFunction &CGF, Flags flags) override { |
209 | 207 | restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags); |
210 | 207 | } 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 | 51 | void Emit(CodeGenFunction &CGF, Flags flags) override { | 209 | 51 | restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags); | 210 | 51 | } |
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 | 135 | void Emit(CodeGenFunction &CGF, Flags flags) override { | 209 | 135 | restore(CGF, std::index_sequence_for<As...>()).Emit(CGF, flags); | 210 | 135 | } |
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 | 171 | 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 | 47 | 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 | 88 | 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 | 315k | CGF(nullptr) {} |
273 | 315k | ~EHScopeStack() { delete[] StartOfBuffer; } |
274 | | |
275 | | /// Push a lazily-created cleanup on the stack. |
276 | 47.0k | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { |
277 | 47.0k | static_assert(alignof(T) <= ScopeStackAlignment, |
278 | 47.0k | "Cleanup's alignment is too large."); |
279 | 47.0k | void *Buffer = pushCleanup(Kind, sizeof(T)); |
280 | 47.0k | Cleanup *Obj = new (Buffer) T(A...); |
281 | 47.0k | (void) Obj; |
282 | 47.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 | 527 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 527 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 527 | "Cleanup's alignment is too large."); | 279 | 527 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 527 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 527 | (void) Obj; | 282 | 527 | } |
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 | 178 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 178 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 178 | "Cleanup's alignment is too large."); | 279 | 178 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 178 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 178 | (void) Obj; | 282 | 178 | } |
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 | 4.70k | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 4.70k | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 4.70k | "Cleanup's alignment is too large."); | 279 | 4.70k | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 4.70k | Cleanup *Obj = new (Buffer) T(A...); | 281 | 4.70k | (void) Obj; | 282 | 4.70k | } |
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 | 929 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 929 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 929 | "Cleanup's alignment is too large."); | 279 | 929 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 929 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 929 | (void) Obj; | 282 | 929 | } |
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::SanitizeDtorFieldRange, clang::CXXDestructorDecl const*, unsigned int, unsigned int>(clang::CodeGen::CleanupKind, clang::CXXDestructorDecl const*, unsigned int, unsigned int) Line | Count | Source | 276 | 40 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 40 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 40 | "Cleanup's alignment is too large."); | 279 | 40 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 40 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 40 | (void) Obj; | 282 | 40 | } |
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::SanitizeDtorFieldRange, clang::CXXDestructorDecl const*, unsigned int, int>(clang::CodeGen::CleanupKind, clang::CXXDestructorDecl const*, unsigned int, int) Line | Count | Source | 276 | 74 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 74 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 74 | "Cleanup's alignment is too large."); | 279 | 74 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 74 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 74 | (void) Obj; | 282 | 74 | } |
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallDtorDeleteConditional, llvm::Value*>(clang::CodeGen::CleanupKind, llvm::Value*) Line | Count | Source | 276 | 205 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 205 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 205 | "Cleanup's alignment is too large."); | 279 | 205 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 205 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 205 | (void) Obj; | 282 | 205 | } |
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallDtorDelete>(clang::CodeGen::CleanupKind) Line | Count | Source | 276 | 629 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 629 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 629 | "Cleanup's alignment is too large."); | 279 | 629 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 629 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 629 | (void) Obj; | 282 | 629 | } |
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)::SanitizeDtorTrivialBase, clang::CXXRecordDecl*, bool>(clang::CodeGen::CleanupKind, clang::CXXRecordDecl*, bool) Line | Count | Source | 276 | 2 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 2 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 2 | "Cleanup's alignment is too large."); | 279 | 2 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 2 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 2 | (void) Obj; | 282 | 2 | } |
CGClass.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallBaseDtor, clang::CXXRecordDecl*, bool>(clang::CodeGen::CleanupKind, clang::CXXRecordDecl*, bool) Line | Count | Source | 276 | 1.18k | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 1.18k | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 1.18k | "Cleanup's alignment is too large."); | 279 | 1.18k | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 1.18k | Cleanup *Obj = new (Buffer) T(A...); | 281 | 1.18k | (void) Obj; | 282 | 1.18k | } |
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.04k | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 1.04k | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 1.04k | "Cleanup's alignment is too large."); | 279 | 1.04k | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 1.04k | Cleanup *Obj = new (Buffer) T(A...); | 281 | 1.04k | (void) Obj; | 282 | 1.04k | } |
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 | 63 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 63 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 63 | "Cleanup's alignment is too large."); | 279 | 63 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 63 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 63 | (void) Obj; | 282 | 63 | } |
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 | 118 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 118 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 118 | "Cleanup's alignment is too large."); | 279 | 118 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 118 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 118 | (void) Obj; | 282 | 118 | } |
CGCoroutine.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallCoroEnd>(clang::CodeGen::CleanupKind) Line | Count | Source | 276 | 118 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 118 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 118 | "Cleanup's alignment is too large."); | 279 | 118 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 118 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 118 | (void) Obj; | 282 | 118 | } |
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 | 217 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 217 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 217 | "Cleanup's alignment is too large."); | 279 | 217 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 217 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 217 | (void) Obj; | 282 | 217 | } |
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.6k | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 14.6k | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 14.6k | "Cleanup's alignment is too large."); | 279 | 14.6k | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 14.6k | Cleanup *Obj = new (Buffer) T(A...); | 281 | 14.6k | (void) Obj; | 282 | 14.6k | } |
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.60k | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 1.60k | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 1.60k | "Cleanup's alignment is too large."); | 279 | 1.60k | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 1.60k | Cleanup *Obj = new (Buffer) T(A...); | 281 | 1.60k | (void) Obj; | 282 | 1.60k | } |
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 | 78 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 78 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 78 | "Cleanup's alignment is too large."); | 279 | 78 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 78 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 78 | (void) Obj; | 282 | 78 | } |
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.90k | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 1.90k | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 1.90k | "Cleanup's alignment is too large."); | 279 | 1.90k | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 1.90k | Cleanup *Obj = new (Buffer) T(A...); | 281 | 1.90k | (void) Obj; | 282 | 1.90k | } |
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 | 648 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 648 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 648 | "Cleanup's alignment is too large."); | 279 | 648 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 648 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 648 | (void) Obj; | 282 | 648 | } |
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 | 265 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 265 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 265 | "Cleanup's alignment is too large."); | 279 | 265 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 265 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 265 | (void) Obj; | 282 | 265 | } |
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 | 535 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 535 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 535 | "Cleanup's alignment is too large."); | 279 | 535 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 535 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 535 | (void) Obj; | 282 | 535 | } |
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 | 44 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 44 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 44 | "Cleanup's alignment is too large."); | 279 | 44 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 44 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 44 | (void) Obj; | 282 | 44 | } |
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 const*>(clang::CodeGen::CleanupKind, llvm::FunctionCallee, unsigned int, clang::CodeGen::Address, clang::Expr const*) Line | Count | Source | 276 | 126 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 126 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 126 | "Cleanup's alignment is too large."); | 279 | 126 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 126 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 126 | (void) Obj; | 282 | 126 | } |
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 | 13 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 13 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 13 | "Cleanup's alignment is too large."); | 279 | 13 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 13 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 13 | (void) Obj; | 282 | 13 | } |
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 | 272 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 272 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 272 | "Cleanup's alignment is too large."); | 279 | 272 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 272 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 272 | (void) Obj; | 282 | 272 | } |
ItaniumCXXABI.cpp:void clang::CodeGen::EHScopeStack::pushCleanup<(anonymous namespace)::CallGuardAbort, llvm::GlobalVariable*>(clang::CodeGen::CleanupKind, llvm::GlobalVariable*) Line | Count | Source | 276 | 171 | template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) { | 277 | 171 | static_assert(alignof(T) <= ScopeStackAlignment, | 278 | 171 | "Cleanup's alignment is too large."); | 279 | 171 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 280 | 171 | Cleanup *Obj = new (Buffer) T(A...); | 281 | 171 | (void) Obj; | 282 | 171 | } |
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 | 171 | void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) { |
287 | 171 | static_assert(alignof(T) <= ScopeStackAlignment, |
288 | 171 | "Cleanup's alignment is too large."); |
289 | 171 | void *Buffer = pushCleanup(Kind, sizeof(T)); |
290 | 171 | Cleanup *Obj = new (Buffer) T(std::move(A)); |
291 | 171 | (void) Obj; |
292 | 171 | } 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 | 47 | void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) { | 287 | 47 | static_assert(alignof(T) <= ScopeStackAlignment, | 288 | 47 | "Cleanup's alignment is too large."); | 289 | 47 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 290 | 47 | Cleanup *Obj = new (Buffer) T(std::move(A)); | 291 | 47 | (void) Obj; | 292 | 47 | } |
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 | 88 | void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) { | 287 | 88 | static_assert(alignof(T) <= ScopeStackAlignment, | 288 | 88 | "Cleanup's alignment is too large."); | 289 | 88 | void *Buffer = pushCleanup(Kind, sizeof(T)); | 290 | 88 | Cleanup *Obj = new (Buffer) T(std::move(A)); | 291 | 88 | (void) Obj; | 292 | 88 | } |
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 | 828 | T *pushCleanupWithExtra(CleanupKind Kind, size_t N, As... A) { |
309 | 828 | static_assert(alignof(T) <= ScopeStackAlignment, |
310 | 828 | "Cleanup's alignment is too large."); |
311 | 828 | void *Buffer = pushCleanup(Kind, sizeof(T) + T::getExtraSize(N)); |
312 | 828 | return new (Buffer) T(N, A...); |
313 | 828 | } 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 | 822 | T *pushCleanupWithExtra(CleanupKind Kind, size_t N, As... A) { | 309 | 822 | static_assert(alignof(T) <= ScopeStackAlignment, | 310 | 822 | "Cleanup's alignment is too large."); | 311 | 822 | void *Buffer = pushCleanup(Kind, sizeof(T) + T::getExtraSize(N)); | 312 | 822 | return new (Buffer) T(N, A...); | 313 | 822 | } |
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 | 570 | void pushCopyOfCleanup(CleanupKind Kind, const void *Cleanup, size_t Size) { |
316 | 570 | void *Buffer = pushCleanup(Kind, Size); |
317 | 570 | std::memcpy(Buffer, Cleanup, Size); |
318 | 570 | } |
319 | | |
320 | 315k | 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 | 616k | bool empty() const { return StartOfData == EndOfBuffer; } |
351 | | |
352 | | bool requiresLandingPad() const; |
353 | | |
354 | | /// Determines whether there are any normal cleanups on the stack. |
355 | 54.0k | bool hasNormalCleanups() const { |
356 | 54.0k | return InnermostNormalCleanup != stable_end(); |
357 | 54.0k | } |
358 | | |
359 | | /// Returns the innermost normal cleanup on the stack, or |
360 | | /// stable_end() if there are no normal cleanups. |
361 | 598k | stable_iterator getInnermostNormalCleanup() const { |
362 | 598k | return InnermostNormalCleanup; |
363 | 598k | } |
364 | | stable_iterator getInnermostActiveNormalCleanup() const; |
365 | | |
366 | 317k | stable_iterator getInnermostEHScope() const { |
367 | 317k | return InnermostEHScope; |
368 | 317k | } |
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.26M | stable_iterator stable_begin() const { |
385 | 3.26M | return stable_iterator(EndOfBuffer - StartOfData); |
386 | 3.26M | } |
387 | | |
388 | | /// Create a stable reference to the bottom of the EH stack. |
389 | 1.89M | static stable_iterator stable_end() { |
390 | 1.89M | return stable_iterator(0); |
391 | 1.89M | } |
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 | 148k | 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 |