@@ -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 }
@@ -55,7 +55,7 @@ fn inline_attr<'ll>(cx: &CodegenCx<'ll, '_>, inline: InlineAttr) -> Option<&'ll
5555
5656/// Get LLVM sanitize attributes.
5757#[ inline]
58- pub fn sanitize_attrs < ' ll > (
58+ pub ( crate ) fn sanitize_attrs < ' ll > (
5959 cx : & CodegenCx < ' ll , ' _ > ,
6060 no_sanitize : SanitizerSet ,
6161) -> SmallVec < [ & ' ll Attribute ; 4 ] > {
@@ -95,15 +95,15 @@ pub fn sanitize_attrs<'ll>(
9595
9696/// Tell LLVM to emit or not emit the information necessary to unwind the stack for the function.
9797#[ inline]
98- pub fn uwtable_attr ( llcx : & llvm:: Context , use_sync_unwind : Option < bool > ) -> & Attribute {
98+ pub ( crate ) fn uwtable_attr ( llcx : & llvm:: Context , use_sync_unwind : Option < bool > ) -> & Attribute {
9999 // NOTE: We should determine if we even need async unwind tables, as they
100100 // take have more overhead and if we can use sync unwind tables we
101101 // probably should.
102102 let async_unwind = !use_sync_unwind. unwrap_or ( false ) ;
103103 llvm:: CreateUWTableAttr ( llcx, async_unwind)
104104}
105105
106- pub fn frame_pointer_type_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
106+ pub ( crate ) fn frame_pointer_type_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
107107 let mut fp = cx. sess ( ) . target . frame_pointer ;
108108 let opts = & cx. sess ( ) . opts ;
109109 // "mcount" function relies on stack pointer.
@@ -243,19 +243,19 @@ fn stackprotector_attr<'ll>(cx: &CodegenCx<'ll, '_>) -> Option<&'ll Attribute> {
243243 Some ( sspattr. create_attr ( cx. llcx ) )
244244}
245245
246- pub fn target_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> & ' ll Attribute {
246+ pub ( crate ) fn target_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> & ' ll Attribute {
247247 let target_cpu = llvm_util:: target_cpu ( cx. tcx . sess ) ;
248248 llvm:: CreateAttrStringValue ( cx. llcx , "target-cpu" , target_cpu)
249249}
250250
251- pub fn tune_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
251+ pub ( crate ) fn tune_cpu_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
252252 llvm_util:: tune_cpu ( cx. tcx . sess )
253253 . map ( |tune_cpu| llvm:: CreateAttrStringValue ( cx. llcx , "tune-cpu" , tune_cpu) )
254254}
255255
256256/// Get the `NonLazyBind` LLVM attribute,
257257/// if the codegen options allow skipping the PLT.
258- pub fn non_lazy_bind_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
258+ pub ( crate ) fn non_lazy_bind_attr < ' ll > ( cx : & CodegenCx < ' ll , ' _ > ) -> Option < & ' ll Attribute > {
259259 // Don't generate calls through PLT if it's not necessary
260260 if !cx. sess ( ) . needs_plt ( ) {
261261 Some ( AttributeKind :: NonLazyBind . create_attr ( cx. llcx ) )
@@ -289,7 +289,7 @@ fn create_alloc_family_attr(llcx: &llvm::Context) -> &llvm::Attribute {
289289
290290/// Composite function which sets LLVM attributes for function depending on its AST (`#[attribute]`)
291291/// attributes.
292- pub fn from_fn_attrs < ' ll , ' tcx > (
292+ pub ( crate ) fn from_fn_attrs < ' ll , ' tcx > (
293293 cx : & CodegenCx < ' ll , ' tcx > ,
294294 llfn : & ' ll Value ,
295295 instance : ty:: Instance < ' tcx > ,
0 commit comments