@@ -295,6 +295,7 @@ fn type_of_inner(@crate_ctxt cx, @typeck.ty t) -> TypeRef {
295
295
case ( ast. alias ) {
296
296
t = T_ptr ( t) ;
297
297
}
298
+ case ( _) { /* fall through */ }
298
299
}
299
300
atys += t;
300
301
}
@@ -506,6 +507,17 @@ fn iter_structural_ty(@block_ctxt cx,
506
507
i += 1 ;
507
508
}
508
509
}
510
+ case ( typeck. ty_rec ( ?fields) ) {
511
+ let int i = 0 ;
512
+ for ( typeck. field fld in fields) {
513
+ auto llfld = r. bcx. build. GEP ( v, vec( C_int ( 0 ) , C_int ( i) ) ) ;
514
+ r = f( r. bcx, llfld, fld. ty) ;
515
+ i += 1 ;
516
+ }
517
+ }
518
+ case ( _) {
519
+ cx. fcx . ccx . sess . unimpl ( "type in iter_structural_ty" ) ;
520
+ }
509
521
// FIXME: handle records and tags when we support them.
510
522
}
511
523
ret r;
@@ -560,6 +572,7 @@ fn iter_sequence(@block_ctxt cx,
560
572
auto et = typeck. plain_ty ( typeck. ty_machine ( common. ty_u8 ) ) ;
561
573
ret iter_sequence_body ( cx, v, et, f, false ) ;
562
574
}
575
+ case ( _) { fail; }
563
576
}
564
577
cx. fcx . ccx . sess . bug ( "bad type in trans.iter_sequence" ) ;
565
578
fail;
@@ -765,6 +778,7 @@ fn target_type(@crate_ctxt cx, @typeck.ty t) -> @typeck.ty {
765
778
auto tm = typeck. ty_machine ( cx. sess . get_targ_cfg ( ) . uint_type ) ;
766
779
ret @rec( struct=tm with * t) ;
767
780
}
781
+ case ( _) { /* fall through */ }
768
782
}
769
783
ret t;
770
784
}
@@ -813,8 +827,10 @@ impure fn trans_unary(@block_ctxt cx, ast.unop op,
813
827
C_int ( abi. box_rc_field_refcnt ) ) ) ;
814
828
ret res ( sub. bcx , cx. build . Store ( C_int ( 1 ) , rc) ) ;
815
829
}
830
+ case ( _) {
831
+ cx. fcx . ccx . sess . unimpl ( "expr variant in trans_unary" ) ;
832
+ }
816
833
}
817
- cx. fcx . ccx . sess . unimpl ( "expr variant in trans_unary" ) ;
818
834
fail;
819
835
}
820
836
@@ -859,6 +875,8 @@ impure fn trans_binary(@block_ctxt cx, ast.binop op,
859
875
ret join_results ( cx, T_bool ( ) ,
860
876
vec ( lhs_true_res, rhs_res) ) ;
861
877
}
878
+
879
+ case ( _) { /* fall through */ }
862
880
}
863
881
864
882
// Remaining cases are eager:
@@ -958,8 +976,11 @@ impure fn trans_binary(@block_ctxt cx, ast.binop op,
958
976
sub. val = cx. build . ICmp ( lib. llvm . LLVMIntSGT , lhs. val , sub. val ) ;
959
977
ret sub;
960
978
}
979
+
980
+ case ( _) {
981
+ cx. fcx . ccx . sess . unimpl ( "operator in trans_binary" ) ;
982
+ }
961
983
}
962
- cx. fcx . ccx . sess . unimpl ( "expr variant in trans_binary" ) ;
963
984
fail;
964
985
}
965
986
@@ -994,6 +1015,8 @@ fn join_results(@block_ctxt parent_cx,
994
1015
// onward.
995
1016
ret live. ( 0 ) ;
996
1017
}
1018
+
1019
+ case ( _) { /* fall through */ }
997
1020
}
998
1021
999
1022
// We have >1 incoming edges. Make a join block and br+phi them into it.
@@ -1020,6 +1043,7 @@ impure fn trans_if(@block_ctxt cx, @ast.expr cond,
1020
1043
case ( some[ ast. block ] ( ?eblk) ) {
1021
1044
else_res = trans_block ( else_cx, eblk) ;
1022
1045
}
1046
+ case ( _) { /* fall through */ }
1023
1047
}
1024
1048
1025
1049
cond_res. bcx . build . CondBr ( cond_res. val ,
@@ -1119,8 +1143,8 @@ fn trans_field(@block_ctxt cx, &ast.span sp, @ast.expr base,
1119
1143
auto v = r. bcx . build . GEP ( r. val , vec ( C_int ( 0 ) , C_int ( ix as int ) ) ) ;
1120
1144
ret tup( res ( r. bcx , v) , lv. _1 ) ;
1121
1145
}
1146
+ case ( _) { cx. fcx . ccx . sess . unimpl ( "field variant in trans_field" ) ; }
1122
1147
}
1123
- cx. fcx . ccx . sess . unimpl ( "field variant in trans_field" ) ;
1124
1148
fail;
1125
1149
}
1126
1150
@@ -1132,8 +1156,8 @@ fn trans_lval(@block_ctxt cx, @ast.expr e) -> tup(result, bool) {
1132
1156
case ( ast. expr_field ( ?base, ?ident, ?ann) ) {
1133
1157
ret trans_field ( cx, e. span , base, ident, ann) ;
1134
1158
}
1159
+ case ( _) { cx. fcx . ccx . sess . unimpl ( "expr variant in trans_lval" ) ; }
1135
1160
}
1136
- cx. fcx . ccx . sess . unimpl ( "expr variant in trans_lval" ) ;
1137
1161
fail;
1138
1162
}
1139
1163
@@ -1366,6 +1390,7 @@ impure fn trans_ret(@block_ctxt cx, &option.t[@ast.expr] e) -> result {
1366
1390
case ( some[ @ast. expr] ( ?x) ) {
1367
1391
r = trans_expr( cx, x) ;
1368
1392
}
1393
+ case ( _) { /* fall through */ }
1369
1394
}
1370
1395
1371
1396
// Run all cleanups and back out.
@@ -1388,6 +1413,7 @@ impure fn trans_ret(@block_ctxt cx, &option.t[@ast.expr] e) -> result {
1388
1413
r. val = r. bcx. build. Ret ( r. val) ;
1389
1414
ret r;
1390
1415
}
1416
+ case ( _) { /* fall through */ }
1391
1417
}
1392
1418
1393
1419
// FIXME: until LLVM has a unit type, we are moving around
@@ -1426,6 +1452,7 @@ impure fn trans_stmt(@block_ctxt cx, &ast.stmt s) -> result {
1426
1452
copy_ty( sub. bcx, true, llptr, sub. val,
1427
1453
typeck. expr_ty( e) ) ;
1428
1454
}
1455
+ case ( _) { /* fall through */ }
1429
1456
}
1430
1457
}
1431
1458
}
@@ -1496,8 +1523,10 @@ iter block_locals(&ast.block b) -> @ast.local {
1496
1523
case ( ast. decl_local( ?local) ) {
1497
1524
put local;
1498
1525
}
1526
+ case ( _) { /* fall through */ }
1499
1527
}
1500
1528
}
1529
+ case ( _) { /* fall through */ }
1501
1530
}
1502
1531
}
1503
1532
}
@@ -1626,6 +1655,7 @@ impure fn trans_item(@crate_ctxt cx, &ast.item item) {
1626
1655
auto sub_cx = @rec ( path=cx. path + "." + name with * cx) ;
1627
1656
trans_mod ( sub_cx, m) ;
1628
1657
}
1658
+ case ( _) { /* fall through */ }
1629
1659
}
1630
1660
}
1631
1661
@@ -1650,6 +1680,7 @@ fn collect_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt {
1650
1680
case ( ast. item_mod ( ?name, ?m, ?mid) ) {
1651
1681
cx. items . insert ( mid, i) ;
1652
1682
}
1683
+ case ( _) { /* fall through */ }
1653
1684
}
1654
1685
ret cx;
1655
1686
}
0 commit comments