Revert "[llvm] Remove redundaunt typename (NFC)"
This reverts commit 3577e606da
.
Due to buildbot failures on Arm and Arm64.
https://lab.llvm.org/buildbot/#/builders/96/builds/30231
This commit is contained in:
parent
66763b2870
commit
335f94bfef
|
@ -830,9 +830,9 @@ struct FoldingSetTrait<std::pair<T1, T2>> {
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct FoldingSetTrait<T, std::enable_if_t<std::is_enum<T>::value>> {
|
struct FoldingSetTrait<T, typename std::enable_if_t<std::is_enum<T>::value>> {
|
||||||
static void Profile(const T &X, FoldingSetNodeID &ID) {
|
static void Profile(const T &X, FoldingSetNodeID &ID) {
|
||||||
ID.AddInteger(static_cast<std::underlying_type_t<T>>(X));
|
ID.AddInteger(static_cast<typename std::underlying_type_t<T>>(X));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1295,7 +1295,8 @@ namespace detail {
|
||||||
/// always be a reference, to avoid returning a reference to a temporary.
|
/// always be a reference, to avoid returning a reference to a temporary.
|
||||||
template <typename EltTy, typename FirstTy> class first_or_second_type {
|
template <typename EltTy, typename FirstTy> class first_or_second_type {
|
||||||
public:
|
public:
|
||||||
using type = std::conditional_t<std::is_reference<EltTy>::value, FirstTy,
|
using type =
|
||||||
|
typename std::conditional_t<std::is_reference<EltTy>::value, FirstTy,
|
||||||
std::remove_reference_t<FirstTy>>;
|
std::remove_reference_t<FirstTy>>;
|
||||||
};
|
};
|
||||||
} // end namespace detail
|
} // end namespace detail
|
||||||
|
|
|
@ -125,8 +125,8 @@ template <typename T, typename U> bool canTypeFitValue(const U Value) {
|
||||||
// - its internal representation overflows.
|
// - its internal representation overflows.
|
||||||
struct CheckedInt {
|
struct CheckedInt {
|
||||||
// Integral constructor, asserts if Value cannot be represented as intmax_t.
|
// Integral constructor, asserts if Value cannot be represented as intmax_t.
|
||||||
template <typename Integral,
|
template <typename Integral, typename std::enable_if_t<
|
||||||
std::enable_if_t<std::is_integral<Integral>::value, bool> = 0>
|
std::is_integral<Integral>::value, bool> = 0>
|
||||||
static CheckedInt from(Integral FromValue) {
|
static CheckedInt from(Integral FromValue) {
|
||||||
if (!canTypeFitValue<intmax_t>(FromValue))
|
if (!canTypeFitValue<intmax_t>(FromValue))
|
||||||
assertOutOfBounds();
|
assertOutOfBounds();
|
||||||
|
@ -137,7 +137,7 @@ struct CheckedInt {
|
||||||
|
|
||||||
// Enum constructor, asserts if Value cannot be represented as intmax_t.
|
// Enum constructor, asserts if Value cannot be represented as intmax_t.
|
||||||
template <typename Enum,
|
template <typename Enum,
|
||||||
std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
|
typename std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
|
||||||
static CheckedInt from(Enum FromValue) {
|
static CheckedInt from(Enum FromValue) {
|
||||||
using type = std::underlying_type_t<Enum>;
|
using type = std::underlying_type_t<Enum>;
|
||||||
return from<type>(static_cast<type>(FromValue));
|
return from<type>(static_cast<type>(FromValue));
|
||||||
|
@ -162,8 +162,8 @@ struct CheckedInt {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert to integral, asserts if Value cannot be represented as Integral.
|
// Convert to integral, asserts if Value cannot be represented as Integral.
|
||||||
template <typename Integral,
|
template <typename Integral, typename std::enable_if_t<
|
||||||
std::enable_if_t<std::is_integral<Integral>::value, bool> = 0>
|
std::is_integral<Integral>::value, bool> = 0>
|
||||||
Integral to() const {
|
Integral to() const {
|
||||||
if (!canTypeFitValue<Integral>(Value))
|
if (!canTypeFitValue<Integral>(Value))
|
||||||
assertOutOfBounds();
|
assertOutOfBounds();
|
||||||
|
@ -173,7 +173,7 @@ struct CheckedInt {
|
||||||
// Convert to enum, asserts if Value cannot be represented as Enum's
|
// Convert to enum, asserts if Value cannot be represented as Enum's
|
||||||
// underlying type.
|
// underlying type.
|
||||||
template <typename Enum,
|
template <typename Enum,
|
||||||
std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
|
typename std::enable_if_t<std::is_enum<Enum>::value, bool> = 0>
|
||||||
Enum to() const {
|
Enum to() const {
|
||||||
using type = std::underlying_type_t<Enum>;
|
using type = std::underlying_type_t<Enum>;
|
||||||
return Enum(to<type>());
|
return Enum(to<type>());
|
||||||
|
|
|
@ -72,8 +72,8 @@ protected:
|
||||||
template <typename CastT, typename ValueT>
|
template <typename CastT, typename ValueT>
|
||||||
static auto castValue(
|
static auto castValue(
|
||||||
ValueT value,
|
ValueT value,
|
||||||
std::enable_if_t<is_detected<has_dyn_cast_t, ValueT, CastT>::value> * =
|
typename std::enable_if_t<
|
||||||
nullptr) {
|
is_detected<has_dyn_cast_t, ValueT, CastT>::value> * = nullptr) {
|
||||||
return value.template dyn_cast<CastT>();
|
return value.template dyn_cast<CastT>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,8 +82,8 @@ protected:
|
||||||
template <typename CastT, typename ValueT>
|
template <typename CastT, typename ValueT>
|
||||||
static auto castValue(
|
static auto castValue(
|
||||||
ValueT value,
|
ValueT value,
|
||||||
std::enable_if_t<!is_detected<has_dyn_cast_t, ValueT, CastT>::value> * =
|
typename std::enable_if_t<
|
||||||
nullptr) {
|
!is_detected<has_dyn_cast_t, ValueT, CastT>::value> * = nullptr) {
|
||||||
return dyn_cast<CastT>(value);
|
return dyn_cast<CastT>(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename U = ScalarTy>
|
template <typename U = ScalarTy>
|
||||||
friend std::enable_if_t<std::is_signed<U>::value, LeafTy>
|
friend typename std::enable_if_t<std::is_signed<U>::value, LeafTy>
|
||||||
operator-(const LeafTy &LHS) {
|
operator-(const LeafTy &LHS) {
|
||||||
LeafTy Copy = LHS;
|
LeafTy Copy = LHS;
|
||||||
return Copy *= -1;
|
return Copy *= -1;
|
||||||
|
|
Loading…
Reference in New Issue