Skip to content

Commit 273c5e5

Browse files
committed
rustc: Lift the @ from the type definition of crate_ctxt into its uses
This will make it easier to convert crate_ctxt into a region pointer, since there are functions that return crate contexts. There would be no way to type these functions if crate_ctxt had to be an inferred region pointer.
1 parent 1e0e089 commit 273c5e5

File tree

12 files changed

+146
-145
lines changed

12 files changed

+146
-145
lines changed

src/rustc/back/link.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ fn symbol_hash(tcx: ty::ctxt, sha: sha1, t: ty::t, link_meta: link_meta) ->
493493
ret "_" + hash;
494494
}
495495

496-
fn get_symbol_hash(ccx: crate_ctxt, t: ty::t) -> str {
496+
fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> str {
497497
let hash = "";
498498
alt ccx.type_sha1s.find(t) {
499499
some(h) { hash = h; }
@@ -525,28 +525,28 @@ fn exported_name(path: path, hash: str, _vers: str) -> str {
525525

526526
}
527527

528-
fn mangle_exported_name(ccx: crate_ctxt, path: path, t: ty::t) -> str {
528+
fn mangle_exported_name(ccx: @crate_ctxt, path: path, t: ty::t) -> str {
529529
let hash = get_symbol_hash(ccx, t);
530530
ret exported_name(path, hash, ccx.link_meta.vers);
531531
}
532532

533-
fn mangle_internal_name_by_type_only(ccx: crate_ctxt, t: ty::t, name: str) ->
533+
fn mangle_internal_name_by_type_only(ccx: @crate_ctxt, t: ty::t, name: str) ->
534534
str {
535535
let s = util::ppaux::ty_to_short_str(ccx.tcx, t);
536536
let hash = get_symbol_hash(ccx, t);
537537
ret mangle([path_name(name), path_name(s), path_name(hash)]);
538538
}
539539

540-
fn mangle_internal_name_by_path_and_seq(ccx: crate_ctxt, path: path,
540+
fn mangle_internal_name_by_path_and_seq(ccx: @crate_ctxt, path: path,
541541
flav: str) -> str {
542542
ret mangle(path + [path_name(ccx.names(flav))]);
543543
}
544544

545-
fn mangle_internal_name_by_path(_ccx: crate_ctxt, path: path) -> str {
545+
fn mangle_internal_name_by_path(_ccx: @crate_ctxt, path: path) -> str {
546546
ret mangle(path);
547547
}
548548

549-
fn mangle_internal_name_by_seq(ccx: crate_ctxt, flav: str) -> str {
549+
fn mangle_internal_name_by_seq(ccx: @crate_ctxt, flav: str) -> str {
550550
ret ccx.names(flav);
551551
}
552552

src/rustc/metadata/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export encode_def_id;
2828

2929
type abbrev_map = map::hashmap<ty::t, tyencode::ty_abbrev>;
3030

31-
type encode_ctxt = {ccx: crate_ctxt,
31+
type encode_ctxt = {ccx: @crate_ctxt,
3232
type_abbrevs: abbrev_map,
3333
reachable: reachable::map};
3434

@@ -737,7 +737,7 @@ fn encode_hash(ebml_w: ebml::writer, hash: str) {
737737
ebml_w.end_tag();
738738
}
739739

740-
fn encode_metadata(cx: crate_ctxt, crate: @crate) -> [u8] {
740+
fn encode_metadata(cx: @crate_ctxt, crate: @crate) -> [u8] {
741741

742742
let reachable = reachable::find_reachable(cx, crate.node.module);
743743
let abbrevs = ty::new_ty_hash();

src/rustc/metadata/reachable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export map, find_reachable;
1616

1717
type map = std::map::hashmap<node_id, ()>;
1818

19-
type ctx = {ccx: middle::trans::common::crate_ctxt,
19+
type ctx = {ccx: @middle::trans::common::crate_ctxt,
2020
rmap: map};
2121

22-
fn find_reachable(ccx: middle::trans::common::crate_ctxt, crate_mod: _mod)
22+
fn find_reachable(ccx: @middle::trans::common::crate_ctxt, crate_mod: _mod)
2323
-> map {
2424
let rmap = std::map::new_int_hash();
2525
traverse_public_mod({ccx: ccx, rmap: rmap}, crate_mod);

src/rustc/middle/trans/alt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ fn enter_uniq(dm: def_map, m: match, col: uint, val: ValueRef) -> match {
231231
}
232232
}
233233

234-
fn get_options(ccx: crate_ctxt, m: match, col: uint) -> [opt] {
234+
fn get_options(ccx: @crate_ctxt, m: match, col: uint) -> [opt] {
235235
fn add_to_set(tcx: ty::ctxt, &set: [opt], val: opt) {
236236
for l in set { if opt_eq(tcx, l, val) { ret; } }
237237
set += [val];

0 commit comments

Comments
 (0)