@@ -39,13 +39,13 @@ pub fn split_stack(val: ValueRef, set: bool) {
39
39
pub fn inline ( val : ValueRef , inline : InlineAttr ) {
40
40
use self :: InlineAttr :: * ;
41
41
match inline {
42
- Hint => llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: InlineHintAttribute ) ,
43
- Always => llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: AlwaysInlineAttribute ) ,
44
- Never => llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: NoInlineAttribute ) ,
42
+ Hint => llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: InlineHint ) ,
43
+ Always => llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: AlwaysInline ) ,
44
+ Never => llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: NoInline ) ,
45
45
None => {
46
- let attr = llvm:: Attribute :: InlineHintAttribute |
47
- llvm:: Attribute :: AlwaysInlineAttribute |
48
- llvm:: Attribute :: NoInlineAttribute ;
46
+ let attr = llvm:: Attribute :: InlineHint |
47
+ llvm:: Attribute :: AlwaysInline |
48
+ llvm:: Attribute :: NoInline ;
49
49
unsafe {
50
50
llvm:: LLVMRemoveFunctionAttr ( val, attr. bits ( ) as c_ulonglong )
51
51
}
@@ -57,12 +57,12 @@ pub fn inline(val: ValueRef, inline: InlineAttr) {
57
57
#[ inline]
58
58
pub fn emit_uwtable ( val : ValueRef , emit : bool ) {
59
59
if emit {
60
- llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: UWTableAttribute ) ;
60
+ llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: UWTable ) ;
61
61
} else {
62
62
unsafe {
63
63
llvm:: LLVMRemoveFunctionAttr (
64
64
val,
65
- llvm:: Attribute :: UWTableAttribute . bits ( ) as c_ulonglong ,
65
+ llvm:: Attribute :: UWTable . bits ( ) as c_ulonglong ,
66
66
) ;
67
67
}
68
68
}
@@ -76,11 +76,11 @@ pub fn unwind(val: ValueRef, can_unwind: bool) {
76
76
unsafe {
77
77
llvm:: LLVMRemoveFunctionAttr (
78
78
val,
79
- llvm:: Attribute :: NoUnwindAttribute . bits ( ) as c_ulonglong ,
79
+ llvm:: Attribute :: NoUnwind . bits ( ) as c_ulonglong ,
80
80
) ;
81
81
}
82
82
} else {
83
- llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: NoUnwindAttribute ) ;
83
+ llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: NoUnwind ) ;
84
84
}
85
85
}
86
86
@@ -89,12 +89,12 @@ pub fn unwind(val: ValueRef, can_unwind: bool) {
89
89
#[ allow( dead_code) ] // possibly useful function
90
90
pub fn set_optimize_for_size ( val : ValueRef , optimize : bool ) {
91
91
if optimize {
92
- llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: OptimizeForSizeAttribute ) ;
92
+ llvm:: SetFunctionAttribute ( val, llvm:: Attribute :: OptimizeForSize ) ;
93
93
} else {
94
94
unsafe {
95
95
llvm:: LLVMRemoveFunctionAttr (
96
96
val,
97
- llvm:: Attribute :: OptimizeForSizeAttribute . bits ( ) as c_ulonglong ,
97
+ llvm:: Attribute :: OptimizeForSize . bits ( ) as c_ulonglong ,
98
98
) ;
99
99
}
100
100
}
@@ -116,7 +116,7 @@ pub fn from_fn_attrs(ccx: &CrateContext, attrs: &[ast::Attribute], llfn: ValueRe
116
116
llvm:: ColdAttribute as u64 )
117
117
}
118
118
} else if attr. check_name ( "allocator" ) {
119
- llvm:: Attribute :: NoAliasAttribute . apply_llfn ( llvm:: ReturnIndex as c_uint , llfn) ;
119
+ llvm:: Attribute :: NoAlias . apply_llfn ( llvm:: ReturnIndex as c_uint , llfn) ;
120
120
}
121
121
}
122
122
}
@@ -185,9 +185,9 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
185
185
// The outptr can be noalias and nocapture because it's entirely
186
186
// invisible to the program. We also know it's nonnull as well
187
187
// as how many bytes we can dereference
188
- attrs. arg ( 1 , llvm:: Attribute :: StructRetAttribute )
189
- . arg ( 1 , llvm:: Attribute :: NoAliasAttribute )
190
- . arg ( 1 , llvm:: Attribute :: NoCaptureAttribute )
188
+ attrs. arg ( 1 , llvm:: Attribute :: StructRet )
189
+ . arg ( 1 , llvm:: Attribute :: NoAlias )
190
+ . arg ( 1 , llvm:: Attribute :: NoCapture )
191
191
. arg ( 1 , llvm:: DereferenceableAttribute ( llret_sz) ) ;
192
192
193
193
// Add one more since there's an outptr
@@ -199,7 +199,7 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
199
199
// `~` pointer return values never alias because ownership
200
200
// is transferred
201
201
ty:: ty_uniq( it) if common:: type_is_sized ( ccx. tcx ( ) , it) => {
202
- attrs. ret ( llvm:: Attribute :: NoAliasAttribute ) ;
202
+ attrs. ret ( llvm:: Attribute :: NoAlias ) ;
203
203
}
204
204
_ => { }
205
205
}
@@ -216,7 +216,7 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
216
216
}
217
217
218
218
if let ty:: ty_bool = ret_ty. sty {
219
- attrs. ret ( llvm:: Attribute :: ZExtAttribute ) ;
219
+ attrs. ret ( llvm:: Attribute :: ZExt ) ;
220
220
}
221
221
}
222
222
}
@@ -230,20 +230,20 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
230
230
// For non-immediate arguments the callee gets its own copy of
231
231
// the value on the stack, so there are no aliases. It's also
232
232
// program-invisible so can't possibly capture
233
- attrs. arg ( idx, llvm:: Attribute :: NoAliasAttribute )
234
- . arg ( idx, llvm:: Attribute :: NoCaptureAttribute )
233
+ attrs. arg ( idx, llvm:: Attribute :: NoAlias )
234
+ . arg ( idx, llvm:: Attribute :: NoCapture )
235
235
. arg ( idx, llvm:: DereferenceableAttribute ( llarg_sz) ) ;
236
236
}
237
237
238
238
ty:: ty_bool => {
239
- attrs. arg ( idx, llvm:: Attribute :: ZExtAttribute ) ;
239
+ attrs. arg ( idx, llvm:: Attribute :: ZExt ) ;
240
240
}
241
241
242
242
// `~` pointer parameters never alias because ownership is transferred
243
243
ty:: ty_uniq( inner) => {
244
244
let llsz = machine:: llsize_of_real ( ccx, type_of:: type_of ( ccx, inner) ) ;
245
245
246
- attrs. arg ( idx, llvm:: Attribute :: NoAliasAttribute )
246
+ attrs. arg ( idx, llvm:: Attribute :: NoAlias )
247
247
. arg ( idx, llvm:: DereferenceableAttribute ( llsz) ) ;
248
248
}
249
249
@@ -256,23 +256,23 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
256
256
!ty:: type_contents ( ccx. tcx ( ) , mt. ty ) . interior_unsafe ( ) => {
257
257
258
258
let llsz = machine:: llsize_of_real ( ccx, type_of:: type_of ( ccx, mt. ty ) ) ;
259
- attrs. arg ( idx, llvm:: Attribute :: NoAliasAttribute )
259
+ attrs. arg ( idx, llvm:: Attribute :: NoAlias )
260
260
. arg ( idx, llvm:: DereferenceableAttribute ( llsz) ) ;
261
261
262
262
if mt. mutbl == ast:: MutImmutable {
263
- attrs. arg ( idx, llvm:: Attribute :: ReadOnlyAttribute ) ;
263
+ attrs. arg ( idx, llvm:: Attribute :: ReadOnly ) ;
264
264
}
265
265
266
266
if let ReLateBound ( _, BrAnon ( _) ) = * b {
267
- attrs. arg ( idx, llvm:: Attribute :: NoCaptureAttribute ) ;
267
+ attrs. arg ( idx, llvm:: Attribute :: NoCapture ) ;
268
268
}
269
269
}
270
270
271
271
// When a reference in an argument has no named lifetime, it's impossible for that
272
272
// reference to escape this function (returned or stored beyond the call by a closure).
273
273
ty:: ty_rptr( & ReLateBound ( _, BrAnon ( _) ) , mt) => {
274
274
let llsz = machine:: llsize_of_real ( ccx, type_of:: type_of ( ccx, mt. ty ) ) ;
275
- attrs. arg ( idx, llvm:: Attribute :: NoCaptureAttribute )
275
+ attrs. arg ( idx, llvm:: Attribute :: NoCapture )
276
276
. arg ( idx, llvm:: DereferenceableAttribute ( llsz) ) ;
277
277
}
278
278
0 commit comments