@@ -15,18 +15,18 @@ use crate::errors::{MissingFeatures, SanitizerMemtagRequiresMte, TargetFeatureDi
1515use crate :: llvm:: AttributePlace :: Function ;
1616use crate :: llvm:: { self , AllocKindFlags , Attribute , AttributeKind , AttributePlace , MemoryEffects } ;
1717use crate :: llvm_util;
18- pub use rustc_attr:: { InlineAttr , InstructionSetAttr , OptimizeAttr } ;
18+ use rustc_attr:: { InlineAttr , InstructionSetAttr , OptimizeAttr } ;
1919
2020use crate :: context:: CodegenCx ;
2121use crate :: value:: Value ;
2222
23- pub fn apply_to_llfn ( llfn : & Value , idx : AttributePlace , attrs : & [ & Attribute ] ) {
23+ pub ( crate ) fn apply_to_llfn ( llfn : & Value , idx : AttributePlace , attrs : & [ & Attribute ] ) {
2424 if !attrs. is_empty ( ) {
2525 llvm:: AddFunctionAttributes ( llfn, idx, attrs) ;
2626 }
2727}
2828
29- pub fn apply_to_callsite ( callsite : & Value , idx : AttributePlace , attrs : & [ & Attribute ] ) {
29+ pub ( crate ) fn apply_to_callsite ( callsite : & Value , idx : AttributePlace , attrs : & [ & Attribute ] ) {
3030 if !attrs. is_empty ( ) {
3131 llvm:: AddCallSiteAttributes ( callsite, idx, attrs) ;
3232 }
@@ -83,7 +83,7 @@ fn patchable_function_entry_attrs<'ll>(
8383
8484/// Get LLVM sanitize attributes.
8585#[ inline]
86- pub fn sanitize_attrs < ' ll > (
86+ pub ( crate ) fn sanitize_attrs < ' ll > (
8787 cx : & CodegenCx < ' ll , ' _ > ,
8888 no_sanitize : SanitizerSet ,
8989) -> SmallVec < [ & ' ll Attribute ; 4 ] > {
@@ -123,15 +123,15 @@ pub fn sanitize_attrs<'ll>(
123123
124124/// Tell LLVM to emit or not emit the information necessary to unwind the stack for the function.
125125#[ inline]
126- pub fn uwtable_attr ( llcx : & llvm:: Context , use_sync_unwind : Option < bool > ) -> & Attribute {
126+ pub ( crate ) fn uwtable_attr ( llcx : & llvm:: Context , use_sync_unwind : Option < bool > ) -> & Attribute {
127127 // NOTE: We should determine if we even need async unwind tables, as they
128128 // take have more overhead and if we can use sync unwind tables we
129129 // probably should.
130130 let async_unwind = !use_sync_unwind. unwrap_or ( false ) ;
131131 llvm:: CreateUWTableAttr ( llcx, async_unwind)
132132}
133133
134- pub fn frame_pointer_type_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
134+ pub ( crate ) fn frame_pointer_type_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
135135 let mut fp = cx. sess ( ) . target . frame_pointer ;
136136 let opts = & cx. sess ( ) . opts ;
137137 // "mcount" function relies on stack pointer.
@@ -272,19 +272,19 @@ fn stackprotector_attr<'ll>(cx: &CodegenCx<'ll, '_>) -> Option<&'ll Attribute> {
272272 Some ( sspattr. create_attr ( cx. llcx ) )
273273}
274274
275- pub fn target_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> & ' ll Attribute {
275+ pub ( crate ) fn target_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> & ' ll Attribute {
276276 let target_cpu = llvm_util:: target_cpu ( cx. tcx . sess ) ;
277277 llvm:: CreateAttrStringValue ( cx. llcx , "target-cpu" , target_cpu)
278278}
279279
280- pub fn tune_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
280+ pub ( crate ) fn tune_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
281281 llvm_util:: tune_cpu ( cx. tcx . sess )
282282 . map ( |tune_cpu| llvm:: CreateAttrStringValue ( cx. llcx , "tune-cpu" , tune_cpu) )
283283}
284284
285285/// Get the `NonLazyBind` LLVM attribute,
286286/// if the codegen options allow skipping the PLT.
287- pub fn non_lazy_bind_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
287+ pub ( crate ) fn non_lazy_bind_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
288288 // Don't generate calls through PLT if it's not necessary
289289 if !cx. sess ( ) . needs_plt ( ) {
290290 Some ( AttributeKind :: NonLazyBind . create_attr ( cx. llcx ) )
@@ -318,7 +318,7 @@ fn create_alloc_family_attr(llcx: &llvm::Context) -> &llvm::Attribute {
318318
319319/// Composite function which sets LLVM attributes for function depending on its AST (`#[attribute]`)
320320/// attributes.
321- pub fn from_fn_attrs < ' ll , ' tcx > (
321+ pub ( crate ) fn from_fn_attrs < ' ll , ' tcx > (
322322 cx : & CodegenCx < ' ll , ' tcx > ,
323323 llfn : & ' ll Value ,
324324 instance : ty:: Instance < ' tcx > ,
0 commit comments