Skip to content

Commit cc908b7

Browse files
AatchJames Miller
authored and
James Miller
committed
Remove @-fields from CrateContext
Remove all the explicit @mut-fields from CrateContext, though many fields are still @-ptrs. This required changing every single function call that explicitly took a @CrateContext, so I took advantage and changed as many as I could get away with to &-ptrs or &mut ptrs.
1 parent 01e098a commit cc908b7

26 files changed

+611
-512
lines changed

src/librustc/back/link.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -622,11 +622,11 @@ pub fn symbol_hash(tcx: ty::ctxt,
622622
hash.to_managed()
623623
}
624624

625-
pub fn get_symbol_hash(ccx: @CrateContext, t: ty::t) -> @str {
625+
pub fn get_symbol_hash(ccx: &mut CrateContext, t: ty::t) -> @str {
626626
match ccx.type_hashcodes.find(&t) {
627627
Some(&h) => h,
628628
None => {
629-
let hash = symbol_hash(ccx.tcx, ccx.symbol_hasher, t, ccx.link_meta);
629+
let hash = symbol_hash(ccx.tcx, &mut ccx.symbol_hasher, t, ccx.link_meta);
630630
ccx.type_hashcodes.insert(t, hash);
631631
hash
632632
}
@@ -705,7 +705,7 @@ pub fn exported_name(sess: Session,
705705
path_name(sess.ident_of(vers))));
706706
}
707707

708-
pub fn mangle_exported_name(ccx: @CrateContext,
708+
pub fn mangle_exported_name(ccx: &mut CrateContext,
709709
path: path,
710710
t: ty::t) -> ~str {
711711
let hash = get_symbol_hash(ccx, t);
@@ -714,7 +714,7 @@ pub fn mangle_exported_name(ccx: @CrateContext,
714714
ccx.link_meta.vers);
715715
}
716716

717-
pub fn mangle_internal_name_by_type_only(ccx: @CrateContext,
717+
pub fn mangle_internal_name_by_type_only(ccx: &mut CrateContext,
718718
t: ty::t,
719719
name: &str) -> ~str {
720720
let s = ppaux::ty_to_short_str(ccx.tcx, t);
@@ -725,7 +725,7 @@ pub fn mangle_internal_name_by_type_only(ccx: @CrateContext,
725725
path_name(ccx.sess.ident_of(hash))]);
726726
}
727727

728-
pub fn mangle_internal_name_by_type_and_seq(ccx: @CrateContext,
728+
pub fn mangle_internal_name_by_type_and_seq(ccx: &mut CrateContext,
729729
t: ty::t,
730730
name: &str) -> ~str {
731731
let s = ppaux::ty_to_str(ccx.tcx, t);
@@ -736,18 +736,18 @@ pub fn mangle_internal_name_by_type_and_seq(ccx: @CrateContext,
736736
path_name((ccx.names)(name))]);
737737
}
738738

739-
pub fn mangle_internal_name_by_path_and_seq(ccx: @CrateContext,
739+
pub fn mangle_internal_name_by_path_and_seq(ccx: &mut CrateContext,
740740
path: path,
741741
flav: &str) -> ~str {
742742
return mangle(ccx.sess,
743743
vec::append_one(path, path_name((ccx.names)(flav))));
744744
}
745745

746-
pub fn mangle_internal_name_by_path(ccx: @CrateContext, path: path) -> ~str {
746+
pub fn mangle_internal_name_by_path(ccx: &mut CrateContext, path: path) -> ~str {
747747
return mangle(ccx.sess, path);
748748
}
749749

750-
pub fn mangle_internal_name_by_seq(ccx: @CrateContext, flav: &str) -> ~str {
750+
pub fn mangle_internal_name_by_seq(ccx: &mut CrateContext, flav: &str) -> ~str {
751751
return fmt!("%s_%u", flav, (ccx.names)(flav).name);
752752
}
753753

0 commit comments

Comments
 (0)