@@ -16,7 +16,7 @@ use trans::adt;
16
16
use trans:: attributes;
17
17
use trans:: base;
18
18
use trans:: build;
19
- use trans:: common:: { self , Block , BlockAndBuilder , LandingPad } ;
19
+ use trans:: common:: { self , Block , BlockAndBuilder } ;
20
20
use trans:: debuginfo:: DebugLoc ;
21
21
use trans:: Disr ;
22
22
use trans:: foreign;
@@ -119,16 +119,14 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
119
119
if let Some ( unwind) = unwind {
120
120
let uwbcx = self . bcx ( unwind) ;
121
121
let unwind = self . make_landing_pad ( uwbcx) ;
122
- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
123
122
bcx. invoke ( drop_fn,
124
123
& [ llvalue] ,
125
124
self . llblock ( target) ,
126
125
unwind. llbb ( ) ,
127
- bundle ,
126
+ None ,
128
127
None ) ;
129
128
} else {
130
- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
131
- bcx. call ( drop_fn, & [ llvalue] , bundle, None ) ;
129
+ bcx. call ( drop_fn, & [ llvalue] , None , None ) ;
132
130
bcx. br ( self . llblock ( target) ) ;
133
131
}
134
132
}
@@ -190,28 +188,26 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
190
188
let cleanup = self . bcx ( cleanup) ;
191
189
let landingpad = self . make_landing_pad ( cleanup) ;
192
190
let unreachable_blk = self . unreachable_block ( ) ;
193
- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
194
191
bcx. invoke ( callee. immediate ( ) ,
195
192
& llargs[ ..] ,
196
193
unreachable_blk. llbb ,
197
194
landingpad. llbb ( ) ,
198
- bundle ,
195
+ None ,
199
196
Some ( attrs) ) ;
200
197
} ,
201
198
( false , false , & Some ( cleanup) , & Some ( ( _, success) ) ) => {
202
199
let cleanup = self . bcx ( cleanup) ;
203
200
let landingpad = self . make_landing_pad ( cleanup) ;
204
201
let ( target, postinvoke) = if must_copy_dest {
205
- ( bcx. fcx ( ) . new_block ( "" , None , None ) . build ( ) , Some ( self . bcx ( success) ) )
202
+ ( bcx. fcx ( ) . new_block ( "" , None ) . build ( ) , Some ( self . bcx ( success) ) )
206
203
} else {
207
204
( self . bcx ( success) , None )
208
205
} ;
209
- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
210
206
let invokeret = bcx. invoke ( callee. immediate ( ) ,
211
207
& llargs[ ..] ,
212
208
target. llbb ( ) ,
213
209
landingpad. llbb ( ) ,
214
- bundle ,
210
+ None ,
215
211
Some ( attrs) ) ;
216
212
if let Some ( postinvoketarget) = postinvoke {
217
213
// We translate the copy into a temporary block. The temporary block is
@@ -247,15 +243,13 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
247
243
}
248
244
} ,
249
245
( false , _, _, & None ) => {
250
- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
251
- bcx. call ( callee. immediate ( ) , & llargs[ ..] , bundle, Some ( attrs) ) ;
246
+ bcx. call ( callee. immediate ( ) , & llargs[ ..] , None , Some ( attrs) ) ;
252
247
bcx. unreachable ( ) ;
253
248
}
254
249
( false , _, _, & Some ( ( _, target) ) ) => {
255
- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
256
250
let llret = bcx. call ( callee. immediate ( ) ,
257
251
& llargs[ ..] ,
258
- bundle ,
252
+ None ,
259
253
Some ( attrs) ) ;
260
254
if must_copy_dest {
261
255
let ( ret_dest, ret_ty) = ret_dest_ty
@@ -294,40 +288,35 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
294
288
slot
295
289
} else {
296
290
let llretty = Type :: struct_ ( ccx, & [ Type :: i8p ( ccx) , Type :: i32 ( ccx) ] , false ) ;
297
- let slot = bcx. with_block ( |bcx| {
298
- base:: alloca ( bcx, llretty, "personalityslot" )
299
- } ) ;
300
- self . llpersonalityslot = Some ( slot) ;
301
291
bcx. with_block ( |bcx| {
292
+ let slot = base:: alloca ( bcx, llretty, "personalityslot" ) ;
293
+ self . llpersonalityslot = Some ( slot) ;
302
294
base:: call_lifetime_start ( bcx, slot) ;
303
- } ) ;
304
- slot
295
+ slot
296
+ } )
305
297
}
306
298
}
307
299
308
300
fn make_landing_pad ( & mut self ,
309
301
cleanup : BlockAndBuilder < ' bcx , ' tcx > )
310
302
-> BlockAndBuilder < ' bcx , ' tcx >
311
303
{
312
- let cleanup_llbb = cleanup. llbb ( ) ;
313
- let bcx = cleanup. map_block ( |cleanup| {
314
- // FIXME(#30941) this doesn't handle msvc-style exceptions
315
- cleanup. fcx . new_block ( "cleanup" , None , Some ( LandingPad :: gnu ( ) ) )
316
- } ) ;
304
+ // FIXME(#30941) this doesn't handle msvc-style exceptions
305
+ let bcx = self . fcx . new_block ( "cleanup" , None ) . build ( ) ;
317
306
let ccx = bcx. ccx ( ) ;
318
- let llpersonality = bcx . fcx ( ) . eh_personality ( ) ;
307
+ let llpersonality = self . fcx . eh_personality ( ) ;
319
308
let llretty = Type :: struct_ ( ccx, & [ Type :: i8p ( ccx) , Type :: i32 ( ccx) ] , false ) ;
320
- let llretval = bcx. landing_pad ( llretty, llpersonality, 1 , bcx . fcx ( ) . llfn ) ;
309
+ let llretval = bcx. landing_pad ( llretty, llpersonality, 1 , self . fcx . llfn ) ;
321
310
bcx. set_cleanup ( llretval) ;
322
311
let slot = self . get_personality_slot ( & bcx) ;
323
312
bcx. store ( llretval, slot) ;
324
- bcx. br ( cleanup_llbb ) ;
313
+ bcx. br ( cleanup . llbb ( ) ) ;
325
314
bcx
326
315
}
327
316
328
317
fn unreachable_block ( & mut self ) -> Block < ' bcx , ' tcx > {
329
318
self . unreachable_block . unwrap_or_else ( || {
330
- let bl = self . fcx . new_block ( "unreachable" , None , None ) ;
319
+ let bl = self . fcx . new_block ( "unreachable" , None ) ;
331
320
bl. build ( ) . unreachable ( ) ;
332
321
self . unreachable_block = Some ( bl) ;
333
322
bl
0 commit comments