@@ -160,17 +160,25 @@ fn encode_item_paths(ebml_w: &ebmlivec::writer, crate: &@crate) ->
160
160
161
161
162
162
// Item info table encoding
163
- fn encode_kind ( ebml_w : & ebmlivec:: writer , c : u8 ) {
164
- ebmlivec:: start_tag ( ebml_w , tag_items_data_item_kind ) ;
163
+ fn encode_family ( ebml_w : & ebmlivec:: writer , c : u8 ) {
164
+ ebmlivec:: start_tag ( ebml_w , tag_items_data_item_family ) ;
165
165
ebml_w. writer . write ( ~[ c] ) ;
166
166
ebmlivec:: end_tag ( ebml_w) ;
167
167
}
168
168
169
169
fn def_to_str ( did : & def_id ) -> str { ret #fmt ( "%d:%d" , did. crate , did. node ) ; }
170
170
171
- fn encode_type_param_count ( ebml_w : & ebmlivec:: writer , tps : & ty_param [ ] ) {
172
- ebmlivec:: start_tag ( ebml_w , tag_items_data_item_ty_param_count ) ;
171
+ fn encode_type_param_kinds ( ebml_w : & ebmlivec:: writer , tps : & ty_param [ ] ) {
172
+ ebmlivec:: start_tag ( ebml_w , tag_items_data_item_ty_param_kinds ) ;
173
173
ebmlivec:: write_vint ( ebml_w. writer , ivec:: len[ ty_param] ( tps) ) ;
174
+ for tp: ty_param in tps {
175
+ let c = alt tp. kind {
176
+ kind_unique. { 'u' }
177
+ kind_shared. { 's' }
178
+ kind_pinned. { 'p' }
179
+ } ;
180
+ ebml_w. writer . write ( ~[ c as u8 ] ) ;
181
+ }
174
182
ebmlivec:: end_tag ( ebml_w) ;
175
183
}
176
184
@@ -218,15 +226,15 @@ fn encode_tag_variant_info(ecx: &@encode_ctxt, ebml_w: &ebmlivec::writer,
218
226
index += ~[ { val: variant. node . id , pos: ebml_w. writer . tell ( ) } ] ;
219
227
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
220
228
encode_def_id ( ebml_w, local_def ( variant. node . id ) ) ;
221
- encode_kind ( ebml_w, 'v' as u8 ) ;
229
+ encode_family ( ebml_w, 'v' as u8 ) ;
222
230
encode_tag_id ( ebml_w, local_def ( id) ) ;
223
231
encode_type ( ecx, ebml_w,
224
232
node_id_to_monotype ( ecx. ccx . tcx , variant. node . id ) ) ;
225
233
if ivec:: len[ variant_arg] ( variant. node . args ) > 0 u {
226
234
encode_symbol ( ecx, ebml_w, variant. node . id ) ;
227
235
}
228
236
encode_discriminant ( ecx, ebml_w, variant. node . id ) ;
229
- encode_type_param_count ( ebml_w, ty_params) ;
237
+ encode_type_param_kinds ( ebml_w, ty_params) ;
230
238
ebmlivec:: end_tag ( ebml_w) ;
231
239
}
232
240
}
@@ -237,47 +245,47 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: &ebmlivec::writer,
237
245
item_const ( _, _) {
238
246
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
239
247
encode_def_id ( ebml_w, local_def ( item. id ) ) ;
240
- encode_kind ( ebml_w, 'c' as u8 ) ;
248
+ encode_family ( ebml_w, 'c' as u8 ) ;
241
249
encode_type ( ecx, ebml_w, node_id_to_monotype ( ecx. ccx . tcx , item. id ) ) ;
242
250
encode_symbol ( ecx, ebml_w, item. id ) ;
243
251
ebmlivec:: end_tag ( ebml_w) ;
244
252
}
245
253
item_fn ( fd, tps) {
246
254
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
247
255
encode_def_id ( ebml_w, local_def ( item. id ) ) ;
248
- encode_kind ( ebml_w,
256
+ encode_family ( ebml_w,
249
257
alt fd. decl . purity { pure_fn. { 'p' } impure_fn. { 'f' } }
250
258
as u8 ) ;
251
- encode_type_param_count ( ebml_w, tps) ;
259
+ encode_type_param_kinds ( ebml_w, tps) ;
252
260
encode_type ( ecx, ebml_w, node_id_to_monotype ( ecx. ccx . tcx , item. id ) ) ;
253
261
encode_symbol ( ecx, ebml_w, item. id ) ;
254
262
ebmlivec:: end_tag ( ebml_w) ;
255
263
}
256
264
item_mod ( _) {
257
265
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
258
266
encode_def_id ( ebml_w, local_def ( item. id ) ) ;
259
- encode_kind ( ebml_w, 'm' as u8 ) ;
267
+ encode_family ( ebml_w, 'm' as u8 ) ;
260
268
ebmlivec:: end_tag ( ebml_w) ;
261
269
}
262
270
item_native_mod ( _) {
263
271
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
264
272
encode_def_id ( ebml_w, local_def ( item. id ) ) ;
265
- encode_kind ( ebml_w, 'n' as u8 ) ;
273
+ encode_family ( ebml_w, 'n' as u8 ) ;
266
274
ebmlivec:: end_tag ( ebml_w) ;
267
275
}
268
276
item_ty ( _, tps) {
269
277
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
270
278
encode_def_id ( ebml_w, local_def ( item. id ) ) ;
271
- encode_kind ( ebml_w, 'y' as u8 ) ;
272
- encode_type_param_count ( ebml_w, tps) ;
279
+ encode_family ( ebml_w, 'y' as u8 ) ;
280
+ encode_type_param_kinds ( ebml_w, tps) ;
273
281
encode_type ( ecx, ebml_w, node_id_to_monotype ( ecx. ccx . tcx , item. id ) ) ;
274
282
ebmlivec:: end_tag ( ebml_w) ;
275
283
}
276
284
item_tag ( variants, tps) {
277
285
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
278
286
encode_def_id ( ebml_w, local_def ( item. id ) ) ;
279
- encode_kind ( ebml_w, 't' as u8 ) ;
280
- encode_type_param_count ( ebml_w, tps) ;
287
+ encode_family ( ebml_w, 't' as u8 ) ;
288
+ encode_type_param_kinds ( ebml_w, tps) ;
281
289
encode_type ( ecx, ebml_w, node_id_to_monotype ( ecx. ccx . tcx , item. id ) ) ;
282
290
for v: variant in variants {
283
291
encode_variant_id ( ebml_w, local_def ( v. node . id ) ) ;
@@ -290,17 +298,17 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: &ebmlivec::writer,
290
298
291
299
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
292
300
encode_def_id ( ebml_w, local_def ( ctor_id) ) ;
293
- encode_kind ( ebml_w, 'y' as u8 ) ;
294
- encode_type_param_count ( ebml_w, tps) ;
301
+ encode_family ( ebml_w, 'y' as u8 ) ;
302
+ encode_type_param_kinds ( ebml_w, tps) ;
295
303
encode_type ( ecx, ebml_w, ty:: ty_fn_ret ( ecx. ccx . tcx , fn_ty) ) ;
296
304
encode_symbol ( ecx, ebml_w, item. id ) ;
297
305
ebmlivec:: end_tag ( ebml_w) ;
298
306
299
307
index += ~[ { val: ctor_id, pos: ebml_w. writer . tell ( ) } ] ;
300
308
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
301
309
encode_def_id ( ebml_w, local_def ( ctor_id) ) ;
302
- encode_kind ( ebml_w, 'f' as u8 ) ;
303
- encode_type_param_count ( ebml_w, tps) ;
310
+ encode_family ( ebml_w, 'f' as u8 ) ;
311
+ encode_type_param_kinds ( ebml_w, tps) ;
304
312
encode_type ( ecx, ebml_w, fn_ty) ;
305
313
encode_symbol ( ecx, ebml_w, ctor_id) ;
306
314
ebmlivec:: end_tag ( ebml_w) ;
@@ -310,16 +318,16 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: &ebmlivec::writer,
310
318
311
319
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
312
320
encode_def_id ( ebml_w, local_def ( item. id ) ) ;
313
- encode_kind ( ebml_w, 'y' as u8 ) ;
314
- encode_type_param_count ( ebml_w, tps) ;
321
+ encode_family ( ebml_w, 'y' as u8 ) ;
322
+ encode_type_param_kinds ( ebml_w, tps) ;
315
323
encode_type ( ecx, ebml_w, ty:: ty_fn_ret ( ecx. ccx . tcx , fn_ty) ) ;
316
324
ebmlivec:: end_tag ( ebml_w) ;
317
325
318
326
index += ~[ { val: ctor_id, pos: ebml_w. writer . tell ( ) } ] ;
319
327
ebmlivec:: start_tag ( ebml_w, tag_items_data_item) ;
320
328
encode_def_id ( ebml_w, local_def ( ctor_id) ) ;
321
- encode_kind ( ebml_w, 'f' as u8 ) ;
322
- encode_type_param_count ( ebml_w, tps) ;
329
+ encode_family ( ebml_w, 'f' as u8 ) ;
330
+ encode_type_param_kinds ( ebml_w, tps) ;
323
331
encode_type ( ecx, ebml_w, fn_ty) ;
324
332
encode_symbol ( ecx, ebml_w, ctor_id) ;
325
333
ebmlivec:: end_tag ( ebml_w) ;
@@ -333,14 +341,14 @@ fn encode_info_for_native_item(ecx: &@encode_ctxt, ebml_w: &ebmlivec::writer,
333
341
alt nitem. node {
334
342
native_item_ty. {
335
343
encode_def_id ( ebml_w, local_def ( nitem. id ) ) ;
336
- encode_kind ( ebml_w, 'T' as u8 ) ;
344
+ encode_family ( ebml_w, 'T' as u8 ) ;
337
345
encode_type ( ecx, ebml_w,
338
346
ty:: mk_native ( ecx. ccx . tcx , local_def ( nitem. id ) ) ) ;
339
347
}
340
348
native_item_fn ( _, _, tps) {
341
349
encode_def_id ( ebml_w, local_def ( nitem. id ) ) ;
342
- encode_kind ( ebml_w, 'F' as u8 ) ;
343
- encode_type_param_count ( ebml_w, tps) ;
350
+ encode_family ( ebml_w, 'F' as u8 ) ;
351
+ encode_type_param_kinds ( ebml_w, tps) ;
344
352
encode_type ( ecx, ebml_w, node_id_to_monotype ( ecx. ccx . tcx , nitem. id ) ) ;
345
353
encode_symbol ( ecx, ebml_w, nitem. id ) ;
346
354
}
0 commit comments