@@ -7,7 +7,8 @@ use gccjit::{
7
7
BinaryOp , Block , ComparisonOp , Context , Function , LValue , Location , RValue , ToRValue , Type ,
8
8
UnaryOp ,
9
9
} ;
10
- use rustc_apfloat:: { ieee, Float , Round , Status } ;
10
+ use rustc_apfloat:: { Float , Round , Status , ieee} ;
11
+ use rustc_codegen_ssa:: MemFlags ;
11
12
use rustc_codegen_ssa:: common:: {
12
13
AtomicOrdering , AtomicRmwBinOp , IntPredicate , RealPredicate , SynchronizationScope , TypeKind ,
13
14
} ;
@@ -17,21 +18,20 @@ use rustc_codegen_ssa::traits::{
17
18
BackendTypes , BaseTypeCodegenMethods , BuilderMethods , ConstCodegenMethods ,
18
19
LayoutTypeCodegenMethods , OverflowOp , StaticBuilderMethods ,
19
20
} ;
20
- use rustc_codegen_ssa:: MemFlags ;
21
21
use rustc_data_structures:: fx:: FxHashSet ;
22
22
use rustc_middle:: bug;
23
23
use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrs ;
24
24
use rustc_middle:: ty:: layout:: {
25
25
FnAbiError , FnAbiOfHelpers , FnAbiRequest , HasParamEnv , HasTyCtxt , LayoutError , LayoutOfHelpers ,
26
26
} ;
27
27
use rustc_middle:: ty:: { Instance , ParamEnv , Ty , TyCtxt } ;
28
- use rustc_span:: def_id:: DefId ;
29
28
use rustc_span:: Span ;
29
+ use rustc_span:: def_id:: DefId ;
30
30
use rustc_target:: abi:: call:: FnAbi ;
31
31
use rustc_target:: abi:: { self , Align , HasDataLayout , Size , TargetDataLayout , WrappingRange } ;
32
32
use rustc_target:: spec:: { HasTargetSpec , HasWasmCAbiOpt , Target , WasmCAbi } ;
33
33
34
- use crate :: common:: { type_is_pointer , SignType , TypeReflection } ;
34
+ use crate :: common:: { SignType , TypeReflection , type_is_pointer } ;
35
35
use crate :: context:: CodegenCx ;
36
36
use crate :: intrinsic:: llvm;
37
37
use crate :: type_of:: LayoutGccExt ;
@@ -152,11 +152,14 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
152
152
// NOTE: not sure why, but we have the wrong type here.
153
153
let int_type = compare_exchange. get_param ( 2 ) . to_rvalue ( ) . get_type ( ) ;
154
154
let src = self . context . new_bitcast ( self . location , src, int_type) ;
155
- self . context . new_call (
156
- self . location ,
157
- compare_exchange,
158
- & [ dst, expected, src, weak, order, failure_order] ,
159
- )
155
+ self . context . new_call ( self . location , compare_exchange, & [
156
+ dst,
157
+ expected,
158
+ src,
159
+ weak,
160
+ order,
161
+ failure_order,
162
+ ] )
160
163
}
161
164
162
165
pub fn assign ( & self , lvalue : LValue < ' gcc > , value : RValue < ' gcc > ) {
@@ -1079,11 +1082,9 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
1079
1082
let align = dest. val . align . restrict_for_offset ( dest. layout . field ( self . cx ( ) , 0 ) . size ) ;
1080
1083
cg_elem. val . store ( self , PlaceRef :: new_sized_aligned ( current_val, cg_elem. layout , align) ) ;
1081
1084
1082
- let next = self . inbounds_gep (
1083
- self . backend_type ( cg_elem. layout ) ,
1084
- current. to_rvalue ( ) ,
1085
- & [ self . const_usize ( 1 ) ] ,
1086
- ) ;
1085
+ let next = self . inbounds_gep ( self . backend_type ( cg_elem. layout ) , current. to_rvalue ( ) , & [
1086
+ self . const_usize ( 1 ) ,
1087
+ ] ) ;
1087
1088
self . llbb ( ) . add_assignment ( self . location , current, next) ;
1088
1089
self . br ( header_bb) ;
1089
1090
0 commit comments