@@ -426,7 +426,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
426
426
match int_type_width_signed ( ty, self ) {
427
427
Some ( ( width, signed) ) => match name {
428
428
sym:: ctlz | sym:: cttz => {
429
- let func = self . current_func . borrow ( ) . expect ( "func" ) ;
429
+ let func = self . current_func ( ) ;
430
430
let then_block = func. new_block ( "then" ) ;
431
431
let else_block = func. new_block ( "else" ) ;
432
432
let after_block = func. new_block ( "after" ) ;
@@ -1108,7 +1108,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
1108
1108
// for (int counter = 0; value != 0; counter++) {
1109
1109
// value &= value - 1;
1110
1110
// }
1111
- let func = self . current_func . borrow ( ) . expect ( "func" ) ;
1111
+ let func = self . current_func ( ) ;
1112
1112
let loop_head = func. new_block ( "head" ) ;
1113
1113
let loop_body = func. new_block ( "body" ) ;
1114
1114
let loop_tail = func. new_block ( "tail" ) ;
@@ -1187,7 +1187,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
1187
1187
let result_type = lhs. get_type ( ) ;
1188
1188
if signed {
1189
1189
// Based on algorithm from: https://stackoverflow.com/a/56531252/389119
1190
- let func = self . current_func . borrow ( ) . expect ( "func" ) ;
1190
+ let func = self . current_func ( ) ;
1191
1191
let res = func. new_local ( self . location , result_type, "saturating_sum" ) ;
1192
1192
let supports_native_type = self . is_native_int_type ( result_type) ;
1193
1193
let overflow = if supports_native_type {
@@ -1258,7 +1258,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
1258
1258
let result_type = lhs. get_type ( ) ;
1259
1259
if signed {
1260
1260
// Based on algorithm from: https://stackoverflow.com/a/56531252/389119
1261
- let func = self . current_func . borrow ( ) . expect ( "func" ) ;
1261
+ let func = self . current_func ( ) ;
1262
1262
let res = func. new_local ( self . location , result_type, "saturating_diff" ) ;
1263
1263
let supports_native_type = self . is_native_int_type ( result_type) ;
1264
1264
let overflow = if supports_native_type {
0 commit comments