@@ -16,7 +16,7 @@ use trans::adt;
1616use trans:: attributes;
1717use trans:: base;
1818use trans:: build;
19- use trans:: common:: { self , Block , BlockAndBuilder , LandingPad } ;
19+ use trans:: common:: { self , Block , BlockAndBuilder } ;
2020use trans:: debuginfo:: DebugLoc ;
2121use trans:: Disr ;
2222use trans:: foreign;
@@ -119,16 +119,14 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
119119 if let Some ( unwind) = unwind {
120120 let uwbcx = self . bcx ( unwind) ;
121121 let unwind = self . make_landing_pad ( uwbcx) ;
122- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
123122 bcx. invoke ( drop_fn,
124123 & [ llvalue] ,
125124 self . llblock ( target) ,
126125 unwind. llbb ( ) ,
127- bundle ,
126+ None ,
128127 None ) ;
129128 } 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 ) ;
132130 bcx. br ( self . llblock ( target) ) ;
133131 }
134132 }
@@ -190,28 +188,26 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
190188 let cleanup = self . bcx ( cleanup) ;
191189 let landingpad = self . make_landing_pad ( cleanup) ;
192190 let unreachable_blk = self . unreachable_block ( ) ;
193- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
194191 bcx. invoke ( callee. immediate ( ) ,
195192 & llargs[ ..] ,
196193 unreachable_blk. llbb ,
197194 landingpad. llbb ( ) ,
198- bundle ,
195+ None ,
199196 Some ( attrs) ) ;
200197 } ,
201198 ( false , false , & Some ( cleanup) , & Some ( ( _, success) ) ) => {
202199 let cleanup = self . bcx ( cleanup) ;
203200 let landingpad = self . make_landing_pad ( cleanup) ;
204201 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) ) )
206203 } else {
207204 ( self . bcx ( success) , None )
208205 } ;
209- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
210206 let invokeret = bcx. invoke ( callee. immediate ( ) ,
211207 & llargs[ ..] ,
212208 target. llbb ( ) ,
213209 landingpad. llbb ( ) ,
214- bundle ,
210+ None ,
215211 Some ( attrs) ) ;
216212 if let Some ( postinvoketarget) = postinvoke {
217213 // We translate the copy into a temporary block. The temporary block is
@@ -247,15 +243,13 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
247243 }
248244 } ,
249245 ( 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) ) ;
252247 bcx. unreachable ( ) ;
253248 }
254249 ( false , _, _, & Some ( ( _, target) ) ) => {
255- let bundle = bcx. lpad ( ) . and_then ( |b| b. bundle ( ) ) ;
256250 let llret = bcx. call ( callee. immediate ( ) ,
257251 & llargs[ ..] ,
258- bundle ,
252+ None ,
259253 Some ( attrs) ) ;
260254 if must_copy_dest {
261255 let ( ret_dest, ret_ty) = ret_dest_ty
@@ -294,40 +288,35 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
294288 slot
295289 } else {
296290 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) ;
301291 bcx. with_block ( |bcx| {
292+ let slot = base:: alloca ( bcx, llretty, "personalityslot" ) ;
293+ self . llpersonalityslot = Some ( slot) ;
302294 base:: call_lifetime_start ( bcx, slot) ;
303- } ) ;
304- slot
295+ slot
296+ } )
305297 }
306298 }
307299
308300 fn make_landing_pad ( & mut self ,
309301 cleanup : BlockAndBuilder < ' bcx , ' tcx > )
310302 -> BlockAndBuilder < ' bcx , ' tcx >
311303 {
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 ( ) ;
317306 let ccx = bcx. ccx ( ) ;
318- let llpersonality = bcx . fcx ( ) . eh_personality ( ) ;
307+ let llpersonality = self . fcx . eh_personality ( ) ;
319308 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 ) ;
321310 bcx. set_cleanup ( llretval) ;
322311 let slot = self . get_personality_slot ( & bcx) ;
323312 bcx. store ( llretval, slot) ;
324- bcx. br ( cleanup_llbb ) ;
313+ bcx. br ( cleanup . llbb ( ) ) ;
325314 bcx
326315 }
327316
328317 fn unreachable_block ( & mut self ) -> Block < ' bcx , ' tcx > {
329318 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 ) ;
331320 bl. build ( ) . unreachable ( ) ;
332321 self . unreachable_block = Some ( bl) ;
333322 bl
0 commit comments