@@ -137,66 +137,11 @@ class IRGenFunction {
137
137
// --- Control flow -------------------------------------------------------------
138
138
public:
139
139
140
- // / Push a new cleanup in the current scope.
141
- template <class T , class ... A>
142
- T &pushCleanup (A &&... args) {
143
- return pushCleanupInState<T, A...>(CleanupState::Active,
144
- ::std::forward<A>(args)...);
145
- }
146
-
147
- // / Push a new cleanup in the current scope.
148
- template <class T , class ... A>
149
- T &pushCleanupInState (CleanupState state, A &&... args) {
150
- assert (state != CleanupState::Dead);
151
-
152
- #ifndef NDEBUG
153
- CleanupsDepth oldTop = Cleanups.stable_begin ();
154
- #endif
155
-
156
- T &cleanup = Cleanups.push <T, A...>(::std::forward<A>(args)...);
157
- T &result = static_cast <T&>(initCleanup (cleanup, sizeof (T), state));
158
-
159
- #ifndef NDEBUG
160
- auto newTop = Cleanups.begin (); ++newTop;
161
- assert (newTop == Cleanups.find (oldTop));
162
- #endif
163
- return result;
164
- }
165
-
166
- // / Push a new cleanup which is expected to be destroyed at the end
167
- // / of the current full-expression.
168
- // /
169
- // / The relevant property here is that full-expression cleanups may
170
- // / not be dominated by the locations in which they're active in a
171
- // / full-expression expression.
172
- template <class T , class ... A>
173
- T &pushFullExprCleanup (A &&... args) {
174
- assert (!isConditionallyEvaluated ());
175
- return pushCleanup<T, A...>(::std::forward<A>(args)...);
176
- }
177
-
178
- template <class T , class ... A>
179
- T &pushFullExprCleanupInState (CleanupState state, A &&... args) {
180
- assert (!isConditionallyEvaluated ());
181
- return pushCleanupInState<T, A...>(state, ::std::forward<A>(args)...);
182
- }
183
-
184
140
// / Return a stable reference to the current cleanup.
185
141
CleanupsDepth getCleanupsDepth () const {
186
142
return Cleanups.stable_begin ();
187
143
}
188
144
189
- // / Set the state of the cleanup at the given depth.
190
- // / The transition must be non-trivial and legal.
191
- void setCleanupState (CleanupsDepth depth, CleanupState state);
192
-
193
- Cleanup &findCleanup (CleanupsDepth depth) {
194
- assert (depth != Cleanups.stable_end ());
195
- return *Cleanups.find (depth);
196
- }
197
-
198
- void endScope (CleanupsDepth depth);
199
-
200
145
void enterDestroyCleanup (Address addr, const TypeInfo &addrTI,
201
146
Explosion &out);
202
147
@@ -219,10 +164,7 @@ class IRGenFunction {
219
164
llvm::Instruction *JumpDestSlot;
220
165
CleanupsDepth InnermostScope;
221
166
222
- friend class Cleanup ; // just so that it can befriend initCleanup
223
167
friend class Scope ;
224
- Cleanup &initCleanup (Cleanup &cleanup, size_t allocSize, CleanupState state);
225
- void setCleanupState (Cleanup &cleanup, CleanupState state);
226
168
227
169
// --- Function prologue and epilogue -------------------------------------------
228
170
public:
0 commit comments