@@ -212,7 +212,7 @@ impl ArgTypeExt<'ll, 'tcx> for ArgType<'tcx, Ty<'tcx>> {
212
212
// uses it for i16 -> {i8, i8}, but not for i24 -> {i8, i8, i8}.
213
213
let can_store_through_cast_ptr = false ;
214
214
if can_store_through_cast_ptr {
215
- let cast_ptr_llty = bx. cx ( ) . type_ptr_to ( cast. llvm_type ( bx. cx ( ) ) ) ;
215
+ let cast_ptr_llty = bx. type_ptr_to ( cast. llvm_type ( bx) ) ;
216
216
let cast_dst = bx. pointercast ( dst. llval , cast_ptr_llty) ;
217
217
bx. store ( val, cast_dst, self . layout . align . abi ) ;
218
218
} else {
@@ -231,9 +231,9 @@ impl ArgTypeExt<'ll, 'tcx> for ArgType<'tcx, Ty<'tcx>> {
231
231
// bitcasting to the struct type yields invalid cast errors.
232
232
233
233
// We instead thus allocate some scratch space...
234
- let scratch_size = cast. size ( bx. cx ( ) ) ;
235
- let scratch_align = cast. align ( bx. cx ( ) ) ;
236
- let llscratch = bx. alloca ( cast. llvm_type ( bx. cx ( ) ) , "abi_cast" , scratch_align) ;
234
+ let scratch_size = cast. size ( bx) ;
235
+ let scratch_align = cast. align ( bx) ;
236
+ let llscratch = bx. alloca ( cast. llvm_type ( bx) , "abi_cast" , scratch_align) ;
237
237
bx. lifetime_start ( llscratch, scratch_size) ;
238
238
239
239
// ...where we first store the value...
@@ -245,7 +245,7 @@ impl ArgTypeExt<'ll, 'tcx> for ArgType<'tcx, Ty<'tcx>> {
245
245
self . layout . align . abi ,
246
246
llscratch,
247
247
scratch_align,
248
- bx. cx ( ) . const_usize ( self . layout . size . bytes ( ) ) ,
248
+ bx. const_usize ( self . layout . size . bytes ( ) ) ,
249
249
MemFlags :: empty ( )
250
250
) ;
251
251
@@ -299,7 +299,7 @@ impl ArgTypeMethods<'tcx> for Builder<'a, 'll, 'tcx> {
299
299
ty. store ( self , val, dst)
300
300
}
301
301
fn memory_ty ( & self , ty : & ArgType < ' tcx , Ty < ' tcx > > ) -> & ' ll Type {
302
- ty. memory_ty ( self . cx ( ) )
302
+ ty. memory_ty ( self )
303
303
}
304
304
}
305
305
@@ -780,7 +780,7 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> {
780
780
// by the LLVM verifier.
781
781
if let layout:: Int ( ..) = scalar. value {
782
782
if !scalar. is_bool ( ) {
783
- let range = scalar. valid_range_exclusive ( bx. cx ( ) ) ;
783
+ let range = scalar. valid_range_exclusive ( bx) ;
784
784
if range. start != range. end {
785
785
bx. range_metadata ( callsite, range) ;
786
786
}
0 commit comments