git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174864
91177308-0d34-0410-b5e6-
96231b3b80d8
12 files changed:
If a function that has an ``sspstrong`` attribute is inlined into a
function that doesn't have an ``sspstrong`` attribute, then the
resulting function will have an ``sspstrong`` attribute.
If a function that has an ``sspstrong`` attribute is inlined into a
function that doesn't have an ``sspstrong`` attribute, then the
resulting function will have an ``sspstrong`` attribute.
+``thread_safety``
+ This attribute indicates that the thread safety analysis is enabled
+ for this function.
+``uninitialized_checks``
+ This attribute indicates that the checks for uses of uninitialized
+ memory are enabled.
``uwtable``
This attribute indicates that the ABI being targeted requires that
an unwind table entry be produce for this function even if we can
``uwtable``
This attribute indicates that the ABI being targeted requires that
an unwind table entry be produce for this function even if we can
StackProtectReq, ///< Stack protection required.
StackProtectStrong, ///< Strong Stack protection.
StructRet, ///< Hidden pointer to structure to return
StackProtectReq, ///< Stack protection required.
StackProtectStrong, ///< Strong Stack protection.
StructRet, ///< Hidden pointer to structure to return
+ ThreadSafety, ///< Thread safety checking is on.
+ UninitializedChecks, ///< Checking for uses of uninitialized memory is on.
UWTable, ///< Function must be in a unwind table
ZExt, ///< Zero extended before/after call
UWTable, ///< Function must be in a unwind table
ZExt, ///< Zero extended before/after call
.removeAttribute(Attribute::NonLazyBind)
.removeAttribute(Attribute::ReturnsTwice)
.removeAttribute(Attribute::AddressSafety)
.removeAttribute(Attribute::NonLazyBind)
.removeAttribute(Attribute::ReturnsTwice)
.removeAttribute(Attribute::AddressSafety)
+ .removeAttribute(Attribute::ThreadSafety)
+ .removeAttribute(Attribute::UninitializedChecks)
.removeAttribute(Attribute::MinSize)
.removeAttribute(Attribute::NoDuplicate);
}
.removeAttribute(Attribute::MinSize)
.removeAttribute(Attribute::NoDuplicate);
}
KEYWORD(ssp);
KEYWORD(sspreq);
KEYWORD(sspstrong);
KEYWORD(ssp);
KEYWORD(sspreq);
KEYWORD(sspstrong);
+ KEYWORD(thread_safety);
+ KEYWORD(uninitialized_checks);
KEYWORD(uwtable);
KEYWORD(zeroext);
KEYWORD(uwtable);
KEYWORD(zeroext);
case lltok::kw_ssp: B.addAttribute(Attribute::StackProtect); break;
case lltok::kw_sspreq: B.addAttribute(Attribute::StackProtectReq); break;
case lltok::kw_sspstrong: B.addAttribute(Attribute::StackProtectStrong); break;
case lltok::kw_ssp: B.addAttribute(Attribute::StackProtect); break;
case lltok::kw_sspreq: B.addAttribute(Attribute::StackProtectReq); break;
case lltok::kw_sspstrong: B.addAttribute(Attribute::StackProtectStrong); break;
+ case lltok::kw_thread_safety: B.addAttribute(Attribute::ThreadSafety); break;
+ case lltok::kw_uninitialized_checks: B.addAttribute(Attribute::UninitializedChecks); break;
case lltok::kw_uwtable: B.addAttribute(Attribute::UWTable); break;
// Error handling.
case lltok::kw_uwtable: B.addAttribute(Attribute::UWTable); break;
// Error handling.
case lltok::kw_noredzone: case lltok::kw_noimplicitfloat:
case lltok::kw_naked: case lltok::kw_nonlazybind:
case lltok::kw_address_safety: case lltok::kw_minsize:
case lltok::kw_noredzone: case lltok::kw_noimplicitfloat:
case lltok::kw_naked: case lltok::kw_nonlazybind:
case lltok::kw_address_safety: case lltok::kw_minsize:
- case lltok::kw_alignstack:
+ case lltok::kw_alignstack: case lltok::kw_thread_safety:
+ case lltok::kw_uninitialized_checks:
HaveError |= Error(Lex.getLoc(), "invalid use of function-only attribute");
break;
}
HaveError |= Error(Lex.getLoc(), "invalid use of function-only attribute");
break;
}
case lltok::kw_nonlazybind: case lltok::kw_address_safety:
case lltok::kw_minsize: case lltok::kw_alignstack:
case lltok::kw_align: case lltok::kw_noduplicate:
case lltok::kw_nonlazybind: case lltok::kw_address_safety:
case lltok::kw_minsize: case lltok::kw_alignstack:
case lltok::kw_align: case lltok::kw_noduplicate:
+ case lltok::kw_thread_safety: case lltok::kw_uninitialized_checks:
HaveError |= Error(Lex.getLoc(), "invalid use of function-only attribute");
break;
}
HaveError |= Error(Lex.getLoc(), "invalid use of function-only attribute");
break;
}
kw_sspreq,
kw_sspstrong,
kw_sret,
kw_sspreq,
kw_sspstrong,
kw_sret,
+ kw_thread_safety,
+ kw_uninitialized_checks,
if (Alignment)
B.addAlignmentAttr(Alignment);
if (Alignment)
B.addAlignmentAttr(Alignment);
- B.addRawValue(((EncodedAttrs & (0xffffULL << 32)) >> 11) |
+ B.addRawValue(((EncodedAttrs & (0xfffffULL << 32)) >> 11) |
(EncodedAttrs & 0xffff));
}
(EncodedAttrs & 0xffff));
}
uint64_t EncodedAttrs = Attrs.Raw(Index) & 0xffff;
if (Attrs.hasAttribute(Index, Attribute::Alignment))
EncodedAttrs |= Attrs.getParamAlignment(Index) << 16;
uint64_t EncodedAttrs = Attrs.Raw(Index) & 0xffff;
if (Attrs.hasAttribute(Index, Attribute::Alignment))
EncodedAttrs |= Attrs.getParamAlignment(Index) << 16;
- EncodedAttrs |= (Attrs.Raw(Index) & (0xffffULL << 21)) << 11;
+ EncodedAttrs |= (Attrs.Raw(Index) & (0xfffffULL << 21)) << 11;
return "sspstrong";
if (hasAttribute(Attribute::StructRet))
return "sret";
return "sspstrong";
if (hasAttribute(Attribute::StructRet))
return "sret";
+ if (hasAttribute(Attribute::ThreadSafety))
+ return "thread_safety";
+ if (hasAttribute(Attribute::UninitializedChecks))
+ return "uninitialized_checks";
if (hasAttribute(Attribute::UWTable))
return "uwtable";
if (hasAttribute(Attribute::ZExt))
if (hasAttribute(Attribute::UWTable))
return "uwtable";
if (hasAttribute(Attribute::ZExt))
case Attribute::MinSize: return 1ULL << 33;
case Attribute::NoDuplicate: return 1ULL << 34;
case Attribute::StackProtectStrong: return 1ULL << 35;
case Attribute::MinSize: return 1ULL << 33;
case Attribute::NoDuplicate: return 1ULL << 34;
case Attribute::StackProtectStrong: return 1ULL << 35;
+ case Attribute::ThreadSafety: return 1ULL << 36;
+ case Attribute::UninitializedChecks: return 1ULL << 37;
}
llvm_unreachable("Unsupported attribute type");
}
}
llvm_unreachable("Unsupported attribute type");
}
!Attrs.hasAttribute(Idx, Attribute::NonLazyBind) &&
!Attrs.hasAttribute(Idx, Attribute::ReturnsTwice) &&
!Attrs.hasAttribute(Idx, Attribute::AddressSafety) &&
!Attrs.hasAttribute(Idx, Attribute::NonLazyBind) &&
!Attrs.hasAttribute(Idx, Attribute::ReturnsTwice) &&
!Attrs.hasAttribute(Idx, Attribute::AddressSafety) &&
+ !Attrs.hasAttribute(Idx, Attribute::ThreadSafety) &&
+ !Attrs.hasAttribute(Idx, Attribute::UninitializedChecks) &&
!Attrs.hasAttribute(Idx, Attribute::MinSize),
"Some attributes in '" + Attrs.getAsString(Idx) +
"' only apply to functions!", V);
!Attrs.hasAttribute(Idx, Attribute::MinSize),
"Some attributes in '" + Attrs.getAsString(Idx) +
"' only apply to functions!", V);
+define void @f28() thread_safety
+; CHECK: define void @f28() thread_safety
+{
+ ret void;
+}
+define void @f29() uninitialized_checks
+; CHECK: define void @f29() uninitialized_checks
+{
+ ret void;
+}
| returns_twice
| nonlazybind
| address_safety
| returns_twice
| nonlazybind
| address_safety
+ | thread_safety
+ | uninitialized_checks
;
OptFuncAttrs ::= + _ | OptFuncAttrs FuncAttr ;
;
OptFuncAttrs ::= + _ | OptFuncAttrs FuncAttr ;
syn keyword llvmKeyword sspstrong tail target thread_local to triple
syn keyword llvmKeyword unnamed_addr unordered uwtable volatile weak weak_odr
syn keyword llvmKeyword x86_fastcallcc x86_stdcallcc x86_thiscallcc zeroext
syn keyword llvmKeyword sspstrong tail target thread_local to triple
syn keyword llvmKeyword unnamed_addr unordered uwtable volatile weak weak_odr
syn keyword llvmKeyword x86_fastcallcc x86_stdcallcc x86_thiscallcc zeroext
+syn keyword llvmKeyword thread_safety uninitialized_checks
" Obsolete keywords.
syn keyword llvmError getresult begin end
" Obsolete keywords.
syn keyword llvmError getresult begin end