llvm.org GIT mirror llvm / 9784231
Add safestack attribute to LLVMAttribute enum and Go bindings. Correct constants in commented-out part of LLVMAttribute enum. Add tests that verify that the safestack attribute is only allowed as a function attribute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239772 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 5 years ago
5 changed file(s) with 21 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
159159 InAllocaAttribute Attribute = 1 << 43
160160 NonNullAttribute Attribute = 1 << 44
161161 JumpTableAttribute Attribute = 1 << 45
162 ConvergentAttribute Attribute = 1 << 46
163 SafeStackAttribute Attribute = 1 << 47
162164 )
163165
164166 //-------------------------------------------------------------------------
5252 {AlwaysInlineAttribute, "alwaysinline"},
5353 {BuiltinAttribute, "builtin"},
5454 {ByValAttribute, "byval"},
55 {ConvergentAttribute, "convergent"},
5556 {InAllocaAttribute, "inalloca"},
5657 {InlineHintAttribute, "inlinehint"},
5758 {InRegAttribute, "inreg"},
7778 {ReturnedAttribute, "returned"},
7879 {ReturnsTwiceAttribute, "returns_twice"},
7980 {SExtAttribute, "signext"},
81 {SafeStackAttribute, "safestack"},
8082 {StackProtectAttribute, "ssp"},
8183 {StackProtectReqAttribute, "sspreq"},
8284 {StackProtectStrongAttribute, "sspstrong"},
160160 /* FIXME: These attributes are currently not included in the C API as
161161 a temporary measure until the API/ABI impact to the C API is understood
162162 and the path forward agreed upon.
163 LLVMAddressSafety = 1ULL << 32,
164 LLVMStackProtectStrongAttribute = 1ULL<<33,
165 LLVMCold = 1ULL << 34,
166 LLVMOptimizeNone = 1ULL << 35,
167 LLVMInAllocaAttribute = 1ULL << 36,
168 LLVMNonNullAttribute = 1ULL << 37,
169 LLVMJumpTableAttribute = 1ULL << 38,
170 LLVMDereferenceableAttribute = 1ULL << 39,
171 LLVMDereferenceableOrNullAttribute = 1ULL << 40,
163 LLVMSanitizeAddressAttribute = 1ULL << 32,
164 LLVMStackProtectStrongAttribute = 1ULL<<35,
165 LLVMColdAttribute = 1ULL << 40,
166 LLVMOptimizeNoneAttribute = 1ULL << 42,
167 LLVMInAllocaAttribute = 1ULL << 43,
168 LLVMNonNullAttribute = 1ULL << 44,
169 LLVMJumpTableAttribute = 1ULL << 45,
170 LLVMConvergentAttribute = 1ULL << 46,
171 LLVMSafeStackAttribute = 1ULL << 47,
172172 */
173173 } LLVMAttribute;
174174
0 ; RUN: not llvm-as -o /dev/null %s 2>&1 | FileCheck %s
1
2 ; CHECK: error: invalid use of function-only attribute
3 declare void @foo(i32 safestack %x)
0 ; RUN: not llvm-as -o /dev/null %s 2>&1 | FileCheck %s
1
2 ; CHECK: error: invalid use of function-only attribute
3 declare safestack void @foo()