@@ -130,20 +130,9 @@ fn type_of_inner(cx: @crate_ctxt, sp: span, t: ty::t)
130
130
T_nil ( ) /* ...I guess? */
131
131
}
132
132
ty:: ty_bool. { T_bool ( ) }
133
- ty:: ty_int. { cx. int_type }
134
- ty:: ty_float. { cx. float_type }
135
- ty:: ty_uint. { cx. int_type }
136
- ty:: ty_machine ( tm) {
137
- alt tm {
138
- ast : : ty_i8. | ast:: ty_u8 . { T_i8( ) }
139
- ast:: ty_i16. | ast:: ty_u16. { T_i16 ( ) }
140
- ast:: ty_i32. | ast:: ty_u32. { T_i32 ( ) }
141
- ast:: ty_i64. | ast:: ty_u64. { T_i64 ( ) }
142
- ast:: ty_f32. { T_f32 ( ) }
143
- ast:: ty_f64. { T_f64 ( ) }
144
- }
145
- }
146
- ty:: ty_char. { T_char ( ) }
133
+ ty:: ty_int ( t) { T_int_ty ( cx, t) }
134
+ ty:: ty_uint ( t) { T_uint_ty ( cx, t) }
135
+ ty:: ty_float ( t) { T_float_ty ( cx, t) }
147
136
ty:: ty_str. { T_ptr ( T_vec ( cx, T_i8 ( ) ) ) }
148
137
ty:: ty_tag ( did, _) { type_of_tag ( cx, sp, did, t) }
149
138
ty:: ty_box ( mt) {
@@ -1516,23 +1505,10 @@ fn compare_scalar_types(cx: @block_ctxt, lhs: ValueRef, rhs: ValueRef,
1516
1505
1517
1506
alt ty:: struct ( bcx_tcx ( cx) , t) {
1518
1507
ty:: ty_nil. { ret rslt ( cx, f ( nil_type) ) ; }
1519
- ty:: ty_bool. | ty:: ty_uint. | ty:: ty_ptr ( _) | ty:: ty_char. {
1520
- ret rslt ( cx, f ( unsigned_int) ) ;
1521
- }
1522
- ty:: ty_int. { ret rslt ( cx, f ( signed_int) ) ; }
1523
- ty:: ty_float. { ret rslt ( cx, f ( floating_point) ) ; }
1524
- ty:: ty_machine ( _) {
1525
- if ty:: type_is_fp ( bcx_tcx ( cx) , t) {
1526
- // Floating point machine types
1527
- ret rslt ( cx, f ( floating_point) ) ;
1528
- } else if ty:: type_is_signed ( bcx_tcx ( cx) , t) {
1529
- // Signed, integral machine types
1530
- ret rslt ( cx, f ( signed_int) ) ;
1531
- } else {
1532
- // Unsigned, integral machine types
1533
- ret rslt ( cx, f ( unsigned_int) ) ;
1534
- }
1535
- }
1508
+ ty:: ty_bool. | ty:: ty_ptr ( _) { ret rslt ( cx, f ( unsigned_int) ) ; }
1509
+ ty:: ty_int ( _) { ret rslt ( cx, f ( signed_int) ) ; }
1510
+ ty:: ty_uint ( _) { ret rslt ( cx, f ( unsigned_int) ) ; }
1511
+ ty:: ty_float ( _) { ret rslt ( cx, f ( floating_point) ) ; }
1536
1512
ty:: ty_type. {
1537
1513
ret rslt ( trans_fail ( cx, none,
1538
1514
"attempt to compare values of type type" ) ,
@@ -2120,36 +2096,11 @@ fn store_temp_expr(cx: @block_ctxt, action: copy_action, dst: ValueRef,
2120
2096
2121
2097
fn trans_crate_lit ( cx : @crate_ctxt , lit : ast:: lit ) -> ValueRef {
2122
2098
alt lit. node {
2123
- ast:: lit_int ( i) { ret C_int ( cx, i) ; }
2124
- ast:: lit_uint ( u) { ret C_uint ( cx, u) ; }
2125
- ast:: lit_mach_int ( tm, i) {
2126
- // FIXME: the entire handling of mach types falls apart
2127
- // if target int width is larger than host, at the moment;
2128
- // re-do the mach-int types using 'big' when that works.
2129
-
2130
- let t = cx. int_type ;
2131
- let s = True ;
2132
- alt tm {
2133
- ast : : ty_u8. { t = T_i8 ( ) ; s = False ; }
2134
- ast:: ty_u16. { t = T_i16 ( ) ; s = False ; }
2135
- ast:: ty_u32. { t = T_i32 ( ) ; s = False ; }
2136
- ast:: ty_u64. { t = T_i64 ( ) ; s = False ; }
2137
- ast:: ty_i8. { t = T_i8 ( ) ; }
2138
- ast:: ty_i16. { t = T_i16 ( ) ; }
2139
- ast:: ty_i32. { t = T_i32 ( ) ; }
2140
- ast:: ty_i64. { t = T_i64 ( ) ; }
2141
- }
2142
- ret C_integral ( t, i as u64 , s) ;
2143
- }
2144
- ast:: lit_float ( fs) { ret C_float ( cx, fs) ; }
2145
- ast:: lit_mach_float ( tm, s) {
2146
- let t = cx. float_type ;
2147
- alt tm { ast : : ty_f32. { t = T_f32 ( ) ; } ast:: ty_f64. { t = T_f64 ( ) ; } }
2148
- ret C_floating ( s, t) ;
2149
- }
2150
- ast:: lit_char ( c) { ret C_integral ( T_char ( ) , c as u64 , False ) ; }
2151
- ast:: lit_bool ( b) { ret C_bool ( b) ; }
2152
- ast:: lit_nil. { ret C_nil ( ) ; }
2099
+ ast:: lit_int ( i, t) { C_integral ( T_int_ty ( cx, t) , i as u64 , True ) }
2100
+ ast:: lit_uint ( u, t) { C_integral ( T_uint_ty ( cx, t) , u, False ) }
2101
+ ast:: lit_float ( fs, t) { C_floating ( fs, T_float_ty ( cx, t) ) }
2102
+ ast:: lit_bool ( b) { C_bool ( b) }
2103
+ ast:: lit_nil. { C_nil ( ) }
2153
2104
ast:: lit_str ( s) {
2154
2105
cx. sess . span_unimpl ( lit. span , "unique string in this context" ) ;
2155
2106
}
@@ -4359,7 +4310,7 @@ fn trans_fail_expr(bcx: @block_ctxt, sp_opt: option::t<span>,
4359
4310
if ty:: type_is_str ( tcx, e_ty) {
4360
4311
let data = tvec:: get_dataptr (
4361
4312
bcx, expr_res. val , type_of_or_i8 (
4362
- bcx, ty:: mk_mach ( tcx, ast:: ty_u8) ) ) ;
4313
+ bcx, ty:: mk_mach_uint ( tcx, ast:: ty_u8) ) ) ;
4363
4314
ret trans_fail_value ( bcx, sp_opt, data) ;
4364
4315
} else if bcx. unreachable {
4365
4316
ret bcx;
0 commit comments