@@ -9,7 +9,8 @@ use crate::spirv_type::SpirvType;
99use itertools:: Itertools ;
1010use rspirv:: dr:: { InsertPoint , Instruction , Operand } ;
1111use 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 ;
1314use rustc_codegen_ssa:: common:: {
1415 AtomicOrdering , AtomicRmwBinOp , IntPredicate , RealPredicate , SynchronizationScope , TypeKind ,
1516} ;
@@ -19,7 +20,6 @@ use rustc_codegen_ssa::traits::BaseTypeMethods;
1920use rustc_codegen_ssa:: traits:: {
2021 BackendTypes , BuilderMethods , ConstMethods , LayoutTypeMethods , OverflowOp ,
2122} ;
22- use rustc_codegen_ssa:: MemFlags ;
2323use rustc_data_structures:: fx:: FxHashSet ;
2424use rustc_middle:: bug;
2525use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrs ;
@@ -949,12 +949,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
949949 } ;
950950 // TODO: rspirv doesn't have insert_variable function
951951 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+ ] ) ;
958955 builder. insert_into_block ( index, inst) . unwrap ( ) ;
959956 result_id. with_type ( ptr_ty)
960957 }
@@ -1024,16 +1021,13 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
10241021 let ( ( line_start, col_start) , ( line_end, col_end) ) =
10251022 ( line_col_range. start , line_col_range. end ) ;
10261023
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+ } ) ;
10371031 }
10381032
10391033 // HACK(eddyb) remove the previous instruction if made irrelevant.
@@ -1381,14 +1375,11 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
13811375 let signed = match ty. kind ( ) {
13821376 ty:: Int ( _) => true ,
13831377 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+ } ) ) ,
13921383 } ;
13931384
13941385 let result = if is_add {
0 commit comments