From 74005aa8d6f7273939c925176f914e038397982e Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 22 Oct 2020 21:52:26 -0700 Subject: [PATCH] misc: Replace enable_if<>::type with enable_if_t<>. This new abreviated form was added for C++14. Now that we're using that version of the standard, we can move over to it. Change-Id: Ia291d2b1e73e503c37593b1e1c4c1b3011abc63b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36477 Reviewed-by: Daniel Carvalho Maintainer: Gabe Black Tested-by: kokoro --- src/arch/arm/aapcs32.hh | 73 +++++++++++++++---------------- src/arch/arm/aapcs64.hh | 67 ++++++++++++++-------------- src/arch/arm/freebsd/process.hh | 4 +- src/arch/arm/linux/process.hh | 4 +- src/arch/arm/process.hh | 4 +- src/arch/arm/semihosting.hh | 8 ++-- src/arch/gcn3/operand.hh | 10 ++--- src/arch/generic/vec_pred_reg.hh | 10 ++--- src/arch/generic/vec_reg.hh | 20 ++++----- src/arch/sparc/process.hh | 7 ++- src/arch/x86/linux/linux.hh | 4 +- src/arch/x86/linux/se_workload.hh | 4 +- src/base/circular_queue.hh | 2 +- src/base/coroutine.hh | 18 ++++---- src/base/intmath.hh | 2 +- src/base/random.hh | 6 +-- src/base/refcnt.hh | 2 +- src/base/statistics.hh | 4 +- src/base/str.hh | 12 ++--- src/sim/guest_abi.test.cc | 8 ++-- src/sim/guest_abi/dispatch.hh | 8 ++-- src/sim/guest_abi/layout.hh | 9 ++-- src/sim/proxy_ptr.hh | 33 +++++++------- src/sim/syscall_abi.hh | 14 +++--- 24 files changed, 161 insertions(+), 172 deletions(-) diff --git a/src/arch/arm/aapcs32.hh b/src/arch/arm/aapcs32.hh index 3cd2c50fd..a0f09b87b 100644 --- a/src/arch/arm/aapcs32.hh +++ b/src/arch/arm/aapcs32.hh @@ -74,13 +74,13 @@ template struct IsAapcs32Composite : public std::false_type {}; template -struct IsAapcs32Composite::value || std::is_class::value || std::is_union::value) && // VarArgs is technically a composite type, but it's not a normal argument. !IsVarArgs::value - >::type> : public std::true_type + >> : public std::true_type {}; // Homogeneous Aggregates @@ -130,9 +130,8 @@ struct Aapcs32ArgumentBase */ template -struct Result::value && (sizeof(Integer) < sizeof(uint32_t)) - >::type> +struct Result::value && (sizeof(Integer) < sizeof(uint32_t))>> { static void store(ThreadContext *tc, const Integer &i) @@ -144,9 +143,8 @@ struct Result -struct Result::value && (sizeof(Integer) == sizeof(uint32_t)) - >::type> +struct Result::value && (sizeof(Integer) == sizeof(uint32_t))>> { static void store(ThreadContext *tc, const Integer &i) @@ -156,9 +154,8 @@ struct Result -struct Result::value && (sizeof(Integer) == sizeof(uint64_t)) - >::type> +struct Result::value && (sizeof(Integer) == sizeof(uint64_t))>> { static void store(ThreadContext *tc, const Integer &i) @@ -176,9 +173,9 @@ struct Result -struct Argument::value && (sizeof(Integer) <= sizeof(uint32_t)) - >::type> : public Aapcs32ArgumentBase + >> : public Aapcs32ArgumentBase { static Integer get(ThreadContext *tc, Aapcs32::State &state) @@ -195,9 +192,9 @@ struct Argument -struct Argument::value && (sizeof(Integer) > sizeof(uint32_t)) - >::type> : public Aapcs32ArgumentBase + >> : public Aapcs32ArgumentBase { static Integer get(ThreadContext *tc, Aapcs32::State &state) @@ -236,8 +233,8 @@ struct Argument -struct Result::value>::type> +struct Result::value>> { static void store(ThreadContext *tc, const Float &f, Aapcs32::State &state) @@ -248,8 +245,8 @@ struct Result -struct Argument::value>::type> : public Aapcs32ArgumentBase +struct Argument::value>> : public Aapcs32ArgumentBase { static Float get(ThreadContext *tc, Aapcs32::State &state) @@ -270,8 +267,8 @@ struct Argument -struct Result::value>::type> +struct Result::value>> { static void store(ThreadContext *tc, const Composite &composite, @@ -298,8 +295,8 @@ struct Result -struct Argument::value>::type> : +struct Argument::value>> : public Aapcs32ArgumentBase { static Composite @@ -444,13 +441,13 @@ namespace GuestABI */ template -struct Result::value>::type> : public Result +struct Result::value>> : public Result {}; template -struct Argument::value>::type> : +struct Argument::value>> : public Argument {}; @@ -460,8 +457,8 @@ struct Argument -struct Result::value>::type> +struct Result::value>> { static void store(ThreadContext *tc, const Float &f, Aapcs32Vfp::State &state) @@ -479,8 +476,8 @@ struct Result -struct Argument::value>::type> : public Aapcs32ArgumentBase +struct Argument::value>> : public Aapcs32ArgumentBase { static Float get(ThreadContext *tc, Aapcs32Vfp::State &state) @@ -510,16 +507,16 @@ struct Argument -struct Result::value && - !IsAapcs32HomogeneousAggregate::value>::type> : + !IsAapcs32HomogeneousAggregate::value>> : public Result {}; template -struct Argument::value && - !IsAapcs32HomogeneousAggregate::value>::type> : + !IsAapcs32HomogeneousAggregate::value>> : public Argument {}; @@ -535,8 +532,8 @@ template struct Aapcs32ArrayType { using Type = E; }; template -struct Argument::value>::type> : +struct Argument::value>> : public Aapcs32ArgumentBase { static bool @@ -586,7 +583,7 @@ struct Argument struct Result::value>::type> + typename std::enable_if_t::value>> { static bool useBaseABI(Aapcs32Vfp::State &state) diff --git a/src/arch/arm/aapcs64.hh b/src/arch/arm/aapcs64.hh index 0c11215af..8a5e4374c 100644 --- a/src/arch/arm/aapcs64.hh +++ b/src/arch/arm/aapcs64.hh @@ -77,9 +77,9 @@ struct IsAapcs64ShortVector : public std::false_type {}; template struct IsAapcs64ShortVector::value || std::is_floating_point::value) && - (sizeof(E) * N == 8 || sizeof(E) * N == 16)>::type> : + (sizeof(E) * N == 8 || sizeof(E) * N == 16)>> : public std::true_type {}; @@ -91,7 +91,7 @@ template struct IsAapcs64Composite : public std::false_type {}; template -struct IsAapcs64Composite::value || std::is_class::value || std::is_union::value) && @@ -99,7 +99,7 @@ struct IsAapcs64Composite::value && // Short vectors are also composite types, but don't treat them as one. !IsAapcs64ShortVector::value - >::type> : public std::true_type + >> : public std::true_type {}; // Homogeneous Aggregates @@ -116,8 +116,8 @@ struct IsAapcs64Hfa : public std::false_type {}; template struct IsAapcs64Hfa::value && - N <= 4>::type> : public std::true_type + typename std::enable_if_t::value && N <= 4>> : + public std::true_type {}; // An Homogeneous Short-Vector Aggregate (HVA) is an Homogeneous Aggregate with @@ -129,8 +129,8 @@ struct IsAapcs64Hva : public std::false_type {}; template struct IsAapcs64Hva::value && - N <= 4>::type> : public std::true_type + typename std::enable_if_t::value && N <= 4>> : + public std::true_type {}; // A shorthand to test if a type is an HVA or an HFA. @@ -138,8 +138,8 @@ template struct IsAapcs64Hxa : public std::false_type {}; template -struct IsAapcs64Hxa::value || IsAapcs64Hva::value>::type> : +struct IsAapcs64Hxa::value || IsAapcs64Hva::value>> : public std::true_type {}; @@ -174,9 +174,9 @@ struct Aapcs64ArgumentBase */ template -struct Argument::value || - IsAapcs64ShortVector::value>::type> : + IsAapcs64ShortVector::value>> : public Aapcs64ArgumentBase { static Float @@ -192,9 +192,9 @@ struct Argument -struct Result::value || - IsAapcs64ShortVector::value>::type> + IsAapcs64ShortVector::value>> { static void store(ThreadContext *tc, const Float &f) @@ -213,9 +213,9 @@ struct Result -struct Argument::value && (sizeof(Integer) <= 8) - >::type> : public Aapcs64ArgumentBase +struct Argument::value && (sizeof(Integer) <= 8)>> : + public Aapcs64ArgumentBase { static Integer get(ThreadContext *tc, Aapcs64::State &state) @@ -231,9 +231,9 @@ struct Argument -struct Argument::value && (sizeof(Integer) > 8) - >::type> : public Aapcs64ArgumentBase +struct Argument::value && (sizeof(Integer) > 8)>> : + public Aapcs64ArgumentBase { static Integer get(ThreadContext *tc, Aapcs64::State &state) @@ -256,9 +256,8 @@ struct Argument -struct Result::value && (sizeof(Integer) <= 8) - >::type> +struct Result::value && (sizeof(Integer) <= 8)>> { static void store(ThreadContext *tc, const Integer &i) @@ -268,9 +267,8 @@ struct Result -struct Result::value && (sizeof(Integer) > 8) - >::type> +struct Result::value && (sizeof(Integer) > 8)>> { static void store(ThreadContext *tc, const Integer &i) @@ -293,8 +291,8 @@ template struct Aapcs64ArrayType { using Type = E; }; template -struct Argument::value>::type> : public Aapcs64ArgumentBase +struct Argument::value>> : public Aapcs64ArgumentBase { static HA get(ThreadContext *tc, Aapcs64::State &state) @@ -318,7 +316,7 @@ struct Argument struct Result::value>::type> + typename std::enable_if_t::value>> { static HA store(ThreadContext *tc, const HA &ha) @@ -337,9 +335,9 @@ struct Result -struct Argument::value && !IsAapcs64Hxa::value - >::type> : public Aapcs64ArgumentBase +struct Argument::value && !IsAapcs64Hxa::value>> : + public Aapcs64ArgumentBase { static Composite get(ThreadContext *tc, Aapcs64::State &state) @@ -382,9 +380,8 @@ struct Argument -struct Result::value && !IsAapcs64Hxa::value - >::type> +struct Result::value && !IsAapcs64Hxa::value>> { static void store(ThreadContext *tc, const Composite &c) diff --git a/src/arch/arm/freebsd/process.hh b/src/arch/arm/freebsd/process.hh index de6539b40..07d5304f2 100644 --- a/src/arch/arm/freebsd/process.hh +++ b/src/arch/arm/freebsd/process.hh @@ -48,8 +48,8 @@ namespace GuestABI template struct Result::value>::type> + typename std::enable_if_t::value>> { static void store(ThreadContext *tc, const SyscallReturn &ret) diff --git a/src/arch/arm/linux/process.hh b/src/arch/arm/linux/process.hh index 57af06cc9..b9de9031c 100644 --- a/src/arch/arm/linux/process.hh +++ b/src/arch/arm/linux/process.hh @@ -56,8 +56,8 @@ namespace GuestABI template struct Result::value>::type> + typename std::enable_if_t::value>> { static void store(ThreadContext *tc, const SyscallReturn &ret) diff --git a/src/arch/arm/process.hh b/src/arch/arm/process.hh index bb9f0dbed..10447026a 100644 --- a/src/arch/arm/process.hh +++ b/src/arch/arm/process.hh @@ -94,9 +94,9 @@ namespace GuestABI template struct Argument::value && - ABI::template IsWide::value>::type> + ABI::template IsWide::value>> { static Arg get(ThreadContext *tc, typename ABI::State &state) diff --git a/src/arch/arm/semihosting.hh b/src/arch/arm/semihosting.hh index fff969ffc..74697f408 100644 --- a/src/arch/arm/semihosting.hh +++ b/src/arch/arm/semihosting.hh @@ -595,7 +595,7 @@ namespace GuestABI template struct Argument::value>::type> + typename std::enable_if_t::value>> { static Arg get(ThreadContext *tc, ArmSemihosting::Abi64::State &state) @@ -606,7 +606,7 @@ struct Argument struct Argument::value>::type> + typename std::enable_if_t::value>> { static Arg get(ThreadContext *tc, ArmSemihosting::Abi32::State &state) @@ -619,8 +619,8 @@ struct Argument -struct Argument::value>::type> +struct Argument::value>> { static ArmSemihosting::InPlaceArg get(ThreadContext *tc, typename Abi::State &state) diff --git a/src/arch/gcn3/operand.hh b/src/arch/gcn3/operand.hh index 0a1f656df..6a756aab6 100644 --- a/src/arch/gcn3/operand.hh +++ b/src/arch/gcn3/operand.hh @@ -264,7 +264,7 @@ namespace Gcn3ISA * primitive types (i.e., 8b to 64b primitives). */ template - typename std::enable_if::type + typename std::enable_if_t operator[](size_t idx) const { assert(idx < NumVecElemPerVecReg); @@ -307,7 +307,7 @@ namespace Gcn3ISA * primitive types (i.e., 8b to 64b primitives). */ template - typename std::enable_if::type + typename std::enable_if_t operator[](size_t idx) { assert(!scalar); @@ -392,7 +392,7 @@ namespace Gcn3ISA * that we need to perform computation on. */ template - typename std::enable_if::type + typename std::enable_if_t rawData() const { assert(sizeof(DataType) <= sizeof(srfData)); @@ -491,7 +491,7 @@ namespace Gcn3ISA * bit access to scalar data. primarily used for setting vcc bits. */ template - typename std::enable_if::type + typename std::enable_if_t setBit(int bit, int bit_val) { DataType &sgpr = *((DataType*)srfData.data()); @@ -499,7 +499,7 @@ namespace Gcn3ISA } template - typename std::enable_if::type + typename std::enable_if_t operator=(DataType rhs) { std::memcpy((void*)srfData.data(), (void*)&rhs, sizeof(DataType)); diff --git a/src/arch/generic/vec_pred_reg.hh b/src/arch/generic/vec_pred_reg.hh index 97492a4e7..84047f697 100644 --- a/src/arch/generic/vec_pred_reg.hh +++ b/src/arch/generic/vec_pred_reg.hh @@ -88,16 +88,16 @@ class VecPredRegT /// Reset the register to an all-false value. template - typename std::enable_if::type + typename std::enable_if_t reset() { container.reset(); } /// Reset the register to an all-true value. template - typename std::enable_if::type + typename std::enable_if_t set() { container.set(); } template - typename std::enable_if::type + typename std::enable_if_t operator=(const MyClass& that) { container = that.container; @@ -111,7 +111,7 @@ class VecPredRegT } template - typename std::enable_if::type + typename std::enable_if_t operator[](size_t idx) { return container[idx * (Packed ? 1 : sizeof(VecElem))]; @@ -128,7 +128,7 @@ class VecPredRegT /// Write a raw value in an element of the predicate register template - typename std::enable_if::type + typename std::enable_if_t set_raw(size_t idx, uint8_t val) { container.set_bits(idx * (Packed ? 1 : sizeof(VecElem)), diff --git a/src/arch/generic/vec_reg.hh b/src/arch/generic/vec_reg.hh index e26cf8b2c..a647cd80e 100644 --- a/src/arch/generic/vec_reg.hh +++ b/src/arch/generic/vec_reg.hh @@ -192,11 +192,11 @@ class VecRegT /** Zero the container. */ template - typename std::enable_if::type + typename std::enable_if_t zero() { container.zero(); } template - typename std::enable_if::type + typename std::enable_if_t operator=(const MyClass& that) { container = that.container; @@ -211,7 +211,7 @@ class VecRegT /** Index operator. */ template - typename std::enable_if::type + typename std::enable_if_t operator[](size_t idx) { return container.template raw_ptr()[idx]; @@ -475,18 +475,18 @@ class LaneData public: template explicit - LaneData(typename std::enable_if::type t) + LaneData(typename std::enable_if_t t) : _val(t) {} template - typename std::enable_if::type + typename std::enable_if_t operator=(const T& that) { _val = that; return *this; } template::type I = 0> + typename std::enable_if_t I = 0> operator T() const { return *static_cast(&_val); } @@ -552,7 +552,7 @@ class VecLaneT */ /** @{ */ template - typename std::enable_if::type + typename std::enable_if_t operator=(const VecElem& that) { container = that; return *this; @@ -563,7 +563,7 @@ class VecLaneT * not allowed, pre-treatment of the rhs is required to conform. */ template - typename std::enable_if::type + typename std::enable_if_t operator=(const T& that) { static_assert(sizeof(T) >= sizeof(VecElem), "Attempt to perform widening bitwise copy."); @@ -577,8 +577,8 @@ class VecLaneT operator VecElem() const { return container; } /** Constification. */ - template ::type = 0> - operator VecLaneT::type, true>() + template = 0> + operator VecLaneT, true>() { return VecLaneT(container); } diff --git a/src/arch/sparc/process.hh b/src/arch/sparc/process.hh index 85d7da81f..593854a0d 100644 --- a/src/arch/sparc/process.hh +++ b/src/arch/sparc/process.hh @@ -79,8 +79,8 @@ namespace GuestABI template struct Result::value>::type> + typename std::enable_if_t::value>> { static void store(ThreadContext *tc, const SyscallReturn &ret) @@ -160,8 +160,7 @@ namespace GuestABI template struct Argument::value>::type> + typename std::enable_if_t::value>> { using ABI = Sparc32Process::SyscallABI; diff --git a/src/arch/x86/linux/linux.hh b/src/arch/x86/linux/linux.hh index e89cc57dc..697892cc6 100644 --- a/src/arch/x86/linux/linux.hh +++ b/src/arch/x86/linux/linux.hh @@ -73,8 +73,8 @@ namespace GuestABI template struct Result::value>::type> + typename std::enable_if_t::value>> { static void store(ThreadContext *tc, const SyscallReturn &ret) diff --git a/src/arch/x86/linux/se_workload.hh b/src/arch/x86/linux/se_workload.hh index efe84f3e9..30477b40d 100644 --- a/src/arch/x86/linux/se_workload.hh +++ b/src/arch/x86/linux/se_workload.hh @@ -73,8 +73,8 @@ namespace GuestABI template struct Argument::value>::type> + typename std::enable_if_t< + X86ISA::EmuLinux::SyscallABI32::IsWide::value>> { using ABI = X86ISA::EmuLinux::SyscallABI32; diff --git a/src/base/circular_queue.hh b/src/base/circular_queue.hh index e7c8f62a1..4964c8754 100644 --- a/src/base/circular_queue.hh +++ b/src/base/circular_queue.hh @@ -469,7 +469,7 @@ class CircularQueue : private std::vector * @ingroup api_base_utils */ template - typename std::enable_if::value,reference>::type + typename std::enable_if_t::value, reference> operator[](const Idx& index) { return *(*this + index); } /** diff --git a/src/base/coroutine.hh b/src/base/coroutine.hh index b4c347488..68d2b1d60 100644 --- a/src/base/coroutine.hh +++ b/src/base/coroutine.hh @@ -98,8 +98,8 @@ class Coroutine : public Fiber */ template CallerType& - operator()(typename std::enable_if< - !std::is_same::value, T>::type param) + operator()(typename std::enable_if_t< + !std::is_same::value, T> param) { retChannel.push(param); callerFiber->run(); @@ -115,8 +115,8 @@ class Coroutine : public Fiber * @ingroup api_coroutine */ template - typename std::enable_if::value, - CallerType>::type& + typename std::enable_if_t::value, + CallerType> & operator()() { callerFiber->run(); @@ -136,7 +136,7 @@ class Coroutine : public Fiber * @ingroup api_coroutine */ template - typename std::enable_if::value, T>::type + typename std::enable_if_t::value, T> get() { auto& args_channel = coro.argsChannel; @@ -208,8 +208,8 @@ class Coroutine : public Fiber */ template Coroutine& - operator()(typename std::enable_if< - !std::is_same::value, T>::type param) + operator()(typename std::enable_if_t< + !std::is_same::value, T> param) { argsChannel.push(param); this->call(); @@ -225,7 +225,7 @@ class Coroutine : public Fiber * @ingroup api_coroutine */ template - typename std::enable_if::value, Coroutine>::type& + typename std::enable_if_t::value, Coroutine> & operator()() { this->call(); @@ -245,7 +245,7 @@ class Coroutine : public Fiber * @ingroup api_coroutine */ template - typename std::enable_if::value, T>::type + typename std::enable_if_t::value, T> get() { auto& ret_channel = caller.retChannel; diff --git a/src/base/intmath.hh b/src/base/intmath.hh index daf5f5d97..473f0e374 100644 --- a/src/base/intmath.hh +++ b/src/base/intmath.hh @@ -59,7 +59,7 @@ power(uint32_t n, uint32_t e) * @ingroup api_base_utils */ template -inline typename std::enable_if::value, int>::type +inline typename std::enable_if_t::value, int> floorLog2(T x) { assert(x > 0); diff --git a/src/base/random.hh b/src/base/random.hh index f161d71ef..0ef2b6f42 100644 --- a/src/base/random.hh +++ b/src/base/random.hh @@ -82,7 +82,7 @@ class Random : public Serializable * @ingroup api_base_utils */ template - typename std::enable_if::value, T>::type + typename std::enable_if_t::value, T> random() { // [0, max_value] for integer types @@ -94,7 +94,7 @@ class Random : public Serializable * @ingroup api_base_utils */ template - typename std::enable_if::value, T>::type + typename std::enable_if_t::value, T> random() { // [0, 1) for real types @@ -105,7 +105,7 @@ class Random : public Serializable * @ingroup api_base_utils */ template - typename std::enable_if::value, T>::type + typename std::enable_if_t::value, T> random(T min, T max) { std::uniform_int_distribution dist(min, max); diff --git a/src/base/refcnt.hh b/src/base/refcnt.hh index b4eeabfe7..263666ea8 100644 --- a/src/base/refcnt.hh +++ b/src/base/refcnt.hh @@ -219,7 +219,7 @@ class RefCountingPtr T *get() const { return data; } template - operator RefCountingPtr::type>() + operator RefCountingPtr>() { return RefCountingPtr(*this); } diff --git a/src/base/statistics.hh b/src/base/statistics.hh index 2c1b1a121..1ad64e985 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -812,8 +812,8 @@ class FunctorProxy : public ProxyInfo */ template class FunctorProxy, - const T &>::value>::type> : public ProxyInfo + typename std::enable_if_t, + const T &>::value>> : public ProxyInfo { private: std::function functor; diff --git a/src/base/str.hh b/src/base/str.hh index 8c05a8d13..40fd780fd 100644 --- a/src/base/str.hh +++ b/src/base/str.hh @@ -108,8 +108,8 @@ tokenize(std::vector &vector, const std::string &s, * integeral type, as well as enums and floating-point types. */ template -typename std::enable_if::value && - std::is_signed::value, T>::type +typename std::enable_if_t::value && + std::is_signed::value, T> __to_number(const std::string &value) { // start big and narrow it down if needed, determine the base dynamically @@ -122,8 +122,8 @@ __to_number(const std::string &value) } template -typename std::enable_if::value && - !std::is_signed::value, T>::type +typename std::enable_if_t::value && + !std::is_signed::value, T> __to_number(const std::string &value) { // start big and narrow it down if needed, determine the base dynamically @@ -134,7 +134,7 @@ __to_number(const std::string &value) } template -typename std::enable_if::value, T>::type +typename std::enable_if_t::value, T> __to_number(const std::string &value) { auto r = __to_number::type>(value); @@ -142,7 +142,7 @@ __to_number(const std::string &value) } template -typename std::enable_if::value, T>::type +typename std::enable_if_t::value, T> __to_number(const std::string &value) { // start big and narrow it down if needed diff --git a/src/sim/guest_abi.test.cc b/src/sim/guest_abi.test.cc index 8edf5d35a..1828d85aa 100644 --- a/src/sim/guest_abi.test.cc +++ b/src/sim/guest_abi.test.cc @@ -106,7 +106,7 @@ struct Argument template struct Argument::value>::type> + typename std::enable_if_t::value>> { static Arg get(ThreadContext *tc, TestABI_1D::State &state) @@ -127,7 +127,7 @@ struct Result template struct Result::value>::type> + typename std::enable_if_t::value>> { static void store(ThreadContext *tc, const Ret &ret) @@ -181,7 +181,7 @@ struct Argument template struct Argument::value>::type> + typename std::enable_if_t::value>> { static Arg get(ThreadContext *tc, TestABI_2D::State &state) @@ -202,7 +202,7 @@ struct Result template struct Result::value>::type> + typename std::enable_if_t::value>> { static void store(ThreadContext *tc, const Ret &ret) diff --git a/src/sim/guest_abi/dispatch.hh b/src/sim/guest_abi/dispatch.hh index 794fd6280..bc365b979 100644 --- a/src/sim/guest_abi/dispatch.hh +++ b/src/sim/guest_abi/dispatch.hh @@ -53,8 +53,7 @@ namespace GuestABI // With no arguments to gather, call the target function and store the // result. template -static typename std::enable_if::value && store_ret, - Ret>::type +static typename std::enable_if_t::value && store_ret, Ret> callFrom(ThreadContext *tc, typename ABI::State &state, std::function target) { @@ -64,8 +63,7 @@ callFrom(ThreadContext *tc, typename ABI::State &state, } template -static typename std::enable_if::value && !store_ret, - Ret>::type +static typename std::enable_if_t::value && !store_ret, Ret> callFrom(ThreadContext *tc, typename ABI::State &state, std::function target) { @@ -85,7 +83,7 @@ callFrom(ThreadContext *tc, typename ABI::State &state, // case above. template -static typename std::enable_if::value, Ret>::type +static typename std::enable_if_t::value, Ret> callFrom(ThreadContext *tc, typename ABI::State &state, std::function target) { diff --git a/src/sim/guest_abi/layout.hh b/src/sim/guest_abi/layout.hh index d5df3a7c4..bb46d6207 100644 --- a/src/sim/guest_abi/layout.hh +++ b/src/sim/guest_abi/layout.hh @@ -52,9 +52,8 @@ struct StateInitializer }; template -struct StateInitializer::value - >::type> +struct StateInitializer::value>> { static typename ABI::State init(const ThreadContext *tc) @@ -152,9 +151,9 @@ template std::false_type foo(void (*)(ThreadContext *, const Ret &ret)); template -struct ResultStorer::store)>::value>::type> + decltype(&Result::store)>::value>> { static void store(ThreadContext *tc, const Ret &ret, typename ABI::State &state) diff --git a/src/sim/proxy_ptr.hh b/src/sim/proxy_ptr.hh index a59bbff66..02263bae4 100644 --- a/src/sim/proxy_ptr.hh +++ b/src/sim/proxy_ptr.hh @@ -134,16 +134,16 @@ class ConstProxyPtr using Type = T; template ::value, int>::type = 0> + typename std::enable_if_t::value, int> = 0> explicit ConstProxyPtr(Addr _ptr, Args&&... args) : proxy(std::make_shared(args...)) { setAddr(_ptr); } template ::value, int>::type = 0> + typename std::enable_if_t::value, int> = 0> explicit ConstProxyPtr(Args&&... args) : proxy(std::make_shared(args...)) { @@ -151,7 +151,7 @@ class ConstProxyPtr } template ::value>::type> + typename std::enable_if_t::value>> ConstProxyPtr(const ConstProxyPtr &other) : proxy(other.proxy), buffer(other.buffer) {} @@ -171,14 +171,14 @@ class ConstProxyPtr operator bool() const { return (bool)buffer; } template - typename std::enable_if::value, CPP>::type + typename std::enable_if_t::value, CPP> operator + (A a) const { return CPP(addr() + a * sizeof(T), proxy); } template - typename std::enable_if::value, CPP>::type + typename std::enable_if_t::value, CPP> operator - (A a) const { return CPP(addr() - a * sizeof(T), proxy); @@ -225,8 +225,7 @@ class ConstProxyPtr }; template -typename std::enable_if::value, - ConstProxyPtr>::type +typename std::enable_if_t::value, ConstProxyPtr> operator + (A a, const ConstProxyPtr &other) { return other + a; @@ -243,16 +242,16 @@ class ProxyPtr : public ConstProxyPtr public: template ::value, int>::type = 0> + typename std::enable_if_t::value, int> = 0> explicit ProxyPtr(Addr _ptr, Args&&... args) : CPP(_ptr, args...) {} template ::value, int>::type = 0> + typename std::enable_if_t::value, int> = 0> explicit ProxyPtr(Args&&... args) : CPP(0, args...) {} template ::value>::type> + typename std::enable_if_t::value>> ProxyPtr(const ProxyPtr &other) : CPP(other) {} ProxyPtr(const PP &other) : CPP(other) {} @@ -266,14 +265,14 @@ class ProxyPtr : public ConstProxyPtr } template - typename std::enable_if::value, PP>::type + typename std::enable_if_t::value, PP> operator + (A a) const { return PP(this->addr() + a * sizeof(T), this->proxy); } template - typename std::enable_if::value, PP>::type + typename std::enable_if_t::value, PP> operator - (A a) const { return PP(this->addr() - a * sizeof(T), this->proxy); @@ -324,7 +323,7 @@ class ProxyPtr : public ConstProxyPtr }; template -typename std::enable_if::value, ProxyPtr>::type +typename std::enable_if_t::value, ProxyPtr> operator + (A a, const ProxyPtr &other) { return other + a; diff --git a/src/sim/syscall_abi.hh b/src/sim/syscall_abi.hh index 533dece47..529160868 100644 --- a/src/sim/syscall_abi.hh +++ b/src/sim/syscall_abi.hh @@ -62,19 +62,19 @@ struct GenericSyscallABI32 : public GenericSyscallABI struct IsWide; template - struct IsWide::value && (sizeof(T) < sizeof(uint64_t) || - GuestABI::IsConforming::value)>::type> + GuestABI::IsConforming::value)>> { static const bool value = false; }; template - struct IsWide::value && sizeof(T) == sizeof(uint64_t) && - !GuestABI::IsConforming::value>::type> + !GuestABI::IsConforming::value>> { static const bool value = true; }; @@ -95,9 +95,9 @@ namespace GuestABI // For 64 bit systems, return syscall args directly. template struct Argument::value && - std::is_integral::value>::type> + std::is_integral::value>> { static Arg get(ThreadContext *tc, typename ABI::State &state) @@ -112,7 +112,7 @@ struct Argument struct Argument::value>::type> + typename std::enable_if_t::value>> { static Arg get(ThreadContext *tc, typename ABI::State &state) -- 2.30.2