@@ -7,7 +7,7 @@ use crate::type_of::{LayoutLlvmExt};
7
7
use rustc_codegen_ssa:: MemFlags ;
8
8
use rustc_codegen_ssa:: mir:: place:: PlaceRef ;
9
9
use rustc_codegen_ssa:: mir:: operand:: OperandValue ;
10
- use rustc_target:: abi:: call:: ArgType ;
10
+ use rustc_target:: abi:: call:: ArgAbi ;
11
11
12
12
use rustc_codegen_ssa:: traits:: * ;
13
13
@@ -163,7 +163,7 @@ impl LlvmType for CastTarget {
163
163
}
164
164
}
165
165
166
- pub trait ArgTypeExt < ' ll , ' tcx > {
166
+ pub trait ArgAbiExt < ' ll , ' tcx > {
167
167
fn memory_ty ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type ;
168
168
fn store (
169
169
& self ,
@@ -179,14 +179,14 @@ pub trait ArgTypeExt<'ll, 'tcx> {
179
179
) ;
180
180
}
181
181
182
- impl ArgTypeExt < ' ll , ' tcx > for ArgType < ' tcx , Ty < ' tcx > > {
182
+ impl ArgAbiExt < ' ll , ' tcx > for ArgAbi < ' tcx , Ty < ' tcx > > {
183
183
/// Gets the LLVM type for a place of the original Rust type of
184
184
/// this argument/return, i.e., the result of `type_of::type_of`.
185
185
fn memory_ty ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type {
186
186
self . layout . llvm_type ( cx)
187
187
}
188
188
189
- /// Stores a direct/indirect value described by this ArgType into a
189
+ /// Stores a direct/indirect value described by this ArgAbi into a
190
190
/// place for the original Rust type of this argument/return.
191
191
/// Can be used for both storing formal arguments into Rust variables
192
192
/// or results of call/invoke instructions into their destinations.
@@ -202,7 +202,7 @@ impl ArgTypeExt<'ll, 'tcx> for ArgType<'tcx, Ty<'tcx>> {
202
202
if self . is_sized_indirect ( ) {
203
203
OperandValue :: Ref ( val, None , self . layout . align . abi ) . store ( bx, dst)
204
204
} else if self . is_unsized_indirect ( ) {
205
- bug ! ( "unsized ArgType must be handled through store_fn_arg" ) ;
205
+ bug ! ( "unsized ArgAbi must be handled through store_fn_arg" ) ;
206
206
} else if let PassMode :: Cast ( cast) = self . mode {
207
207
// FIXME(eddyb): Figure out when the simpler Store is safe, clang
208
208
// uses it for i16 -> {i8, i8}, but not for i24 -> {i8, i8, i8}.
@@ -279,36 +279,36 @@ impl ArgTypeExt<'ll, 'tcx> for ArgType<'tcx, Ty<'tcx>> {
279
279
}
280
280
}
281
281
282
- impl ArgTypeMethods < ' tcx > for Builder < ' a , ' ll , ' tcx > {
282
+ impl ArgAbiMethods < ' tcx > for Builder < ' a , ' ll , ' tcx > {
283
283
fn store_fn_arg (
284
284
& mut self ,
285
- ty : & ArgType < ' tcx , Ty < ' tcx > > ,
285
+ arg_abi : & ArgAbi < ' tcx , Ty < ' tcx > > ,
286
286
idx : & mut usize , dst : PlaceRef < ' tcx , Self :: Value >
287
287
) {
288
- ty . store_fn_arg ( self , idx, dst)
288
+ arg_abi . store_fn_arg ( self , idx, dst)
289
289
}
290
- fn store_arg_ty (
290
+ fn store_arg (
291
291
& mut self ,
292
- ty : & ArgType < ' tcx , Ty < ' tcx > > ,
292
+ arg_abi : & ArgAbi < ' tcx , Ty < ' tcx > > ,
293
293
val : & ' ll Value ,
294
294
dst : PlaceRef < ' tcx , & ' ll Value >
295
295
) {
296
- ty . store ( self , val, dst)
296
+ arg_abi . store ( self , val, dst)
297
297
}
298
- fn memory_ty ( & self , ty : & ArgType < ' tcx , Ty < ' tcx > > ) -> & ' ll Type {
299
- ty . memory_ty ( self )
298
+ fn arg_memory_ty ( & self , arg_abi : & ArgAbi < ' tcx , Ty < ' tcx > > ) -> & ' ll Type {
299
+ arg_abi . memory_ty ( self )
300
300
}
301
301
}
302
302
303
- pub trait FnTypeLlvmExt < ' tcx > {
303
+ pub trait FnAbiLlvmExt < ' tcx > {
304
304
fn llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type ;
305
305
fn ptr_to_llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type ;
306
306
fn llvm_cconv ( & self ) -> llvm:: CallConv ;
307
307
fn apply_attrs_llfn ( & self , cx : & CodegenCx < ' ll , ' tcx > , llfn : & ' ll Value ) ;
308
308
fn apply_attrs_callsite ( & self , bx : & mut Builder < ' a , ' ll , ' tcx > , callsite : & ' ll Value ) ;
309
309
}
310
310
311
- impl < ' tcx > FnTypeLlvmExt < ' tcx > for FnType < ' tcx , Ty < ' tcx > > {
311
+ impl < ' tcx > FnAbiLlvmExt < ' tcx > for FnAbi < ' tcx , Ty < ' tcx > > {
312
312
fn llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type {
313
313
let args_capacity: usize = self . args . iter ( ) . map ( |arg|
314
314
if arg. pad . is_some ( ) { 1 } else { 0 } +
@@ -478,10 +478,10 @@ impl<'tcx> FnTypeLlvmExt<'tcx> for FnType<'tcx, Ty<'tcx>> {
478
478
impl AbiBuilderMethods < ' tcx > for Builder < ' a , ' ll , ' tcx > {
479
479
fn apply_attrs_callsite (
480
480
& mut self ,
481
- ty : & FnType < ' tcx , Ty < ' tcx > > ,
481
+ fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
482
482
callsite : Self :: Value
483
483
) {
484
- ty . apply_attrs_callsite ( self , callsite)
484
+ fn_abi . apply_attrs_callsite ( self , callsite)
485
485
}
486
486
487
487
fn get_param ( & self , index : usize ) -> Self :: Value {
0 commit comments