@@ -5,6 +5,7 @@ import middle::trans_common::T_f32;
5
5
import middle:: trans_common:: T_f64 ;
6
6
import middle:: trans_common:: T_fn ;
7
7
import middle:: trans_common:: T_bool ;
8
+ import middle:: trans_common:: T_i1 ;
8
9
import middle:: trans_common:: T_i8 ;
9
10
import middle:: trans_common:: T_i32 ;
10
11
import middle:: trans_common:: T_int ;
@@ -65,22 +66,26 @@ type upcalls =
65
66
ivec_resize : ValueRef ,
66
67
ivec_spill : ValueRef ,
67
68
ivec_resize_shared : ValueRef ,
68
- ivec_spill_shared : ValueRef } ;
69
+ ivec_spill_shared : ValueRef ,
70
+ cmp_type : ValueRef } ;
69
71
70
72
fn declare_upcalls ( tn : type_names , tydesc_type : TypeRef ,
71
73
taskptr_type : TypeRef , llmod : ModuleRef ) -> @upcalls {
72
- fn decl ( tn : type_names , tydesc_type : TypeRef , taskptr_type : TypeRef ,
73
- llmod : ModuleRef , name : str , tys : TypeRef [ ] , rv : TypeRef ) ->
74
- ValueRef {
75
- let arg_tys: TypeRef [ ] = ~[ taskptr_type] ;
74
+ fn decl ( tn : type_names , llmod : ModuleRef , name : str , tys : TypeRef [ ] ,
75
+ rv : TypeRef ) -> ValueRef {
76
+ let arg_tys: TypeRef [ ] = ~[ ] ;
76
77
for t: TypeRef in tys { arg_tys += ~[ t] ; }
77
78
let fn_ty = T_fn ( arg_tys, rv) ;
78
79
ret trans:: decl_cdecl_fn ( llmod, "upcall_" + name, fn_ty) ;
79
80
}
80
- let dv = bind decl ( tn, tydesc_type, taskptr_type, llmod, _, _, T_void ( ) ) ;
81
- let d = bind decl ( tn, tydesc_type, taskptr_type, llmod, _, _, _) ;
82
- // FIXME: Sigh:.. remove this when I fix the typechecker pushdown.
83
- // --pcwalton
81
+ fn decl_with_taskptr ( taskptr_type : TypeRef , tn : type_names ,
82
+ llmod : ModuleRef , name : str , tys : TypeRef [ ] ,
83
+ rv : TypeRef ) -> ValueRef {
84
+ ret decl ( tn, llmod, name, ~[ taskptr_type] + tys, rv) ;
85
+ }
86
+ let dv = bind decl_with_taskptr ( taskptr_type, tn, llmod, _, _, T_void ( ) ) ;
87
+ let d = bind decl_with_taskptr ( taskptr_type, tn, llmod, _, _, _) ;
88
+ let dr = bind decl ( tn, llmod, _, _, _) ;
84
89
85
90
let empty_vec: TypeRef [ ] = ~[ ] ;
86
91
ret @{ grow_task : dv ( "grow_task" , ~[ T_size_t ( ) ] ) ,
@@ -149,7 +154,12 @@ fn declare_upcalls(tn: type_names, tydesc_type: TypeRef,
149
154
T_void ( ) ) ,
150
155
ivec_spill_shared :
151
156
d ( "ivec_spill_shared" , ~[ T_ptr ( T_opaque_ivec ( ) ) , T_int ( ) ] ,
152
- T_void ( ) ) } ;
157
+ T_void ( ) ) ,
158
+ cmp_type :
159
+ dr ( "cmp_type" , ~[ T_ptr ( T_i1 ( ) ) , taskptr_type,
160
+ T_ptr ( tydesc_type) , T_ptr ( T_ptr ( tydesc_type) ) ,
161
+ T_ptr ( T_i8 ( ) ) , T_ptr ( T_i8 ( ) ) , T_int ( ) ] ,
162
+ T_void ( ) ) } ;
153
163
}
154
164
//
155
165
// Local Variables:
0 commit comments