@@ -279,18 +279,6 @@ pub fn malloc_raw_dyn(bcx: block,
279279 r
280280}
281281
282- /**
283- * Get the type of a box in the default address space.
284- *
285- * Shared box pointers live in address space 1 so the GC strategy can find
286- * them. Before taking a pointer to the inside of a box it should be cast into
287- * address space 0. Otherwise the resulting (non-box) pointer will be in the
288- * wrong address space and thus be the wrong type.
289- */
290- pub fn non_gc_box_cast ( _: block , val : ValueRef ) -> ValueRef {
291- val
292- }
293-
294282// malloc_raw: expects an unboxed type and returns a pointer to
295283// enough space for a box of that type. This includes a rust_opaque_box
296284// header.
@@ -312,8 +300,7 @@ pub fn malloc_general_dyn(bcx: block, t: ty::t, heap: heap, size: ValueRef)
312300 -> MallocResult {
313301 let _icx = push_ctxt ( "malloc_general" ) ;
314302 let Result { bcx : bcx, val : llbox} = malloc_raw_dyn ( bcx, t, heap, size) ;
315- let non_gc_box = non_gc_box_cast ( bcx, llbox) ;
316- let body = GEPi ( bcx, non_gc_box, [ 0 u, abi:: box_field_body] ) ;
303+ let body = GEPi ( bcx, llbox, [ 0 u, abi:: box_field_body] ) ;
317304
318305 MallocResult { bcx : bcx, box : llbox, body : body }
319306}
@@ -1829,16 +1816,6 @@ pub fn trans_closure(ccx: @mut CrateContext,
18291816 set_fixed_stack_segment( fcx. llfn) ;
18301817 }
18311818
1832- // Set GC for function.
1833- if ccx. sess. opts. gc {
1834- do str :: as_c_str( "generic") |strategy| {
1835- unsafe {
1836- llvm:: LLVMSetGC ( fcx. llfn, strategy) ;
1837- }
1838- }
1839- ccx. uses_gc = true;
1840- }
1841-
18421819 // Create the first basic block in the function and keep a handle on it to
18431820 // pass to finish_fn later.
18441821 let bcx_top = top_scope_block( fcx, body. info( ) ) ;
0 commit comments