File tree 2 files changed +14
-1
lines changed 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ pub enum Attribute {
87
87
NonLazyBindAttribute = 1 << 31 ,
88
88
89
89
// Not added to LLVM yet, so may need to stay updated if LLVM changes.
90
+ // FIXME(#8199): if this changes, be sure to change the relevant constant
91
+ // down below
90
92
FixedStackSegment = 1 << 41 ,
91
93
}
92
94
@@ -2116,6 +2118,17 @@ pub fn SetFunctionAttribute(Fn: ValueRef, attr: Attribute) {
2116
2118
llvm:: LLVMAddFunctionAttr ( Fn , lower as c_uint , upper as c_uint ) ;
2117
2119
}
2118
2120
}
2121
+
2122
+ // FIXME(#8199): this shouldn't require this hackery. On i686
2123
+ // (FixedStackSegment as u64) will return 0 instead of 1 << 41.
2124
+ // Furthermore, if we use a match of any sort then an LLVM
2125
+ // assertion is generated!
2126
+ pub fn SetFixedStackSegmentAttribute ( Fn : ValueRef ) {
2127
+ let attr = 1u64 << 41 ;
2128
+ let lower = attr & 0xffffffff ;
2129
+ let upper = ( attr >> 32 ) & 0xffffffff ;
2130
+ llvm:: LLVMAddFunctionAttr ( Fn , lower as c_uint , upper as c_uint ) ;
2131
+ }
2119
2132
/* Memory-managed object interface to type handles. */
2120
2133
2121
2134
pub struct TypeNames {
Original file line number Diff line number Diff line change @@ -456,7 +456,7 @@ pub fn set_always_inline(f: ValueRef) {
456
456
}
457
457
458
458
pub fn set_fixed_stack_segment ( f : ValueRef ) {
459
- lib:: llvm:: SetFunctionAttribute ( f , lib :: llvm :: FixedStackSegment )
459
+ lib:: llvm:: SetFixedStackSegmentAttribute ( f ) ;
460
460
}
461
461
462
462
pub fn set_glue_inlining ( f : ValueRef , t : ty:: t ) {
You can’t perform that action at this time.
0 commit comments