diff options
| author | 2018-04-06 14:26:03 +0000 | |
|---|---|---|
| committer | 2018-04-06 14:26:03 +0000 | |
| commit | bdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch) | |
| tree | c50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/lib/IR/Attributes.cpp | |
| parent | Print a 'p' flag for file descriptors that were opened after pledge(2). (diff) | |
| download | wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip | |
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/lib/IR/Attributes.cpp')
| -rw-r--r-- | gnu/llvm/lib/IR/Attributes.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gnu/llvm/lib/IR/Attributes.cpp b/gnu/llvm/lib/IR/Attributes.cpp index 8f2e641d64b..1b19a047472 100644 --- a/gnu/llvm/lib/IR/Attributes.cpp +++ b/gnu/llvm/lib/IR/Attributes.cpp @@ -245,6 +245,8 @@ std::string Attribute::getAsString(bool InAttrGrp) const { if (hasAttribute(Attribute::SanitizeAddress)) return "sanitize_address"; + if (hasAttribute(Attribute::SanitizeHWAddress)) + return "sanitize_hwaddress"; if (hasAttribute(Attribute::AlwaysInline)) return "alwaysinline"; if (hasAttribute(Attribute::ArgMemOnly)) @@ -327,6 +329,8 @@ std::string Attribute::getAsString(bool InAttrGrp) const { return "sspstrong"; if (hasAttribute(Attribute::SafeStack)) return "safestack"; + if (hasAttribute(Attribute::StrictFP)) + return "strictfp"; if (hasAttribute(Attribute::StructRet)) return "sret"; if (hasAttribute(Attribute::SanitizeThread)) @@ -788,14 +792,12 @@ std::string AttributeSetNode::getAsString(bool InAttrGrp) const { // AttributeListImpl Definition //===----------------------------------------------------------------------===// -/// Map from AttributeList index to the internal array index. Adding one works: -/// FunctionIndex: ~0U -> 0 -/// ReturnIndex: 0 -> 1 -/// FirstArgIndex: 1.. -> 2.. +/// Map from AttributeList index to the internal array index. Adding one happens +/// to work, but it relies on unsigned integer wrapping. MSVC warns about +/// unsigned wrapping in constexpr functions, so write out the conditional. LLVM +/// folds it to add anyway. static constexpr unsigned attrIdxToArrayIdx(unsigned Index) { - // MSVC warns about '~0U + 1' wrapping around when this is called on - // FunctionIndex, so cast to int first. - return static_cast<int>(Index) + 1; + return Index == AttributeList::FunctionIndex ? 0 : Index + 1; } AttributeListImpl::AttributeListImpl(LLVMContext &C, |
