@@ -43,7 +43,6 @@ export get_used_link_args;
43
43
export add_use_stmt_cnum;
44
44
export find_use_stmt_cnum;
45
45
export get_dep_hashes;
46
- export get_path;
47
46
48
47
49
48
// A map from external crate numbers (as decoded from some crate file) to
@@ -52,11 +51,6 @@ export get_path;
52
51
// own crate numbers.
53
52
type cnum_map = map:: HashMap < ast:: crate_num , ast:: crate_num > ;
54
53
55
- // Multiple items may have the same def_id in crate metadata. They may be
56
- // renamed imports or reexports. This map keeps the "real" module path
57
- // and def_id.
58
- type mod_path_map = map:: HashMap < ast:: def_id , @~str > ;
59
-
60
54
type crate_metadata = @{ name : ~str ,
61
55
data : @~[ u8 ] ,
62
56
cnum_map : cnum_map ,
@@ -72,7 +66,6 @@ enum CStore { private(cstore_private), }
72
66
type cstore_private =
73
67
@{ metas : map:: HashMap < ast:: crate_num , crate_metadata > ,
74
68
use_crate_map : use_crate_map ,
75
- mod_path_map : mod_path_map ,
76
69
mut used_crate_files : ~[ Path ] ,
77
70
mut used_libraries : ~[ ~str ] ,
78
71
mut used_link_args : ~[ ~str ] ,
@@ -89,10 +82,8 @@ pure fn p(cstore: CStore) -> cstore_private {
89
82
fn mk_cstore ( intr : @ident_interner ) -> CStore {
90
83
let meta_cache = map:: HashMap ( ) ;
91
84
let crate_map = map:: HashMap ( ) ;
92
- let mod_path_map = HashMap ( ) ;
93
85
return private ( @{ metas: meta_cache,
94
86
use_crate_map: crate_map,
95
- mod_path_map: mod_path_map,
96
87
mut used_crate_files: ~[ ] ,
97
88
mut used_libraries: ~[ ] ,
98
89
mut used_link_args: ~[ ] ,
@@ -113,18 +104,10 @@ fn get_crate_vers(cstore: CStore, cnum: ast::crate_num) -> ~str {
113
104
return decoder:: get_crate_vers ( cdata. data ) ;
114
105
}
115
106
116
- fn set_crate_data ( cstore : CStore , cnum : ast:: crate_num ,
107
+ fn set_crate_data ( cstore : CStore ,
108
+ cnum : ast:: crate_num ,
117
109
data : crate_metadata ) {
118
110
p ( cstore) . metas . insert ( cnum, data) ;
119
- let get_crate_data: decoder:: GetCrateDataCb = |cnum| {
120
- cstore:: get_crate_data ( cstore, cnum)
121
- } ;
122
- for vec:: each( decoder:: get_crate_module_paths( cstore. intr, data,
123
- get_crate_data) ) |dp| {
124
- let ( did, path) = * dp;
125
- let d = { crate : cnum, node: did. node } ;
126
- p ( cstore) . mod_path_map . insert ( d, @path) ;
127
- }
128
111
}
129
112
130
113
fn have_crate_data ( cstore : CStore , cnum : ast:: crate_num ) -> bool {
@@ -197,10 +180,6 @@ fn get_dep_hashes(cstore: CStore) -> ~[~str] {
197
180
return vec:: map ( sorted, mapper) ;
198
181
}
199
182
200
- fn get_path ( cstore : CStore , d : ast:: def_id ) -> ~[ ~str ] {
201
- option:: map_default ( & p ( cstore) . mod_path_map . find ( d) , ~[ ] ,
202
- |ds| str:: split_str ( * * ds, ~":: ") )
203
- }
204
183
// Local Variables:
205
184
// mode: rust
206
185
// fill-column: 78;
0 commit comments