diff options
| author | Graydon Hoare <[email protected]> | 2010-07-01 10:44:27 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-01 10:44:27 -0700 |
| commit | a7016ade65b4870e6b270dee3affa640b72c8a29 (patch) | |
| tree | 89dc8ffe497e300ff7f9c74ed0db638ac09c1451 /src/boot/me/trans.ml | |
| parent | Add STMT_init_box to typestate pass. (diff) | |
| download | rust-a7016ade65b4870e6b270dee3affa640b72c8a29.tar.xz rust-a7016ade65b4870e6b270dee3affa640b72c8a29.zip | |
Implement STMT_init_box in trans, clean up some of the semant table-accessors.
Diffstat (limited to 'src/boot/me/trans.ml')
| -rw-r--r-- | src/boot/me/trans.ml | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml index 830cf1ee..9e8cfb14 100644 --- a/src/boot/me/trans.ml +++ b/src/boot/me/trans.ml @@ -446,7 +446,7 @@ let trans_visitor in let slot_id_referent_type (slot_id:node_id) : Il.referent_ty = - slot_referent_type abi (referent_to_slot cx slot_id) + slot_referent_type abi (get_slot cx slot_id) in let caller_args_cell (args_rty:Il.referent_ty) : Il.cell = @@ -959,12 +959,11 @@ let trans_visitor in trans_slot_lval_ext base_ty base_cell comp - | Ast.LVAL_base nb -> - let slot = lval_to_slot cx nb.id in - let referent = lval_to_referent cx nb.id in - let cell = cell_of_block_slot referent in - let ty = slot_ty slot in - let cell = deref_slot initializing cell slot in + | Ast.LVAL_base _ -> + let sloti = lval_base_to_slot cx lv in + let cell = cell_of_block_slot sloti.id in + let ty = slot_ty sloti.node in + let cell = deref_slot initializing cell sloti.node in deref_ty initializing cell ty in iflog @@ -4173,6 +4172,11 @@ let trans_visitor trans_init_chan dst p end + | Ast.STMT_init_box (dst, src) -> + let sloti = lval_base_to_slot cx dst in + let cell = cell_of_block_slot sloti.id in + trans_init_slot_from_atom CLONE_none cell sloti.node src + | Ast.STMT_block block -> trans_block block |