@@ -67,27 +67,27 @@ pub fn naked(val: ValueRef, is_naked: bool) {
67
67
Attribute :: Naked . toggle_llfn ( Function , val, is_naked) ;
68
68
}
69
69
70
- pub fn set_frame_pointer_elimination ( ccx : & CodegenCx , llfn : ValueRef ) {
70
+ pub fn set_frame_pointer_elimination ( cx : & CodegenCx , llfn : ValueRef ) {
71
71
// FIXME: #11906: Omitting frame pointers breaks retrieving the value of a
72
72
// parameter.
73
- if ccx . sess ( ) . must_not_eliminate_frame_pointers ( ) {
73
+ if cx . sess ( ) . must_not_eliminate_frame_pointers ( ) {
74
74
llvm:: AddFunctionAttrStringValue (
75
75
llfn, llvm:: AttributePlace :: Function ,
76
76
cstr ( "no-frame-pointer-elim\0 " ) , cstr ( "true\0 " ) ) ;
77
77
}
78
78
}
79
79
80
- pub fn set_probestack ( ccx : & CodegenCx , llfn : ValueRef ) {
80
+ pub fn set_probestack ( cx : & CodegenCx , llfn : ValueRef ) {
81
81
// Only use stack probes if the target specification indicates that we
82
82
// should be using stack probes
83
- if !ccx . sess ( ) . target . target . options . stack_probes {
83
+ if !cx . sess ( ) . target . target . options . stack_probes {
84
84
return
85
85
}
86
86
87
87
// Currently stack probes seem somewhat incompatible with the address
88
88
// sanitizer. With asan we're already protected from stack overflow anyway
89
89
// so we don't really need stack probes regardless.
90
- match ccx . sess ( ) . opts . debugging_opts . sanitizer {
90
+ match cx . sess ( ) . opts . debugging_opts . sanitizer {
91
91
Some ( Sanitizer :: Address ) => return ,
92
92
_ => { }
93
93
}
@@ -101,13 +101,13 @@ pub fn set_probestack(ccx: &CodegenCx, llfn: ValueRef) {
101
101
102
102
/// Composite function which sets LLVM attributes for function depending on its AST (#[attribute])
103
103
/// attributes.
104
- pub fn from_fn_attrs ( ccx : & CodegenCx , llfn : ValueRef , id : DefId ) {
104
+ pub fn from_fn_attrs ( cx : & CodegenCx , llfn : ValueRef , id : DefId ) {
105
105
use syntax:: attr:: * ;
106
- let attrs = ccx . tcx . get_attrs ( id) ;
107
- inline ( llfn, find_inline_attr ( Some ( ccx . sess ( ) . diagnostic ( ) ) , & attrs) ) ;
106
+ let attrs = cx . tcx . get_attrs ( id) ;
107
+ inline ( llfn, find_inline_attr ( Some ( cx . sess ( ) . diagnostic ( ) ) , & attrs) ) ;
108
108
109
- set_frame_pointer_elimination ( ccx , llfn) ;
110
- set_probestack ( ccx , llfn) ;
109
+ set_frame_pointer_elimination ( cx , llfn) ;
110
+ set_probestack ( cx , llfn) ;
111
111
112
112
for attr in attrs. iter ( ) {
113
113
if attr. check_name ( "cold" ) {
@@ -124,7 +124,7 @@ pub fn from_fn_attrs(ccx: &CodegenCx, llfn: ValueRef, id: DefId) {
124
124
}
125
125
}
126
126
127
- let target_features = ccx . tcx . target_features_enabled ( id) ;
127
+ let target_features = cx . tcx . target_features_enabled ( id) ;
128
128
if !target_features. is_empty ( ) {
129
129
let val = CString :: new ( target_features. join ( "," ) ) . unwrap ( ) ;
130
130
llvm:: AddFunctionAttrStringValue (
0 commit comments