@@ -279,18 +279,6 @@ pub fn malloc_raw_dyn(bcx: block,
279
279
r
280
280
}
281
281
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
-
294
282
// malloc_raw: expects an unboxed type and returns a pointer to
295
283
// enough space for a box of that type. This includes a rust_opaque_box
296
284
// header.
@@ -312,8 +300,7 @@ pub fn malloc_general_dyn(bcx: block, t: ty::t, heap: heap, size: ValueRef)
312
300
-> MallocResult {
313
301
let _icx = push_ctxt ( "malloc_general" ) ;
314
302
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] ) ;
317
304
318
305
MallocResult { bcx : bcx, box : llbox, body : body }
319
306
}
@@ -1829,16 +1816,6 @@ pub fn trans_closure(ccx: @mut CrateContext,
1829
1816
set_fixed_stack_segment( fcx. llfn) ;
1830
1817
}
1831
1818
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
-
1842
1819
// Create the first basic block in the function and keep a handle on it to
1843
1820
// pass to finish_fn later.
1844
1821
let bcx_top = top_scope_block( fcx, body. info( ) ) ;
0 commit comments