diff options
| author | Graydon Hoare <[email protected]> | 2011-01-11 16:25:18 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-01-11 16:25:18 -0800 |
| commit | 5e9279586b56789ecf6f02535c9624e01daeee96 (patch) | |
| tree | 47af840f6e0bd1f577cfbcc357e8d6889a8e62b0 /src/boot | |
| parent | Fix another import case we got wrong: The local environment should not (diff) | |
| download | rust-5e9279586b56789ecf6f02535c9624e01daeee96.tar.xz rust-5e9279586b56789ecf6f02535c9624e01daeee96.zip | |
Make rustboot fn/obj drops generic; cuts 300kb size, 10s compile time off rustc.
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/me/trans.ml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml index 34f4d81d..9c5b5630 100644 --- a/src/boot/me/trans.ml +++ b/src/boot/me/trans.ml @@ -1936,6 +1936,22 @@ let trans_visitor and get_drop_glue (ty:Ast.ty) : fixup = + + (* obj and fn glue delegates to the body, so is always 'generic'. *) + let ty = + match ty with + Ast.TY_obj _ -> Ast.TY_obj (Ast.LAYER_value, Hashtbl.create 0) + | Ast.TY_fn _ -> + Ast.TY_fn ({ Ast.sig_input_slots = [| |]; + Ast.sig_input_constrs = [| |]; + Ast.sig_output_slot = + { Ast.slot_mode = Ast.MODE_local; + Ast.slot_ty = Some Ast.TY_nil }; }, + { Ast.fn_is_iter = false; + Ast.fn_effect = Ast.EFF_pure }) + | _ -> ty + in + let g = GLUE_drop ty in let inner _ (args:Il.cell) = let ty_params = deref (get_element_ptr args 0) in |