diff options
Diffstat (limited to 'llvm/include/llvm/Support')
-rw-r--r-- | llvm/include/llvm/Support/AMDHSAKernelDescriptor.h | 3 | ||||
-rw-r--r-- | llvm/include/llvm/Support/Casting.h | 2 | ||||
-rw-r--r-- | llvm/include/llvm/Support/Compression.h | 23 | ||||
-rw-r--r-- | llvm/include/llvm/Support/DivisionByConstantInfo.h | 8 | ||||
-rw-r--r-- | llvm/include/llvm/Support/JSON.h | 106 | ||||
-rw-r--r-- | llvm/include/llvm/Support/SpecialCaseList.h | 7 | ||||
-rw-r--r-- | llvm/include/llvm/Support/VirtualFileSystem.h | 1 |
7 files changed, 103 insertions, 47 deletions
diff --git a/llvm/include/llvm/Support/AMDHSAKernelDescriptor.h b/llvm/include/llvm/Support/AMDHSAKernelDescriptor.h index 41d144cfd5c4..61b05743faf6 100644 --- a/llvm/include/llvm/Support/AMDHSAKernelDescriptor.h +++ b/llvm/include/llvm/Support/AMDHSAKernelDescriptor.h @@ -161,7 +161,8 @@ enum : int32_t { KERNEL_CODE_PROPERTY(ENABLE_SGPR_PRIVATE_SEGMENT_SIZE, 6, 1), KERNEL_CODE_PROPERTY(RESERVED0, 7, 3), KERNEL_CODE_PROPERTY(ENABLE_WAVEFRONT_SIZE32, 10, 1), // GFX10+ - KERNEL_CODE_PROPERTY(RESERVED1, 11, 5), + KERNEL_CODE_PROPERTY(USES_DYNAMIC_STACK, 11, 1), + KERNEL_CODE_PROPERTY(RESERVED1, 12, 4), }; #undef KERNEL_CODE_PROPERTY diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h index 5444d777b749..b6bbff8ada10 100644 --- a/llvm/include/llvm/Support/Casting.h +++ b/llvm/include/llvm/Support/Casting.h @@ -265,7 +265,7 @@ struct CastIsPossible { template <typename To, typename From> struct CastIsPossible<To, Optional<From>> { static inline bool isPossible(const Optional<From> &f) { - assert(f.hasValue() && "CastIsPossible::isPossible called on a nullopt!"); + assert(f && "CastIsPossible::isPossible called on a nullopt!"); return isa_impl_wrap< To, const From, typename simplify_type<const From>::SimpleType>::doit(*f); diff --git a/llvm/include/llvm/Support/Compression.h b/llvm/include/llvm/Support/Compression.h index c99f811459ab..8500396d88a0 100644 --- a/llvm/include/llvm/Support/Compression.h +++ b/llvm/include/llvm/Support/Compression.h @@ -19,7 +19,6 @@ namespace llvm { template <typename T> class SmallVectorImpl; class Error; -class StringRef; namespace compression { namespace zlib { @@ -44,6 +43,28 @@ Error uncompress(ArrayRef<uint8_t> Input, } // End of namespace zlib +namespace zstd { + +constexpr int NoCompression = -5; +constexpr int BestSpeedCompression = 1; +constexpr int DefaultCompression = 5; +constexpr int BestSizeCompression = 12; + +bool isAvailable(); + +void compress(ArrayRef<uint8_t> Input, + SmallVectorImpl<uint8_t> &CompressedBuffer, + int Level = DefaultCompression); + +Error uncompress(ArrayRef<uint8_t> Input, uint8_t *UncompressedBuffer, + size_t &UncompressedSize); + +Error uncompress(ArrayRef<uint8_t> Input, + SmallVectorImpl<uint8_t> &UncompressedBuffer, + size_t UncompressedSize); + +} // End of namespace zstd + } // End of namespace compression } // End of namespace llvm diff --git a/llvm/include/llvm/Support/DivisionByConstantInfo.h b/llvm/include/llvm/Support/DivisionByConstantInfo.h index 896bc679885e..7d01613ce1c6 100644 --- a/llvm/include/llvm/Support/DivisionByConstantInfo.h +++ b/llvm/include/llvm/Support/DivisionByConstantInfo.h @@ -1,4 +1,4 @@ -//== llvm/Support/DivisonByConstantInfo.h - division by constant -*- C++ -*-==// +//===- llvm/Support/DivisionByConstantInfo.h ---------------------*- C++ -*-==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -25,9 +25,9 @@ struct SignedDivisionByConstantInfo { }; /// Magic data for optimising unsigned division by a constant. -struct UnsignedDivisonByConstantInfo { - static UnsignedDivisonByConstantInfo get(const APInt &D, - unsigned LeadingZeros = 0); +struct UnsignedDivisionByConstantInfo { + static UnsignedDivisionByConstantInfo get(const APInt &D, + unsigned LeadingZeros = 0); APInt Magic; ///< magic number bool IsAdd; ///< add indicator unsigned ShiftAmount; ///< shift amount diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h index 719e8b60d0fa..0a44aabedae6 100644 --- a/llvm/include/llvm/Support/JSON.h +++ b/llvm/include/llvm/Support/JSON.h @@ -169,44 +169,36 @@ public: emplace_back(V); } - Value &operator[](size_t I) { return V[I]; } - const Value &operator[](size_t I) const { return V[I]; } - Value &front() { return V.front(); } - const Value &front() const { return V.front(); } - Value &back() { return V.back(); } - const Value &back() const { return V.back(); } - Value *data() { return V.data(); } - const Value *data() const { return V.data(); } - - iterator begin() { return V.begin(); } - const_iterator begin() const { return V.begin(); } - iterator end() { return V.end(); } - const_iterator end() const { return V.end(); } - - bool empty() const { return V.empty(); } - size_t size() const { return V.size(); } - void reserve(size_t S) { V.reserve(S); } - - void clear() { V.clear(); } - void push_back(const Value &E) { V.push_back(E); } - void push_back(Value &&E) { V.push_back(std::move(E)); } - template <typename... Args> void emplace_back(Args &&... A) { - V.emplace_back(std::forward<Args>(A)...); - } - void pop_back() { V.pop_back(); } + Value &operator[](size_t I); + const Value &operator[](size_t I) const; + Value &front(); + const Value &front() const; + Value &back(); + const Value &back() const; + Value *data(); + const Value *data() const; + + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + + bool empty() const; + size_t size() const; + void reserve(size_t S); + + void clear(); + void push_back(const Value &E); + void push_back(Value &&E); + template <typename... Args> void emplace_back(Args &&...A); + void pop_back(); // FIXME: insert() takes const_iterator since C++11, old libstdc++ disagrees. - iterator insert(iterator P, const Value &E) { return V.insert(P, E); } - iterator insert(iterator P, Value &&E) { - return V.insert(P, std::move(E)); - } - template <typename It> iterator insert(iterator P, It A, It Z) { - return V.insert(P, A, Z); - } - template <typename... Args> iterator emplace(const_iterator P, Args &&... A) { - return V.emplace(P, std::forward<Args>(A)...); - } + iterator insert(iterator P, const Value &E); + iterator insert(iterator P, Value &&E); + template <typename It> iterator insert(iterator P, It A, It Z); + template <typename... Args> iterator emplace(const_iterator P, Args &&...A); - friend bool operator==(const Array &L, const Array &R) { return L.V == R.V; } + friend bool operator==(const Array &L, const Array &R); }; inline bool operator!=(const Array &L, const Array &R) { return !(L == R); } @@ -515,6 +507,48 @@ private: bool operator==(const Value &, const Value &); inline bool operator!=(const Value &L, const Value &R) { return !(L == R); } +// Array Methods +inline Value &Array::operator[](size_t I) { return V[I]; } +inline const Value &Array::operator[](size_t I) const { return V[I]; } +inline Value &Array::front() { return V.front(); } +inline const Value &Array::front() const { return V.front(); } +inline Value &Array::back() { return V.back(); } +inline const Value &Array::back() const { return V.back(); } +inline Value *Array::data() { return V.data(); } +inline const Value *Array::data() const { return V.data(); } + +inline typename Array::iterator Array::begin() { return V.begin(); } +inline typename Array::const_iterator Array::begin() const { return V.begin(); } +inline typename Array::iterator Array::end() { return V.end(); } +inline typename Array::const_iterator Array::end() const { return V.end(); } + +inline bool Array::empty() const { return V.empty(); } +inline size_t Array::size() const { return V.size(); } +inline void Array::reserve(size_t S) { V.reserve(S); } + +inline void Array::clear() { V.clear(); } +inline void Array::push_back(const Value &E) { V.push_back(E); } +inline void Array::push_back(Value &&E) { V.push_back(std::move(E)); } +template <typename... Args> inline void Array::emplace_back(Args &&...A) { + V.emplace_back(std::forward<Args>(A)...); +} +inline void Array::pop_back() { V.pop_back(); } +inline typename Array::iterator Array::insert(iterator P, const Value &E) { + return V.insert(P, E); +} +inline typename Array::iterator Array::insert(iterator P, Value &&E) { + return V.insert(P, std::move(E)); +} +template <typename It> +inline typename Array::iterator Array::insert(iterator P, It A, It Z) { + return V.insert(P, A, Z); +} +template <typename... Args> +inline typename Array::iterator Array::emplace(const_iterator P, Args &&...A) { + return V.emplace(P, std::forward<Args>(A)...); +} +inline bool operator==(const Array &L, const Array &R) { return L.V == R.V; } + /// ObjectKey is a used to capture keys in Object. Like Value but: /// - only strings are allowed /// - it's optimized for the string literal case (Owned == nullptr) diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h index d022a8f53706..0d56c4b9912d 100644 --- a/llvm/include/llvm/Support/SpecialCaseList.h +++ b/llvm/include/llvm/Support/SpecialCaseList.h @@ -19,9 +19,9 @@ // prefix:wildcard_expression[=category] // If category is not specified, it is assumed to be empty string. // Definitions of "prefix" and "category" are sanitizer-specific. For example, -// sanitizer exclusion support prefixes "src", "fun" and "global". -// Wildcard expressions define, respectively, source files, functions or -// globals which shouldn't be instrumented. +// sanitizer exclusion support prefixes "src", "mainfile", "fun" and "global". +// Wildcard expressions define, respectively, source files, main files, +// functions or globals which shouldn't be instrumented. // Examples of categories: // "functional": used in DFSan to list functions with pure functional // semantics. @@ -37,6 +37,7 @@ // type:*Namespace::ClassName*=init // src:file_with_tricky_code.cc // src:ignore-global-initializers-issues.cc=init +// mainfile:main_file.cc // // [dataflow] // # Functions with pure functional semantics: diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h index 3c99b0d8efdb..6844a406f38c 100644 --- a/llvm/include/llvm/Support/VirtualFileSystem.h +++ b/llvm/include/llvm/Support/VirtualFileSystem.h @@ -462,7 +462,6 @@ private: namespace detail { class InMemoryDirectory; -class InMemoryFile; class InMemoryNode; struct NewInMemoryNodeInfo { |