@@ -46,13 +46,18 @@ const shape_vec: u8 = 11u8;
46
46
const shape_tag: u8 = 12u8 ;
47
47
const shape_box: u8 = 13u8 ;
48
48
const shape_struct: u8 = 17u8 ;
49
- const shape_fn : u8 = 18u8 ;
49
+ const shape_box_fn : u8 = 18u8 ;
50
50
const shape_obj: u8 = 19u8 ;
51
51
const shape_res: u8 = 20u8 ;
52
52
const shape_var: u8 = 21u8 ;
53
53
const shape_uniq: u8 = 22u8 ;
54
54
const shape_opaque_closure_ptr: u8 = 23u8 ; // the closure itself.
55
55
const shape_iface: u8 = 24u8 ;
56
+ const shape_uniq_fn: u8 = 25u8 ;
57
+ const shape_stack_fn: u8 = 26u8 ;
58
+ const shape_bare_fn: u8 = 27u8 ;
59
+ const shape_tydesc: u8 = 28u8 ;
60
+ const shape_send_tydesc: u8 = 29u8 ;
56
61
57
62
// FIXME: This is a bad API in trans_common.
58
63
fn C_u8 ( n : u8 ) -> ValueRef { ret trans_common:: C_u8 ( n as uint ) ; }
@@ -267,6 +272,14 @@ fn s_variant_tag_t(tcx: ty_ctxt) -> u8 {
267
272
ret s_int ( tcx) ;
268
273
}
269
274
275
+ fn s_tydesc ( _tcx : ty_ctxt ) -> u8 {
276
+ ret shape_tydesc;
277
+ }
278
+
279
+ fn s_send_tydesc ( _tcx : ty_ctxt ) -> u8 {
280
+ ret shape_send_tydesc;
281
+ }
282
+
270
283
fn mk_ctxt ( llmod : ModuleRef ) -> ctxt {
271
284
let llshapetablesty = trans_common:: T_named_struct ( "shapes" ) ;
272
285
let llshapetables =
@@ -305,8 +318,10 @@ fn shape_of(ccx: @crate_ctxt, t: ty::t, ty_param_map: [uint],
305
318
ty:: ty_bot. { s += [ shape_u8] ; }
306
319
ty:: ty_int ( ast:: ty_i. ) { s += [ s_int ( ccx. tcx ) ] ; }
307
320
ty:: ty_float( ast:: ty_f. ) { s += [ s_float ( ccx. tcx ) ] ; }
308
- ty:: ty_uint ( ast:: ty_u. ) | ty:: ty_ptr ( _) | ty:: ty_type. |
309
- ty:: ty_send_type. | ty:: ty_native ( _) { s += [ s_uint ( ccx. tcx ) ] ; }
321
+ ty:: ty_uint ( ast:: ty_u. ) | ty:: ty_ptr ( _) |
322
+ ty:: ty_native ( _) { s += [ s_uint ( ccx. tcx ) ] ; }
323
+ ty:: ty_type. { s += [ s_tydesc ( ccx. tcx ) ] ; }
324
+ ty:: ty_send_type. { s += [ s_send_tydesc ( ccx. tcx ) ] ; }
310
325
ty:: ty_int( ast:: ty_i8. ) { s += [ shape_i8] ; }
311
326
ty:: ty_uint( ast:: ty_u16. ) { s += [ shape_u16] ; }
312
327
ty:: ty_int( ast:: ty_i16. ) { s += [ shape_i16] ; }
@@ -418,8 +433,17 @@ fn shape_of(ccx: @crate_ctxt, t: ty::t, ty_param_map: [uint],
418
433
}
419
434
}
420
435
}
421
- ty:: ty_fn ( _) {
422
- s += [ shape_fn] ;
436
+ ty:: ty_fn ( { proto: ast:: proto_box. , _} ) {
437
+ s += [ shape_box_fn] ;
438
+ }
439
+ ty:: ty_fn ( { proto: ast:: proto_uniq. , _} ) {
440
+ s += [ shape_uniq_fn] ;
441
+ }
442
+ ty:: ty_fn ( { proto: ast:: proto_block. , _} ) {
443
+ s += [ shape_stack_fn] ;
444
+ }
445
+ ty:: ty_fn ( { proto: ast:: proto_bare. , _} ) {
446
+ s += [ shape_bare_fn] ;
423
447
}
424
448
ty:: ty_opaque_closure_ptr ( _) {
425
449
s += [ shape_opaque_closure_ptr] ;
0 commit comments