@@ -456,7 +456,6 @@ pub fn set_glue_inlining(f: ValueRef, t: ty::t) {
456456// Double-check that we never ask LLVM to declare the same symbol twice. It
457457// silently mangles such symbols, breaking our linkage model.
458458pub fn note_unique_llvm_symbol( ccx : @crate_ctxt , +sym : ~str ) {
459- // XXX: Bad copy.
460459 if ccx. all_llvm_symbols . contains_key ( & sym) {
461460 ccx. sess . bug ( ~"duplicate LLVM symbol: " + sym);
462461 }
@@ -628,7 +627,10 @@ pub fn iter_structural_ty(cx: block, av: ValueRef, t: ty::t,
628627 for vec:: each( fn_ty. sig. inputs) |a| {
629628 let llfldp_a = GEP_enum ( cx, a_tup, tid, v_id,
630629 /*bad*/ copy tps, j) ;
631- // XXX: Is "None" right here?
630+ // This assumes the self type is absent (it passes
631+ // None for the self_ty_opt arg of substs_tps).
632+ // I think that's ok since you can't have an enum
633+ // inside a trait.
632634 let ty_subst = ty:: subst_tps ( ccx. tcx , tps, None , a. ty ) ;
633635 cx = f ( cx, llfldp_a, ty_subst) ;
634636 j += 1 u;
@@ -1038,8 +1040,7 @@ pub fn load_if_immediate(cx: block, v: ValueRef, t: ty::t) -> ValueRef {
10381040pub fn trans_trace( bcx : block , sp_opt : Option < span > , +trace_str : ~str ) {
10391041 if !bcx. sess ( ) . trace ( ) { return ; }
10401042 let _icx = bcx. insn_ctxt ( "trans_trace" ) ;
1041- // XXX: Bad copy.
1042- add_comment ( bcx, copy trace_str) ;
1043+ add_comment ( bcx, trace_str) ;
10431044 let V_trace_str = C_cstr ( bcx. ccx ( ) , trace_str) ;
10441045 let { V_filename , V_line } = match sp_opt {
10451046 Some ( sp) => {
@@ -1551,7 +1552,7 @@ pub fn new_fn_ctxt_w_id(ccx: @crate_ctxt,
15511552 llfndecl: ValueRef,
15521553 id: ast::node_id,
15531554 impl_id: Option<ast::def_id>,
1554- + param_substs: Option<param_substs>,
1555+ param_substs: Option<@ param_substs>,
15551556 sp: Option<span>) -> fn_ctxt {
15561557 let llbbs = mk_standard_basic_blocks(llfndecl);
15571558 return @fn_ctxt_ {
@@ -1740,7 +1741,7 @@ pub fn trans_closure(ccx: @crate_ctxt,
17401741 body : & ast:: blk ,
17411742 llfndecl : ValueRef ,
17421743 ty_self : self_arg ,
1743- + param_substs : Option < param_substs > ,
1744+ param_substs : Option < @ param_substs > ,
17441745 id : ast:: node_id ,
17451746 impl_id : Option < ast:: def_id > ,
17461747 maybe_load_env : fn ( fn_ctxt ) ,
@@ -1804,7 +1805,7 @@ pub fn trans_fn(ccx: @crate_ctxt,
18041805 body : & ast:: blk ,
18051806 llfndecl : ValueRef ,
18061807 ty_self : self_arg ,
1807- + param_substs : Option < param_substs > ,
1808+ param_substs : Option < @ param_substs > ,
18081809 id : ast:: node_id ,
18091810 impl_id : Option < ast:: def_id > ) {
18101811 let do_time = ccx. sess . trans_stats ( ) ;
@@ -1813,8 +1814,8 @@ pub fn trans_fn(ccx: @crate_ctxt,
18131814 debug ! ( "trans_fn(ty_self=%?)" , ty_self) ;
18141815 let _icx = ccx. insn_ctxt ( "trans_fn" ) ;
18151816 ccx. stats . n_fns += 1 ;
1816- // XXX: Bad copy of ` path`.
1817- trans_closure ( ccx, copy path, decl, body, llfndecl, ty_self,
1817+ let the_path_str = path_str ( ccx . sess , path) ;
1818+ trans_closure ( ccx, path, decl, body, llfndecl, ty_self,
18181819 param_substs, id, impl_id,
18191820 |fcx| {
18201821 if ccx. sess . opts . extra_debuginfo {
@@ -1824,7 +1825,7 @@ pub fn trans_fn(ccx: @crate_ctxt,
18241825 |_bcx| { } ) ;
18251826 if do_time {
18261827 let end = time:: get_time ( ) ;
1827- log_fn_time ( ccx, path_str ( ccx . sess , path ) , start, end) ;
1828+ log_fn_time ( ccx, the_path_str , start, end) ;
18281829 }
18291830}
18301831
@@ -1834,7 +1835,7 @@ pub fn trans_enum_variant(ccx: @crate_ctxt,
18341835 args : ~[ ast:: variant_arg ] ,
18351836 disr : int ,
18361837 is_degen : bool ,
1837- + param_substs : Option < param_substs > ,
1838+ param_substs : Option < @ param_substs > ,
18381839 llfndecl : ValueRef ) {
18391840 let _icx = ccx. insn_ctxt ( "trans_enum_variant" ) ;
18401841 // Translate variant arguments to function arguments.
@@ -1850,9 +1851,8 @@ pub fn trans_enum_variant(ccx: @crate_ctxt,
18501851 id : varg. id ,
18511852 }
18521853 } ;
1853- // XXX: Bad copy of `param_substs`.
18541854 let fcx = new_fn_ctxt_w_id ( ccx, ~[ ] , llfndecl, variant. node . id , None ,
1855- copy param_substs, None ) ;
1855+ param_substs, None ) ;
18561856 // XXX: Bad copy.
18571857 let raw_llargs = create_llargs_for_fn_args ( fcx, no_self, copy fn_args) ;
18581858 let ty_param_substs = match param_substs {
@@ -1897,7 +1897,7 @@ pub fn trans_enum_variant(ccx: @crate_ctxt,
18971897pub fn trans_tuple_struct(ccx: @crate_ctxt,
18981898 fields: ~[@ast::struct_field],
18991899 ctor_id: ast::node_id,
1900- + param_substs: Option<param_substs>,
1900+ param_substs: Option<@ param_substs>,
19011901 llfndecl: ValueRef) {
19021902 let _icx = ccx.insn_ctxt(" trans_tuple_struct");
19031903
@@ -1951,7 +1951,7 @@ pub fn trans_struct_dtor(ccx: @crate_ctxt,
19511951 +path: path,
19521952 body: &ast::blk,
19531953 dtor_id: ast::node_id,
1954- + psubsts: Option<param_substs>,
1954+ psubsts: Option<@ param_substs>,
19551955 hash_id: Option<mono_id>,
19561956 parent_id: ast::def_id)
19571957 -> ValueRef {
@@ -1968,7 +1968,7 @@ pub fn trans_struct_dtor(ccx: @crate_ctxt,
19681968 let lldty = type_of_dtor(ccx, class_ty);
19691969
19701970 // XXX: Bad copies.
1971- let s = get_dtor_symbol(ccx, copy path, dtor_id, copy psubsts);
1971+ let s = get_dtor_symbol(ccx, copy path, dtor_id, psubsts);
19721972
19731973 /* Register the dtor as a function. It has external linkage */
19741974 let lldecl = decl_internal_cdecl_fn(ccx.llmod, s, lldty);
@@ -2296,7 +2296,7 @@ pub fn item_path(ccx: @crate_ctxt, i: @ast::item) -> path {
22962296pub fn get_dtor_symbol(ccx: @crate_ctxt,
22972297 +path: path,
22982298 id: ast::node_id,
2299- + substs: Option<param_substs>)
2299+ substs: Option<@ param_substs>)
23002300 -> ~str {
23012301 let t = ty::node_id_to_type(ccx.tcx, id);
23022302 match ccx.item_symbols.find(&id) {
0 commit comments