aboutsummaryrefslogtreecommitdiff
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ADT/ImmutableSet.h2
-rw-r--r--llvm/include/llvm/ADT/PointerUnion.h8
-rw-r--r--llvm/include/llvm/ADT/STLExtras.h8
-rw-r--r--llvm/include/llvm/ADT/Sequence.h4
-rw-r--r--llvm/include/llvm/BinaryFormat/XCOFF.h2
-rw-r--r--llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h8
-rw-r--r--llvm/include/llvm/IR/ConstantFPRange.h8
7 files changed, 24 insertions, 16 deletions
diff --git a/llvm/include/llvm/ADT/ImmutableSet.h b/llvm/include/llvm/ADT/ImmutableSet.h
index 017585a4..310539f 100644
--- a/llvm/include/llvm/ADT/ImmutableSet.h
+++ b/llvm/include/llvm/ADT/ImmutableSet.h
@@ -21,7 +21,9 @@
#include "llvm/ADT/iterator.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/Signals.h"
#include <cassert>
#include <cstdint>
#include <functional>
diff --git a/llvm/include/llvm/ADT/PointerUnion.h b/llvm/include/llvm/ADT/PointerUnion.h
index 7b66177..d9087dd1 100644
--- a/llvm/include/llvm/ADT/PointerUnion.h
+++ b/llvm/include/llvm/ADT/PointerUnion.h
@@ -38,11 +38,6 @@ namespace pointer_union_detail {
return std::min<int>({PointerLikeTypeTraits<Ts>::NumLowBitsAvailable...});
}
- /// Find the first type in a list of types.
- template <typename T, typename...> struct GetFirstType {
- using type = T;
- };
-
/// Provide PointerLikeTypeTraits for void* that is used by PointerUnion
/// for the template arguments.
template <typename ...PTs> class PointerUnionUIntTraits {
@@ -264,8 +259,7 @@ struct PointerLikeTypeTraits<PointerUnion<PTs...>> {
// Teach DenseMap how to use PointerUnions as keys.
template <typename ...PTs> struct DenseMapInfo<PointerUnion<PTs...>> {
using Union = PointerUnion<PTs...>;
- using FirstInfo =
- DenseMapInfo<typename pointer_union_detail::GetFirstType<PTs...>::type>;
+ using FirstInfo = DenseMapInfo<TypeAtIndex<0, PTs...>>;
static inline Union getEmptyKey() { return Union(FirstInfo::getEmptyKey()); }
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 5b20d6bd..658f262 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -161,12 +161,10 @@ using TypeAtIndex = std::tuple_element_t<I, std::tuple<Ts...>>;
/// Helper which adds two underlying types of enumeration type.
/// Implicit conversion to a common type is accepted.
template <typename EnumTy1, typename EnumTy2,
- typename UT1 = std::enable_if_t<std::is_enum<EnumTy1>::value,
- std::underlying_type_t<EnumTy1>>,
- typename UT2 = std::enable_if_t<std::is_enum<EnumTy2>::value,
- std::underlying_type_t<EnumTy2>>>
+ typename = std::enable_if_t<std::is_enum_v<EnumTy1> &&
+ std::is_enum_v<EnumTy2>>>
constexpr auto addEnumValues(EnumTy1 LHS, EnumTy2 RHS) {
- return static_cast<UT1>(LHS) + static_cast<UT2>(RHS);
+ return llvm::to_underlying(LHS) + llvm::to_underlying(RHS);
}
//===----------------------------------------------------------------------===//
diff --git a/llvm/include/llvm/ADT/Sequence.h b/llvm/include/llvm/ADT/Sequence.h
index ce969ef..ae446df 100644
--- a/llvm/include/llvm/ADT/Sequence.h
+++ b/llvm/include/llvm/ADT/Sequence.h
@@ -86,6 +86,7 @@
#include <type_traits> // std::is_integral, std::is_enum, std::underlying_type,
// std::enable_if
+#include "llvm/ADT/STLForwardCompat.h" // llvm::to_underlying
#include "llvm/Support/MathExtras.h" // AddOverflow / SubOverflow
namespace llvm {
@@ -139,8 +140,7 @@ struct CheckedInt {
template <typename Enum,
std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
static CheckedInt from(Enum FromValue) {
- using type = std::underlying_type_t<Enum>;
- return from<type>(static_cast<type>(FromValue));
+ return from(llvm::to_underlying(FromValue));
}
// Equality
diff --git a/llvm/include/llvm/BinaryFormat/XCOFF.h b/llvm/include/llvm/BinaryFormat/XCOFF.h
index 24d5c74..9f571b9 100644
--- a/llvm/include/llvm/BinaryFormat/XCOFF.h
+++ b/llvm/include/llvm/BinaryFormat/XCOFF.h
@@ -412,7 +412,7 @@ struct TracebackTable {
static constexpr uint8_t LanguageIdShift = 16;
// Byte 3
- static constexpr uint32_t IsGlobaLinkageMask = 0x0000'8000;
+ static constexpr uint32_t IsGlobalLinkageMask = 0x0000'8000;
static constexpr uint32_t IsOutOfLineEpilogOrPrologueMask = 0x0000'4000;
static constexpr uint32_t HasTraceBackTableOffsetMask = 0x0000'2000;
static constexpr uint32_t IsInternalProcedureMask = 0x0000'1000;
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
index ed6ea96..2dd5abe 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
@@ -14,6 +14,7 @@
#define LLVM_EXECUTIONENGINE_ORC_SYMBOLSTRINGPOOL_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Compiler.h"
#include <atomic>
@@ -71,6 +72,7 @@ private:
/// from nullptr to enable comparison with these values.
class SymbolStringPtrBase {
friend class SymbolStringPool;
+ friend class SymbolStringPoolEntryUnsafe;
friend struct DenseMapInfo<SymbolStringPtr>;
friend struct DenseMapInfo<NonOwningSymbolStringPtr>;
@@ -204,7 +206,7 @@ public:
SymbolStringPoolEntryUnsafe(PoolEntry *E) : E(E) {}
/// Create an unsafe pool entry ref without changing the ref-count.
- static SymbolStringPoolEntryUnsafe from(const SymbolStringPtr &S) {
+ static SymbolStringPoolEntryUnsafe from(const SymbolStringPtrBase &S) {
return S.S;
}
@@ -318,6 +320,10 @@ SymbolStringPool::getRefCount(const SymbolStringPtrBase &S) const {
LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
const SymbolStringPtrBase &Sym);
+inline hash_code hash_value(const orc::SymbolStringPtrBase &S) {
+ return hash_value(orc::SymbolStringPoolEntryUnsafe::from(S).rawPtr());
+}
+
} // end namespace orc
template <>
diff --git a/llvm/include/llvm/IR/ConstantFPRange.h b/llvm/include/llvm/IR/ConstantFPRange.h
index d47f6c0..39dc7c1 100644
--- a/llvm/include/llvm/IR/ConstantFPRange.h
+++ b/llvm/include/llvm/IR/ConstantFPRange.h
@@ -222,6 +222,14 @@ public:
LLVM_ABI ConstantFPRange
cast(const fltSemantics &DstSem,
APFloat::roundingMode RM = APFloat::rmNearestTiesToEven) const;
+
+ /// Return a new range representing the possible values resulting
+ /// from an addition of a value in this range and a value in \p Other.
+ LLVM_ABI ConstantFPRange add(const ConstantFPRange &Other) const;
+
+ /// Return a new range representing the possible values resulting
+ /// from a subtraction of a value in this range and a value in \p Other.
+ LLVM_ABI ConstantFPRange sub(const ConstantFPRange &Other) const;
};
inline raw_ostream &operator<<(raw_ostream &OS, const ConstantFPRange &CR) {