diff options
| author | Patrick Walton <[email protected]> | 2010-07-15 15:20:04 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-07-15 15:20:04 -0700 |
| commit | 0b675a021a73a3dfa09079790a50302aeb6d1616 (patch) | |
| tree | 9bea8d18f02105844d05170450238ad19a7a0666 /src/boot/me | |
| parent | Correct the way we get typarams when dropping an obj type in drop_ty by using... (diff) | |
| download | rust-0b675a021a73a3dfa09079790a50302aeb6d1616.tar.xz rust-0b675a021a73a3dfa09079790a50302aeb6d1616.zip | |
Make mutability no longer a type constructor
Diffstat (limited to 'src/boot/me')
| -rw-r--r-- | src/boot/me/alias.ml | 2 | ||||
| -rw-r--r-- | src/boot/me/semant.ml | 4 | ||||
| -rw-r--r-- | src/boot/me/trans.ml | 13 | ||||
| -rw-r--r-- | src/boot/me/type.ml | 10 | ||||
| -rw-r--r-- | src/boot/me/typestate.ml | 8 | ||||
| -rw-r--r-- | src/boot/me/walk.ml | 8 |
6 files changed, 23 insertions, 22 deletions
diff --git a/src/boot/me/alias.ml b/src/boot/me/alias.ml index f8b82c12..148f1249 100644 --- a/src/boot/me/alias.ml +++ b/src/boot/me/alias.ml @@ -67,7 +67,7 @@ let alias_analysis_visitor | Ast.STMT_recv (dst, _) -> alias dst | Ast.STMT_init_port (dst) -> alias dst | Ast.STMT_init_chan (dst, _) -> alias dst - | Ast.STMT_init_vec (dst, _) -> alias dst + | Ast.STMT_init_vec (dst, _, _) -> alias dst | Ast.STMT_init_str (dst, _) -> alias dst | Ast.STMT_for_each sfe -> let (slot, _) = sfe.Ast.for_each_slot in diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml index 7b18a5bc..434fb025 100644 --- a/src/boot/me/semant.ml +++ b/src/boot/me/semant.ml @@ -583,13 +583,13 @@ let atoms_slots (cx:ctxt) (az:Ast.atom array) : node_id array = ;; let tup_inputs_slots (cx:ctxt) (az:Ast.tup_input array) : node_id array = - Array.concat (List.map (atom_slots cx) (Array.to_list az)) + Array.concat (List.map (atom_slots cx) (Array.to_list (Array.map snd az))) ;; let rec_inputs_slots (cx:ctxt) (inputs:Ast.rec_input array) : node_id array = Array.concat (List.map - (fun (_, atom) -> atom_slots cx atom) + (fun (_, _, atom) -> atom_slots cx atom) (Array.to_list inputs)) ;; diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml index 6d5678d3..46329a10 100644 --- a/src/boot/me/trans.ml +++ b/src/boot/me/trans.ml @@ -3244,13 +3244,13 @@ let trans_visitor (dst:Il.cell) (dst_tys:Ast.ty array) (trec:Ast.ty_rec) - (atab:(Ast.ident * Ast.atom) array) + (atab:(Ast.ident * Ast.mutability * Ast.atom) array) (base:Ast.lval) : unit = Array.iteri begin fun i (fml_ident, _) -> - let fml_entry _ (act_ident, atom) = + let fml_entry _ (act_ident, _, atom) = if act_ident = fml_ident then Some atom else None in let dst_ty = dst_tys.(i) in @@ -4315,7 +4315,7 @@ let trans_visitor begin match base with None -> - let atoms = Array.map snd atab in + let atoms = Array.map (fun (_, _, atom) -> atom) atab in trans_init_structural_from_atoms dst_cell dst_tys atoms | Some base_lval -> @@ -4323,7 +4323,7 @@ let trans_visitor dst_cell dst_tys trec atab base_lval end - | Ast.STMT_init_tup (dst, atoms) -> + | Ast.STMT_init_tup (dst, elems) -> let (slot_cell, ty) = trans_lval_init dst in let dst_tys = match ty with @@ -4332,6 +4332,7 @@ let trans_visitor bugi cx stmt.id "non-tup destination type in stmt_init_tup" in + let atoms = Array.map snd elems in let (dst_cell, _) = deref_ty DEREF_none true slot_cell ty in trans_init_structural_from_atoms dst_cell dst_tys atoms @@ -4339,7 +4340,7 @@ let trans_visitor | Ast.STMT_init_str (dst, s) -> trans_init_str dst s - | Ast.STMT_init_vec (dst, atoms) -> + | Ast.STMT_init_vec (dst, _, atoms) -> trans_init_vec dst atoms | Ast.STMT_init_port dst -> @@ -4357,7 +4358,7 @@ let trans_visitor trans_init_chan dst p end - | Ast.STMT_init_box (dst, src) -> + | Ast.STMT_init_box (dst, _, src) -> trans_init_box dst src | Ast.STMT_block block -> diff --git a/src/boot/me/type.ml b/src/boot/me/type.ml index 9110743b..45570708 100644 --- a/src/boot/me/type.ml +++ b/src/boot/me/type.ml @@ -1144,7 +1144,7 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit = | Ast.STMT_init_rec (dst, fields, Some base) -> let dct = Hashtbl.create 10 in let tvrec = ref (TYSPEC_record dct) in - let add_field (ident, atom) = + let add_field (ident, _, atom) = let tv = any() in unify_atom arg_pass_ctx atom tv; Hashtbl.add dct ident tv @@ -1157,7 +1157,7 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit = | Ast.STMT_init_rec (dst, fields, None) -> let dct = Hashtbl.create 10 in - let add_field (ident, atom) = + let add_field (ident, _, atom) = let tv = any() in unify_atom arg_pass_ctx atom tv; Hashtbl.add dct ident tv @@ -1166,7 +1166,7 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit = unify_lval init_ctx dst (ref (TYSPEC_record dct)) | Ast.STMT_init_tup (dst, members) -> - let member_to_tv atom = + let member_to_tv (_, atom) = let tv = any() in unify_atom arg_pass_ctx atom tv; tv @@ -1174,7 +1174,7 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit = let member_tvs = Array.map member_to_tv members in unify_lval init_ctx dst (ref (TYSPEC_tuple member_tvs)) - | Ast.STMT_init_vec (dst, atoms) -> + | Ast.STMT_init_vec (dst, _, atoms) -> let tv = any() in let unify_with_tv atom = unify_atom arg_pass_ctx atom tv in Array.iter unify_with_tv atoms; @@ -1304,7 +1304,7 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit = | Ast.STMT_join lval -> unify_lval rval_ctx lval (ty Ast.TY_task); - | Ast.STMT_init_box (dst, v) -> + | Ast.STMT_init_box (dst, _, v) -> let in_tv = any() in let tv = ref (TYSPEC_mutable (ref (TYSPEC_box in_tv))) in unify_lval strict_ctx dst tv; diff --git a/src/boot/me/typestate.ml b/src/boot/me/typestate.ml index b935864f..cca548b8 100644 --- a/src/boot/me/typestate.ml +++ b/src/boot/me/typestate.ml @@ -434,7 +434,7 @@ let condition_assigning_visitor raise_pre_post_cond s.id precond; raise_postcondition s.id postcond - | Ast.STMT_init_vec (dst, atoms) -> + | Ast.STMT_init_vec (dst, _, atoms) -> let precond = slot_inits (atoms_slots cx atoms) in let postcond = slot_inits (lval_slots cx dst) in raise_pre_post_cond s.id precond; @@ -454,7 +454,7 @@ let condition_assigning_visitor raise_pre_post_cond s.id precond; raise_postcondition s.id postcond - | Ast.STMT_init_box (dst, src) -> + | Ast.STMT_init_box (dst, _, src) -> let precond = slot_inits (atom_slots cx src) in let postcond = slot_inits (lval_slots cx dst) in raise_pre_post_cond s.id precond; @@ -1106,11 +1106,11 @@ let lifecycle_visitor | Ast.STMT_init_rec (lv_dst, _, _) | Ast.STMT_init_tup (lv_dst, _) - | Ast.STMT_init_vec (lv_dst, _) + | Ast.STMT_init_vec (lv_dst, _, _) | Ast.STMT_init_str (lv_dst, _) | Ast.STMT_init_port lv_dst | Ast.STMT_init_chan (lv_dst, _) - | Ast.STMT_init_box (lv_dst, _) -> + | Ast.STMT_init_box (lv_dst, _, _) -> init_lval lv_dst | Ast.STMT_for f -> diff --git a/src/boot/me/walk.ml b/src/boot/me/walk.ml index bb774c01..fac44170 100644 --- a/src/boot/me/walk.ml +++ b/src/boot/me/walk.ml @@ -386,16 +386,16 @@ and walk_stmt | Ast.STMT_init_rec (lv, atab, base) -> walk_lval v lv; - Array.iter (fun (_, a) -> walk_atom v a) atab; + Array.iter (fun (_, _, a) -> walk_atom v a) atab; walk_option (walk_lval v) base; - | Ast.STMT_init_vec (lv, atoms) -> + | Ast.STMT_init_vec (lv, _, atoms) -> walk_lval v lv; Array.iter (walk_atom v) atoms | Ast.STMT_init_tup (lv, mut_atoms) -> walk_lval v lv; - Array.iter (walk_atom v) mut_atoms + Array.iter (fun (_, atom) -> walk_atom v atom) mut_atoms | Ast.STMT_init_str (lv, _) -> walk_lval v lv @@ -407,7 +407,7 @@ and walk_stmt walk_option (walk_lval v) port; walk_lval v chan; - | Ast.STMT_init_box (dst, src) -> + | Ast.STMT_init_box (dst, _, src) -> walk_lval v dst; walk_atom v src |