@@ -25,7 +25,7 @@ use crate::value::Value;
2525
2626/// Mark LLVM function to use provided inline heuristic.
2727#[ inline]
28- fn inline ( cx : & CodegenCx < ' ll , ' _ > , val : & ' ll Value , inline : InlineAttr ) {
28+ fn inline < ' ll > ( cx : & CodegenCx < ' ll , ' _ > , val : & ' ll Value , inline : InlineAttr ) {
2929 use self :: InlineAttr :: * ;
3030 match inline {
3131 Hint => Attribute :: InlineHint . apply_llfn ( Function , val) ,
@@ -41,7 +41,7 @@ fn inline(cx: &CodegenCx<'ll, '_>, val: &'ll Value, inline: InlineAttr) {
4141
4242/// Apply LLVM sanitize attributes.
4343#[ inline]
44- pub fn sanitize ( cx : & CodegenCx < ' ll , ' _ > , no_sanitize : SanitizerSet , llfn : & ' ll Value ) {
44+ pub fn sanitize < ' ll > ( cx : & CodegenCx < ' ll , ' _ > , no_sanitize : SanitizerSet , llfn : & ' ll Value ) {
4545 let enabled = cx. tcx . sess . opts . debugging_opts . sanitizer - no_sanitize;
4646 if enabled. contains ( SanitizerSet :: ADDRESS ) {
4747 llvm:: Attribute :: SanitizeAddress . apply_llfn ( Function , llfn) ;
@@ -59,17 +59,17 @@ pub fn sanitize(cx: &CodegenCx<'ll, '_>, no_sanitize: SanitizerSet, llfn: &'ll V
5959
6060/// Tell LLVM to emit or not emit the information necessary to unwind the stack for the function.
6161#[ inline]
62- pub fn emit_uwtable ( val : & ' ll Value , emit : bool ) {
62+ pub fn emit_uwtable ( val : & Value , emit : bool ) {
6363 Attribute :: UWTable . toggle_llfn ( Function , val, emit) ;
6464}
6565
6666/// Tell LLVM if this function should be 'naked', i.e., skip the epilogue and prologue.
6767#[ inline]
68- fn naked ( val : & ' ll Value , is_naked : bool ) {
68+ fn naked ( val : & Value , is_naked : bool ) {
6969 Attribute :: Naked . toggle_llfn ( Function , val, is_naked) ;
7070}
7171
72- pub fn set_frame_pointer_type ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
72+ pub fn set_frame_pointer_type < ' ll > ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
7373 let mut fp = cx. sess ( ) . target . frame_pointer ;
7474 // "mcount" function relies on stack pointer.
7575 // See <https://sourceware.org/binutils/docs/gprof/Implementation.html>.
@@ -92,7 +92,7 @@ pub fn set_frame_pointer_type(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
9292
9393/// Tell LLVM what instrument function to insert.
9494#[ inline]
95- fn set_instrument_function ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
95+ fn set_instrument_function < ' ll > ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
9696 if cx. sess ( ) . instrument_mcount ( ) {
9797 // Similar to `clang -pg` behavior. Handled by the
9898 // `post-inline-ee-instrument` LLVM pass.
@@ -110,7 +110,7 @@ fn set_instrument_function(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
110110 }
111111}
112112
113- fn set_probestack ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
113+ fn set_probestack < ' ll > ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
114114 // Currently stack probes seem somewhat incompatible with the address
115115 // sanitizer and thread sanitizer. With asan we're already protected from
116116 // stack overflow anyway so we don't really need stack probes regardless.
@@ -161,7 +161,7 @@ fn set_probestack(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
161161 }
162162}
163163
164- fn set_stackprotector ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
164+ fn set_stackprotector < ' ll > ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
165165 let sspattr = match cx. sess ( ) . stack_protector ( ) {
166166 StackProtector :: None => return ,
167167 StackProtector :: All => Attribute :: StackProtectReq ,
@@ -172,7 +172,7 @@ fn set_stackprotector(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
172172 sspattr. apply_llfn ( Function , llfn)
173173}
174174
175- pub fn apply_target_cpu_attr ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
175+ pub fn apply_target_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
176176 let target_cpu = SmallCStr :: new ( llvm_util:: target_cpu ( cx. tcx . sess ) ) ;
177177 llvm:: AddFunctionAttrStringValue (
178178 llfn,
@@ -182,7 +182,7 @@ pub fn apply_target_cpu_attr(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
182182 ) ;
183183}
184184
185- pub fn apply_tune_cpu_attr ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
185+ pub fn apply_tune_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > , llfn : & ' ll Value ) {
186186 if let Some ( tune) = llvm_util:: tune_cpu ( cx. tcx . sess ) {
187187 let tune_cpu = SmallCStr :: new ( tune) ;
188188 llvm:: AddFunctionAttrStringValue (
@@ -196,14 +196,14 @@ pub fn apply_tune_cpu_attr(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
196196
197197/// Sets the `NonLazyBind` LLVM attribute on a given function,
198198/// assuming the codegen options allow skipping the PLT.
199- pub fn non_lazy_bind ( sess : & Session , llfn : & ' ll Value ) {
199+ pub fn non_lazy_bind < ' ll > ( sess : & Session , llfn : & ' ll Value ) {
200200 // Don't generate calls through PLT if it's not necessary
201201 if !sess. needs_plt ( ) {
202202 Attribute :: NonLazyBind . apply_llfn ( Function , llfn) ;
203203 }
204204}
205205
206- pub ( crate ) fn default_optimisation_attrs ( sess : & Session , llfn : & ' ll Value ) {
206+ pub ( crate ) fn default_optimisation_attrs < ' ll > ( sess : & Session , llfn : & ' ll Value ) {
207207 match sess. opts . optimize {
208208 OptLevel :: Size => {
209209 llvm:: Attribute :: MinSize . unapply_llfn ( Function , llfn) ;
@@ -226,7 +226,11 @@ pub(crate) fn default_optimisation_attrs(sess: &Session, llfn: &'ll Value) {
226226
227227/// Composite function which sets LLVM attributes for function depending on its AST (`#[attribute]`)
228228/// attributes.
229- pub fn from_fn_attrs ( cx : & CodegenCx < ' ll , ' tcx > , llfn : & ' ll Value , instance : ty:: Instance < ' tcx > ) {
229+ pub fn from_fn_attrs < ' ll , ' tcx > (
230+ cx : & CodegenCx < ' ll , ' tcx > ,
231+ llfn : & ' ll Value ,
232+ instance : ty:: Instance < ' tcx > ,
233+ ) {
230234 let codegen_fn_attrs = cx. tcx . codegen_fn_attrs ( instance. def_id ( ) ) ;
231235
232236 match codegen_fn_attrs. optimize {
0 commit comments