@@ -9,7 +9,8 @@ use crate::spirv_type::SpirvType;
9
9
use itertools:: Itertools ;
10
10
use rspirv:: dr:: { InsertPoint , Instruction , Operand } ;
11
11
use rspirv:: spirv:: { Capability , MemoryModel , MemorySemantics , Op , Scope , StorageClass , Word } ;
12
- use rustc_apfloat:: { ieee, Float , Round , Status } ;
12
+ use rustc_apfloat:: { Float , Round , Status , ieee} ;
13
+ use rustc_codegen_ssa:: MemFlags ;
13
14
use rustc_codegen_ssa:: common:: {
14
15
AtomicOrdering , AtomicRmwBinOp , IntPredicate , RealPredicate , SynchronizationScope , TypeKind ,
15
16
} ;
@@ -19,7 +20,6 @@ use rustc_codegen_ssa::traits::BaseTypeMethods;
19
20
use rustc_codegen_ssa:: traits:: {
20
21
BackendTypes , BuilderMethods , ConstMethods , LayoutTypeMethods , OverflowOp ,
21
22
} ;
22
- use rustc_codegen_ssa:: MemFlags ;
23
23
use rustc_data_structures:: fx:: FxHashSet ;
24
24
use rustc_middle:: bug;
25
25
use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrs ;
@@ -949,12 +949,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
949
949
} ;
950
950
// TODO: rspirv doesn't have insert_variable function
951
951
let result_id = builder. id ( ) ;
952
- let inst = Instruction :: new (
953
- Op :: Variable ,
954
- Some ( ptr_ty) ,
955
- Some ( result_id) ,
956
- vec ! [ Operand :: StorageClass ( StorageClass :: Function ) ] ,
957
- ) ;
952
+ let inst = Instruction :: new ( Op :: Variable , Some ( ptr_ty) , Some ( result_id) , vec ! [
953
+ Operand :: StorageClass ( StorageClass :: Function ) ,
954
+ ] ) ;
958
955
builder. insert_into_block ( index, inst) . unwrap ( ) ;
959
956
result_id. with_type ( ptr_ty)
960
957
}
@@ -1024,16 +1021,13 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1024
1021
let ( ( line_start, col_start) , ( line_end, col_end) ) =
1025
1022
( line_col_range. start , line_col_range. end ) ;
1026
1023
1027
- self . custom_inst (
1028
- void_ty,
1029
- CustomInst :: SetDebugSrcLoc {
1030
- file : Operand :: IdRef ( file. file_name_op_string_id ) ,
1031
- line_start : Operand :: IdRef ( self . const_u32 ( line_start) . def ( self ) ) ,
1032
- line_end : Operand :: IdRef ( self . const_u32 ( line_end) . def ( self ) ) ,
1033
- col_start : Operand :: IdRef ( self . const_u32 ( col_start) . def ( self ) ) ,
1034
- col_end : Operand :: IdRef ( self . const_u32 ( col_end) . def ( self ) ) ,
1035
- } ,
1036
- ) ;
1024
+ self . custom_inst ( void_ty, CustomInst :: SetDebugSrcLoc {
1025
+ file : Operand :: IdRef ( file. file_name_op_string_id ) ,
1026
+ line_start : Operand :: IdRef ( self . const_u32 ( line_start) . def ( self ) ) ,
1027
+ line_end : Operand :: IdRef ( self . const_u32 ( line_end) . def ( self ) ) ,
1028
+ col_start : Operand :: IdRef ( self . const_u32 ( col_start) . def ( self ) ) ,
1029
+ col_end : Operand :: IdRef ( self . const_u32 ( col_end) . def ( self ) ) ,
1030
+ } ) ;
1037
1031
}
1038
1032
1039
1033
// HACK(eddyb) remove the previous instruction if made irrelevant.
@@ -1381,14 +1375,11 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1381
1375
let signed = match ty. kind ( ) {
1382
1376
ty:: Int ( _) => true ,
1383
1377
ty:: Uint ( _) => false ,
1384
- other => self . fatal ( format ! (
1385
- "Unexpected {} type: {other:#?}" ,
1386
- match oop {
1387
- OverflowOp :: Add => "checked add" ,
1388
- OverflowOp :: Sub => "checked sub" ,
1389
- OverflowOp :: Mul => "checked mul" ,
1390
- }
1391
- ) ) ,
1378
+ other => self . fatal ( format ! ( "Unexpected {} type: {other:#?}" , match oop {
1379
+ OverflowOp :: Add => "checked add" ,
1380
+ OverflowOp :: Sub => "checked sub" ,
1381
+ OverflowOp :: Mul => "checked mul" ,
1382
+ } ) ) ,
1392
1383
} ;
1393
1384
1394
1385
let result = if is_add {
0 commit comments