Some fixme-to-issue housekeeping.

This commit is contained in:
Graydon Hoare 2010-06-28 09:39:43 -07:00
parent e1f6749f9a
commit d608c09168
14 changed files with 117 additions and 113 deletions

View File

@ -1246,7 +1246,8 @@ let fn_prologue
(* Zero the frame.
*
* FIXME: this is awful, will go away when we have proper CFI.
* FIXME (ssue 27): this is awful, will go away when we have proper
* CFI.
*)
mov (rc edi) (ro esp);

View File

@ -12,7 +12,7 @@ let iflog (sess:Session.sess) (thunk:(unit -> unit)) : unit =
else ()
;;
(* FIXME: move these to sess. *)
(* FIXME (issue #67): move these to sess. *)
let ar_cache = Hashtbl.create 0 ;;
let sects_cache = Hashtbl.create 0;;
let meta_cache = Hashtbl.create 0;;
@ -138,7 +138,7 @@ let get_mod
then true
else
match meta.(i) with
(* FIXME: bind the wildcards. *)
(* FIXME (issue #68): bind the wildcards. *)
(_, None) -> meta_matches (i+1) f_meta
| (k, Some v) ->
match atab_search f_meta k with

View File

@ -9,7 +9,7 @@ let _ =
let (targ:Common.target) =
match Sys.os_type with
"Unix" ->
(* FIXME: this is an absurd heuristic. *)
(* FIXME (issue #69): this is an absurd heuristic. *)
if Sys.file_exists "/System/Library"
then MacOS_x86_macho
else Linux_x86_elf
@ -26,7 +26,9 @@ let (sess:Session.sess) =
Session.sess_out = None;
Session.sess_library_mode = false;
Session.sess_alt_backend = false;
(* FIXME: need something fancier here for unix sub-flavours. *)
(* FIXME (issue #69): need something fancier here for unix
* sub-flavours.
*)
Session.sess_targ = targ;
Session.sess_log_lex = false;
Session.sess_log_parse = false;

View File

@ -325,7 +325,7 @@ let unexpected_val (expected:string) (v:pval) =
| PVAL_num i -> "num " ^ (Int64.to_string i)
| PVAL_bool b -> if b then "bool true" else "bool false"
in
(* FIXME: proper error reporting, please. *)
(* FIXME (issue #70): proper error reporting, please. *)
bug () "expected %s, got %s" expected got
;;

View File

@ -960,7 +960,6 @@ and parse_mod_item_from_signature (ps:pstate)
let bpos = lexpos ps in
(ident, span ps apos bpos (decl params (Ast.MOD_ITEM_type t)))
(* FIXME: parse obj. *)
| _ -> raise (unexpected ps)

View File

@ -209,7 +209,7 @@ let build_tmp
(* Simple helpers *)
(* FIXME: please rename these, they make eyes bleed. *)
(* FIXME (issue #71): please rename these, they make eyes bleed. *)
let arr (ls:'a list) : 'a array = Array.of_list ls ;;
let arl (ls:'a list) : 'a array = Array.of_list (List.rev ls) ;;

View File

@ -1356,7 +1356,6 @@ let (abbrev_variant:abbrev) =
let (abbrev_subroutine_type:abbrev) =
(DW_TAG_subroutine_type, DW_CHILDREN_yes,
[|
(* FIXME: model effects properly. *)
(DW_AT_type, DW_FORM_ref_addr); (* NB: output type. *)
(DW_AT_mutable, DW_FORM_flag);
(DW_AT_pure, DW_FORM_flag);
@ -1375,7 +1374,6 @@ let (abbrev_formal_type:abbrev) =
let (abbrev_obj_subroutine_type:abbrev) =
(DW_TAG_subroutine_type, DW_CHILDREN_yes,
[|
(* FIXME: model effects properly. *)
(DW_AT_name, DW_FORM_string);
(DW_AT_type, DW_FORM_ref_addr); (* NB: output type. *)
(DW_AT_mutable, DW_FORM_flag);
@ -1568,7 +1566,7 @@ let dwarf_visitor
|]));
ref_addr_for_fix fix
(* FIXME: encode mutable-ness of interiors. *)
(* FIXME (issue #72): encode mutable-ness of interiors. *)
| Ast.MODE_interior -> ref_type_die (slot_ty slot)
| Ast.MODE_alias ->
@ -2473,7 +2471,9 @@ let dwarf_visitor
Some off ->
begin
match Il.size_to_expr64 off with
(* FIXME: handle dynamic-size slots. *)
(* FIXME (issue #73): handle dynamic-size
* slots.
*)
None -> ()
| Some off ->
emit_var_die
@ -3001,7 +3001,9 @@ let rec extract_mod_items
Ast.slot_ty = Some ty }
| _ ->
let ty = get_ty die in
(* FIXME: encode mutability of interior slots properly. *)
(* FIXME (issue #28): encode mutability of interior slots
* properly.
*)
{ Ast.slot_mode = Ast.MODE_interior;
Ast.slot_mutable = false;
Ast.slot_ty = Some ty }
@ -3114,7 +3116,7 @@ let rec extract_mod_items
htab_put mis ident (decl [||] mi)
| DW_TAG_subprogram ->
(* FIXME: finish this. *)
(* FIXME (issue #74): finish this. *)
let ident = get_name die in
let oslot = get_referenced_slot die in
let effect = get_effect die in

View File

@ -40,7 +40,9 @@ let mutability_checking_visitor
then ()
else err (Some id) "writing to non-mutable slot"
in
(* FIXME: enforce the no-write-alias-to-immutable-slot rule. *)
(* FIXME (issue #75): enforce the no-write-alias-to-immutable-slot
* rule.
*)
let visit_stmt_pre s =
begin
match s.node with

View File

@ -170,7 +170,6 @@ let all_item_collecting_visitor
htab_put cx.ctxt_all_item_names i.id (Walk.path_to_name path);
log cx "collected item #%d: %s" (int_of_node i.id) n;
begin
(* FIXME: this is incomplete. *)
match i.node.Ast.decl_item with
Ast.MOD_ITEM_fn f ->
note_header i.id f.Ast.fn_input_slots;
@ -345,8 +344,6 @@ let rec ty_iso_of
let group_table = Hashtbl.find recursive_tag_groups n in
let group_array = Array.of_list (htab_keys group_table) in
let compare_nodes a_id b_id =
(* FIXME: this should sort by the sorted name-lists of the
*constructors* of the tag, not the tag type name. *)
let a_name = Hashtbl.find cx.ctxt_all_item_names a_id in
let b_name = Hashtbl.find cx.ctxt_all_item_names b_id in
compare a_name b_name
@ -935,11 +932,11 @@ let pattern_resolving_visitor
let lval_id = lval_base_id lval in
let tag_ctor_id = lval_to_referent cx lval_id in
if referent_is_item cx tag_ctor_id
(*
* FIXME we should actually check here that the function
* is a tag value-ctor. For now this actually allows any
* function returning a tag type to pass as a tag pattern.
*)
(* FIXME (issue #76): we should actually check here that the
* function is a tag value-ctor. For now this actually allows
* any function returning a tag type to pass as a tag
* pattern. *)
then resolve_pat_tag lval_nm lval_id pats tag_ctor_id
else not_tag_ctor lval_nm lval_id
| _ -> ()
@ -948,7 +945,8 @@ let pattern_resolving_visitor
let visit_stmt_pre stmt =
begin
match stmt.node with
Ast.STMT_alt_tag { Ast.alt_tag_lval = _; Ast.alt_tag_arms = arms } ->
Ast.STMT_alt_tag { Ast.alt_tag_lval = _;
Ast.alt_tag_arms = arms } ->
Array.iter resolve_arm arms
| _ -> ()
end;

View File

@ -874,13 +874,10 @@ let rebuild_ty_under_params
}
in
let t' = fold_ty fold t in
(*
* FIXME: "substituted" and "ty'" here are only required
* because the current type-equality-comparison code in Type
* uses <> and will judge some cases, such as rebuilt tags, as
* unequal simply due to the different hashtable order in the
* fold.
*)
(* FIXME (issue #77): "substituted" and "ty'" here are only required
* because the current type-equality-comparison code in Type uses <>
* and will judge some cases, such as rebuilt tags, as unequal simply
* due to the different hashtable order in the fold. *)
if !substituted
then t'
else t
@ -2080,7 +2077,7 @@ let ty_str (ty:Ast.ty) : string =
ty_fold_vec = (fun s -> "v" ^ s);
ty_fold_iso = fold_iso;
ty_fold_idx = (fun i -> "x" ^ (string_of_int i));
(* FIXME: encode constrs, aux as well. *)
(* FIXME (issue #78): encode constrs, aux as well. *)
ty_fold_fn = (fun ((ins,_,out),_) -> "f" ^ ins ^ out);
(* Built-in special types. *)
@ -2092,10 +2089,10 @@ let ty_str (ty:Ast.ty) : string =
ty_fold_param = (fun _ -> "P");
ty_fold_type = (fun _ -> "Y");
(* FIXME: encode obj types. *)
(* FIXME: encode opaque and param numbers. *)
(* FIXME (issue #78): encode obj types. *)
(* FIXME (issue #78): encode opaque and param numbers. *)
ty_fold_named = (fun _ -> bug () "string-encoding named type");
(* FIXME: encode constrs as well. *)
(* FIXME (issue #78): encode constrs as well. *)
ty_fold_constrained = (fun (t,_)-> t) }
in
fold_ty fold ty
@ -2124,8 +2121,9 @@ let glue_str (cx:ctxt) (g:glue) : string =
| GLUE_drop_frame i -> "glue$drop_frame$" ^ (item_str cx i)
| GLUE_reloc_frame i -> "glue$reloc_frame$" ^ (item_str cx i)
(*
* FIXME: the node_id here isn't an item, it's a statement;
* lookup bind target and encode bound arg tuple type.
* FIXME (issue #78): the node_id here isn't an item, it's
* a statement; lookup bind target and encode bound arg
* tuple type.
*)
| GLUE_fn_binding i
-> "glue$fn_binding$" ^ (string_of_int (int_of_node i))

View File

@ -832,8 +832,9 @@ let trans_visitor
then
bug () "unsupported nested for each loop";
for i = 2 to diff do
(* FIXME: access outer caller-block fps,
* given nearest caller-block fp.
(* FIXME (issue #79): access outer
* caller-block fps, given nearest
* caller-block fp.
*)
let _ =
annotate "step to outer-outer frame"
@ -1179,7 +1180,7 @@ let trans_visitor
trans_copy_forward_args self_args_rty;
iflog (fun _ -> annotate "call through to callee");
(* FIXME: use a tail-call here. *)
(* FIXME (issue #80): use a tail-call here. *)
call_code (code_of_cell callee_fn_cell);
trans_glue_frame_exit fix spill g;
fix
@ -1419,7 +1420,7 @@ let trans_visitor
let (callee_ty:Ast.ty) = mk_simple_ty_fn arg_slots in
let self_closure_rty = closure_referent_type bound_slots in
(* FIXME: binding type parameters doesn't work. *)
(* FIXME (issue #81): binding type parameters doesn't work. *)
let self_args_rty =
call_args_referent_type cx 0 self_ty (Some self_closure_rty)
in
@ -2009,7 +2010,7 @@ let trans_visitor
let (fptr_operand, fn_ty) = trans_callee fn_lval in
(*let fn_ty_params = [| |] in*)
let _ =
(* FIXME: handle indirect-spawns (clone closure). *)
(* FIXME (issue #82): handle indirect-spawns (clone closure). *)
if not (lval_is_direct_fn cx fn_lval)
then bug () "unhandled indirect-spawn"
in
@ -2214,7 +2215,9 @@ let trans_visitor
let descs_ptr = next_vreg_cell Il.voidptr_t in
if (Array.length descs) > 0
then
(* FIXME: this relies on knowledge that spills are contiguous. *)
(* FIXME (issue #83): this relies on knowledge that spills are
* contiguous.
*)
let spills =
Array.map (fun _ -> next_spill_cell Il.voidptr_t) descs
in
@ -3129,14 +3132,13 @@ let trans_visitor
let src_cell = need_cell (trans_atom a) in
let src_slot = interior_slot src_ty in
(* FIXME: this is wrong. It treats the underlying obj-state
* as the same as the callee and simply substitutes the
* forwarding vtbl, which would be great if it had any way
(* FIXME (issue #84): this is wrong. It treats the underlying
* obj-state as the same as the callee and simply substitutes
* the forwarding vtbl, which would be great if it had any way
* convey the callee vtbl to the forwarding functions. But it
* doesn't. Instead, we have to malloc a fresh 3-word
* refcounted obj to hold the callee's vtbl+state pair, copy
* that in as the state here.
*)
* that in as the state here. *)
let _ =
trans_copy_slot (get_ty_params_of_current_frame())
initializing
@ -3260,10 +3262,8 @@ let trans_visitor
then
match clone with
CLONE_none ->
(*
* FIXME: this won't work on mutable aliases, it
* doesn't know to reload. Try something
* else.
(* Aliasing a literal is a bit weird since nobody
* else will ever see it, but it seems harmless.
*)
mov dst (Il.Cell (alias (Il.Mem (force_to_mem src))))
| _ ->
@ -3326,7 +3326,7 @@ let trans_visitor
call_iterator_args = call_iterator_args None;
call_indirect_args = call_indirect_args flv cc }
in
(* FIXME: true if caller is object fn *)
(* FIXME (issue #85): true if caller is object fn *)
let caller_is_closure = false in
log cx "trans_be_fn: %s call to lval %a"
(call_ctrl_string cc) Ast.sprintf_lval flv;
@ -3796,9 +3796,9 @@ let trans_visitor
| CALL_vtbl ->
begin
match flv with
(*
* FIXME: will need to pass both words of obj if we add
* a 'self' value for self-dispatch within objs.
(* FIXME (issue #84): will need to pass both words of obj
* if we add a 'self' value for self-dispatch within
* objs. Also to support forwarding-functions / 'as'.
*)
Ast.LVAL_ext (base, _) -> [| callee_binding_ptr base cc |]
| _ ->

View File

@ -859,9 +859,8 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit =
unify_atom atom tv_a;
unify_tyvars tv tv_a
| Ast.UNOP_cast t ->
(*
* FIXME: check cast-validity in post-typecheck pass.
* Only some casts make sense.
(* FIXME (issue #84): check cast-validity in
* post-typecheck pass. Only some casts make sense.
*)
let tv_a = ref TYSPEC_all in
let t = Hashtbl.find cx.ctxt_all_cast_types t.id in
@ -1056,7 +1055,6 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit =
| Ast.STMT_decl _ -> ()
(* FIXME: deal with difference between return-type vs. put-type *)
| Ast.STMT_ret atom_opt
| Ast.STMT_put atom_opt ->
begin
@ -1069,7 +1067,9 @@ let process_crate (cx:ctxt) (crate:Ast.crate) : unit =
check_callable (retval_tv()) callee args
| Ast.STMT_bind (bound, callee, arg_opts) ->
(* FIXME: handle binding type parameters eventually. *)
(* FIXME (issue #81): handle binding type parameters
* eventually.
*)
let out_tv = ref TYSPEC_all in
let residue = ref [] in
let gen_atom_opt_tvs atoms =

View File

@ -487,7 +487,7 @@ let condition_assigning_visitor
| Ast.STMT_alt_tag at ->
let precond = slot_inits (lval_slots cx at.Ast.alt_tag_lval) in
let visit_arm { node = (pat, block) } =
(* FIXME: propagate tag-carried constrs here. *)
(* FIXME (issue #34): propagate tag-carried constrs here. *)
let rec get_slots pat =
match pat with
Ast.PAT_slot header_slot -> [| header_slot |]

View File

@ -524,7 +524,9 @@ and walk_stmt
walk_lval v lv;
Array.iter (walk_atom v) ats
(* FIXME: this should have a param array, and invoke the visitors. *)
(* FIXME (issue #86): this should have a param array, and invoke the
* visitors.
*)
| Ast.STMT_decl (Ast.DECL_mod_item (id, mi)) ->
walk_mod_item v id mi