diff options
| author | Graydon Hoare <[email protected]> | 2010-08-24 11:44:14 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-08-24 11:44:14 -0700 |
| commit | 87c9a9e25d922cd9e00981ac9a3e6fa43df20c0b (patch) | |
| tree | df4cfe231a4519cb4c59dc2f0d6759dea7fe1ba4 /src/boot/me/semant.ml | |
| parent | Shrink size of glue calls. Wins a few tens of kb on rustc. (diff) | |
| download | rust-87c9a9e25d922cd9e00981ac9a3e6fa43df20c0b.tar.xz rust-87c9a9e25d922cd9e00981ac9a3e6fa43df20c0b.zip | |
Avoid iterating ty parts on drop when there are no heap pointers in ty. Wins several tens of kb on rustc.
Diffstat (limited to 'src/boot/me/semant.ml')
| -rw-r--r-- | src/boot/me/semant.ml | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml index 7d1b21ef..f0fca1a8 100644 --- a/src/boot/me/semant.ml +++ b/src/boot/me/semant.ml @@ -947,12 +947,38 @@ let type_is_structured (t:Ast.ty) : bool = let fold = { fold with ty_fold_tup = (fun _ -> true); ty_fold_vec = (fun _ -> true); + ty_fold_str = (fun _ -> true); ty_fold_rec = (fun _ -> true); ty_fold_tag = (fun _ -> true); ty_fold_iso = (fun _ -> true); ty_fold_idx = (fun _ -> true); ty_fold_fn = (fun _ -> true); - ty_fold_obj = (fun _ -> true) } + ty_fold_obj = (fun _ -> true); + + ty_fold_chan = (fun _ -> true); + ty_fold_port = (fun _ -> true); + ty_fold_box = (fun _ -> true); + ty_fold_task = (fun _ -> true); + } + + in + fold_ty fold t +;; + + +let type_points_to_heap (t:Ast.ty) : bool = + let fold = ty_fold_bool_or false in + let fold = { fold with + ty_fold_vec = (fun _ -> true); + ty_fold_str = (fun _ -> true); + ty_fold_fn = (fun _ -> true); + ty_fold_obj = (fun _ -> true); + + ty_fold_chan = (fun _ -> true); + ty_fold_port = (fun _ -> true); + ty_fold_box = (fun _ -> true); + ty_fold_task = (fun _ -> true); + } in fold_ty fold t ;; |