@@ -27,12 +27,17 @@ use crate::llvm::{self, Attribute, AttributePlace, Type, Value};
2727use crate :: type_of:: LayoutLlvmExt ;
2828
2929trait ArgAttributesExt {
30- fn apply_attrs_to_llfn ( & self , idx : AttributePlace , cx : & CodegenCx < ' _ , ' _ > , llfn : & Value ) ;
31- fn apply_attrs_to_callsite (
30+ fn apply_attrs_to_llfn < ' ll > (
3231 & self ,
3332 idx : AttributePlace ,
34- cx : & CodegenCx < ' _ , ' _ > ,
35- callsite : & Value ,
33+ cx : & CodegenCx < ' ll , ' _ > ,
34+ llfn : Value < ' ll > ,
35+ ) ;
36+ fn apply_attrs_to_callsite < ' ll > (
37+ & self ,
38+ idx : AttributePlace ,
39+ cx : & CodegenCx < ' ll , ' _ > ,
40+ callsite : Value < ' ll > ,
3641 ) ;
3742}
3843
@@ -116,16 +121,21 @@ fn get_attrs<'ll>(this: &ArgAttributes, cx: &CodegenCx<'ll, '_>) -> SmallVec<[&'
116121}
117122
118123impl ArgAttributesExt for ArgAttributes {
119- fn apply_attrs_to_llfn ( & self , idx : AttributePlace , cx : & CodegenCx < ' _ , ' _ > , llfn : & Value ) {
124+ fn apply_attrs_to_llfn < ' ll > (
125+ & self ,
126+ idx : AttributePlace ,
127+ cx : & CodegenCx < ' ll , ' _ > ,
128+ llfn : Value < ' ll > ,
129+ ) {
120130 let attrs = get_attrs ( self , cx) ;
121131 attributes:: apply_to_llfn ( llfn, idx, & attrs) ;
122132 }
123133
124- fn apply_attrs_to_callsite (
134+ fn apply_attrs_to_callsite < ' ll > (
125135 & self ,
126136 idx : AttributePlace ,
127- cx : & CodegenCx < ' _ , ' _ > ,
128- callsite : & Value ,
137+ cx : & CodegenCx < ' ll , ' _ > ,
138+ callsite : Value < ' ll > ,
129139 ) {
130140 let attrs = get_attrs ( self , cx) ;
131141 attributes:: apply_to_callsite ( callsite, idx, & attrs) ;
@@ -236,14 +246,14 @@ trait ArgAbiExt<'ll, 'tcx> {
236246 fn store (
237247 & self ,
238248 bx : & mut Builder < ' _ , ' ll , ' tcx > ,
239- val : & ' ll Value ,
240- dst : PlaceRef < ' tcx , & ' ll Value > ,
249+ val : Value < ' ll > ,
250+ dst : PlaceRef < ' tcx , Value < ' ll > > ,
241251 ) ;
242252 fn store_fn_arg (
243253 & self ,
244254 bx : & mut Builder < ' _ , ' ll , ' tcx > ,
245255 idx : & mut usize ,
246- dst : PlaceRef < ' tcx , & ' ll Value > ,
256+ dst : PlaceRef < ' tcx , Value < ' ll > > ,
247257 ) ;
248258}
249259
@@ -255,8 +265,8 @@ impl<'ll, 'tcx> ArgAbiExt<'ll, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
255265 fn store (
256266 & self ,
257267 bx : & mut Builder < ' _ , ' ll , ' tcx > ,
258- val : & ' ll Value ,
259- dst : PlaceRef < ' tcx , & ' ll Value > ,
268+ val : Value < ' ll > ,
269+ dst : PlaceRef < ' tcx , Value < ' ll > > ,
260270 ) {
261271 match & self . mode {
262272 PassMode :: Ignore => { }
@@ -310,7 +320,7 @@ impl<'ll, 'tcx> ArgAbiExt<'ll, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
310320 & self ,
311321 bx : & mut Builder < ' _ , ' ll , ' tcx > ,
312322 idx : & mut usize ,
313- dst : PlaceRef < ' tcx , & ' ll Value > ,
323+ dst : PlaceRef < ' tcx , Value < ' ll > > ,
314324 ) {
315325 let mut next = || {
316326 let val = llvm:: get_param ( bx. llfn ( ) , * idx as c_uint ) ;
@@ -347,8 +357,8 @@ impl<'ll, 'tcx> ArgAbiBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
347357 fn store_arg (
348358 & mut self ,
349359 arg_abi : & ArgAbi < ' tcx , Ty < ' tcx > > ,
350- val : & ' ll Value ,
351- dst : PlaceRef < ' tcx , & ' ll Value > ,
360+ val : Value < ' ll > ,
361+ dst : PlaceRef < ' tcx , Value < ' ll > > ,
352362 ) {
353363 arg_abi. store ( self , val, dst)
354364 }
@@ -363,12 +373,12 @@ pub(crate) trait FnAbiLlvmExt<'ll, 'tcx> {
363373 fn apply_attrs_llfn (
364374 & self ,
365375 cx : & CodegenCx < ' ll , ' tcx > ,
366- llfn : & ' ll Value ,
376+ llfn : Value < ' ll > ,
367377 instance : Option < ty:: Instance < ' tcx > > ,
368378 ) ;
369379
370380 /// Apply attributes to a function call.
371- fn apply_attrs_callsite ( & self , bx : & mut Builder < ' _ , ' ll , ' tcx > , callsite : & ' ll Value ) ;
381+ fn apply_attrs_callsite ( & self , bx : & mut Builder < ' _ , ' ll , ' tcx > , callsite : Value < ' ll > ) ;
372382}
373383
374384impl < ' ll , ' tcx > FnAbiLlvmExt < ' ll , ' tcx > for FnAbi < ' tcx , Ty < ' tcx > > {
@@ -470,7 +480,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
470480 fn apply_attrs_llfn (
471481 & self ,
472482 cx : & CodegenCx < ' ll , ' tcx > ,
473- llfn : & ' ll Value ,
483+ llfn : Value < ' ll > ,
474484 instance : Option < ty:: Instance < ' tcx > > ,
475485 ) {
476486 let mut func_attrs = SmallVec :: < [ _ ; 3 ] > :: new ( ) ;
@@ -648,7 +658,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
648658 }
649659 }
650660
651- fn apply_attrs_callsite ( & self , bx : & mut Builder < ' _ , ' ll , ' tcx > , callsite : & ' ll Value ) {
661+ fn apply_attrs_callsite ( & self , bx : & mut Builder < ' _ , ' ll , ' tcx > , callsite : Value < ' ll > ) {
652662 let mut func_attrs = SmallVec :: < [ _ ; 2 ] > :: new ( ) ;
653663 if self . ret . layout . is_uninhabited ( ) {
654664 func_attrs. push ( llvm:: AttributeKind :: NoReturn . create_attr ( bx. cx . llcx ) ) ;
@@ -659,7 +669,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
659669 attributes:: apply_to_callsite ( callsite, llvm:: AttributePlace :: Function , & { func_attrs } ) ;
660670
661671 let mut i = 0 ;
662- let mut apply = |cx : & CodegenCx < ' _ , ' _ > , attrs : & ArgAttributes | {
672+ let mut apply = |cx : & CodegenCx < ' ll , ' _ > , attrs : & ArgAttributes | {
663673 attrs. apply_attrs_to_callsite ( llvm:: AttributePlace :: Argument ( i) , cx, callsite) ;
664674 i += 1 ;
665675 i - 1
0 commit comments