Просмотр исходного кода

Library import 5, delete go dependencies (#832)

* Library import 5, delete go dependencies

* Fix yt client
AlexSm 1 год назад
Родитель
Сommit
dab291146f

+ 12 - 5
build/conf/bison_lex.conf

@@ -26,13 +26,20 @@ _CPP_BISON_SKELS=\
 _BISON_GEN_EXT=.cpp
 _FLEX_GEN_EXT=.cpp
 
-_BISON_HEADER=--defines=${nopath;noext;output;main;addincl;norel;suf=.h:SRC}
-_BISON_PP=$YMAKE_PYTHON ${input:"build/scripts/preprocess.py"} $_ADD_HIDDEN_INPUTS($_CPP_BISON_SKELS) ${nopath;noext;tmp:SRC.h}
-
-_FLEX_TOOL=${tool:"contrib/tools/flex-old"}
-_FLEX_TOOL_DIR=contrib/tools/flex-old
+_BISON_HEADER=
+_BISON_PP=
+_FLEX_TOOL=
+_FLEX_TOOL_DIR=
 _FLEX_HEADER=
 
+when ($_BISON_FLEX_SET_DEFAULTS == "yes") {
+    _BISON_HEADER=--defines=${nopath;noext;output;main;addincl;norel;suf=.h:SRC}
+    _BISON_PP=$YMAKE_PYTHON ${input:"build/scripts/preprocess.py"} $_ADD_HIDDEN_INPUTS($_CPP_BISON_SKELS) ${nopath;noext;tmp:SRC.h}
+    _FLEX_TOOL=${tool:"contrib/tools/flex-old"}
+    _FLEX_TOOL_DIR=contrib/tools/flex-old
+    _FLEX_HEADER=
+}
+
 ### @usage: FLEX_FLAGS(<flags>)
 ###
 ### Set flags for Lex tool (flex) invocations.

+ 1 - 1
build/scripts/clang_tidy.py

@@ -158,7 +158,7 @@ def main():
         "-p",
         compile_command_path,
         "--warnings-as-errors",
-        "*",
+        "*,-clang-diagnostic-#pragma-messages",
         "--config-file",
         result_config_file,
         "--header-filter",

+ 1 - 0
build/ymake.core.conf

@@ -783,6 +783,7 @@ module _BASE_UNIT: _BARE_UNIT {
     }
 
     ENABLE(USE_YASM_ASSEMBLER)
+    ENABLE(_BISON_FLEX_SET_DEFAULTS)
 }
 
 _LINKER_ID=

+ 6 - 4
build/ymake_conf.py

@@ -75,6 +75,7 @@ class Platform(object):
         self.is_riscv32 = self.is_rv32imc
 
         self.is_nds32 = self.arch in ('nds32le_elf_mculib_v5f',)
+        self.is_tc32 = self.arch in ('tc32_elf',)
 
         self.is_xtensa = self.arch in ('xtensa_hifi5',)
 
@@ -100,7 +101,7 @@ class Platform(object):
         self.is_wasm64 = self.arch == 'wasm64'
         self.is_wasm = self.is_wasm64
 
-        self.is_32_bit = self.is_x86 or self.is_armv7 or self.is_armv8m or self.is_riscv32 or self.is_nds32 or self.is_armv7em or self.is_xtensa
+        self.is_32_bit = self.is_x86 or self.is_armv7 or self.is_armv8m or self.is_riscv32 or self.is_nds32 or self.is_armv7em or self.is_xtensa or self.is_tc32
         self.is_64_bit = self.is_x86_64 or self.is_armv8 or self.is_powerpc or self.is_wasm64
 
         assert self.is_32_bit or self.is_64_bit
@@ -183,6 +184,7 @@ class Platform(object):
             (self.is_riscv32, 'ARCH_RISCV32'),
             (self.is_xtensa, 'ARCH_XTENSA'),
             (self.is_nds32, 'ARCH_NDS32'),
+            (self.is_tc32, 'ARCH_TC32'),
             (self.is_wasm64, 'ARCH_WASM64'),
             (self.is_32_bit, 'ARCH_TYPE_32'),
             (self.is_64_bit, 'ARCH_TYPE_64'),
@@ -1047,7 +1049,7 @@ class GnuToolchainOptions(ToolchainOptions):
 
         self.os_sdk_local = False
 
-        if build.target.is_apple and to_bool(preset('APPLE_SDK_LOCAL'), default=False):
+        if build.host.is_apple and build.target.is_apple and to_bool(preset('APPLE_SDK_LOCAL'), default=False):
             self.os_sdk_local = True
 
         if self.os_sdk == 'local':
@@ -1406,8 +1408,8 @@ class GnuCompiler(Compiler):
                 '-fdebug-default-version=4',
             ]
         elif self.tc.is_gcc:
-            if self.target.is_xtensa:
-                # Xtensa toolchain does not support this flag
+            if self.target.is_xtensa or self.target.is_tc32:
+                # Xtensa and tc32 toolchains does not support this flag
                 pass
             else:
                 self.c_foptions += [

+ 0 - 158
contrib/clickhouse/base/base/BorrowedObjectPool.h

@@ -1,158 +0,0 @@
-#pragma once
-
-#include <cstdint>
-#include <vector>
-#include <chrono>
-#include <mutex>
-#include <condition_variable>
-
-#include <base/defines.h>
-#include <base/MoveOrCopyIfThrow.h>
-
-/** Pool for limited size objects that cannot be used from different threads simultaneously.
-  * The main use case is to have fixed size of objects that can be reused in different threads during their lifetime
-  * and have to be initialized on demand.
-  * Two main properties of pool are allocated objects size and borrowed objects size.
-  * Allocated objects size is size of objects that are currently allocated by the pool.
-  * Borrowed objects size is size of objects that are borrowed by clients.
-  * If max_size == 0 then pool has unlimited size and objects will be allocated without limit.
-  *
-  * Pool provides following strategy for borrowing object:
-  * If max_size == 0 then pool has unlimited size and objects will be allocated without limit.
-  * 1. If pool has objects that can be borrowed increase borrowed objects size and return it.
-  * 2. If pool allocatedObjectsSize is lower than max objects size or pool has unlimited size
-  * allocate new object, increase borrowed objects size and return it.
-  * 3. If pool is full wait on condition variable with or without timeout until some object
-  * will be returned to the pool.
-  */
-template <typename T>
-class BorrowedObjectPool final
-{
-public:
-    explicit BorrowedObjectPool(size_t max_size_) : max_size(max_size_) {}
-
-    /// Borrow object from pool. If pull is full and all objects were borrowed
-    /// then calling thread will wait until some object will be returned into pool.
-    template <typename FactoryFunc>
-    void borrowObject(T & dest, FactoryFunc && func)
-    {
-        std::unique_lock<std::mutex> lock(objects_mutex);
-
-        if (!objects.empty())
-        {
-            dest = borrowFromObjects(lock);
-            return;
-        }
-
-        bool has_unlimited_size = (max_size == 0);
-
-        if (unlikely(has_unlimited_size) || allocated_objects_size < max_size)
-        {
-            dest = allocateObjectForBorrowing(lock, std::forward<FactoryFunc>(func));
-            return;
-        }
-
-        condition_variable.wait(lock, [this] { return !objects.empty(); });
-        dest = borrowFromObjects(lock);
-    }
-
-    /// Same as borrowObject function, but wait with timeout.
-    /// Returns true if object was borrowed during timeout.
-    template <typename FactoryFunc>
-    bool tryBorrowObject(T & dest, FactoryFunc && func, size_t timeout_in_milliseconds = 0)
-    {
-        std::unique_lock<std::mutex> lock(objects_mutex);
-
-        if (!objects.empty())
-        {
-            dest = borrowFromObjects(lock);
-            return true;
-        }
-
-        bool has_unlimited_size = (max_size == 0);
-
-        if (unlikely(has_unlimited_size) || allocated_objects_size < max_size)
-        {
-            dest = allocateObjectForBorrowing(lock, std::forward<FactoryFunc>(func));
-            return true;
-        }
-
-        bool wait_result = condition_variable.wait_for(lock, std::chrono::milliseconds(timeout_in_milliseconds), [this] { return !objects.empty(); });
-
-        if (wait_result)
-            dest = borrowFromObjects(lock);
-
-        return wait_result;
-    }
-
-    /// Return object into pool. Client must return same object that was borrowed.
-    inline void returnObject(T && object_to_return)
-    {
-        {
-            std::lock_guard lock(objects_mutex);
-
-            objects.emplace_back(std::move(object_to_return));
-            --borrowed_objects_size;
-        }
-
-        condition_variable.notify_one();
-    }
-
-    /// Max pool size
-    inline size_t maxSize() const
-    {
-        return max_size;
-    }
-
-    /// Allocated objects size by the pool. If allocatedObjectsSize == maxSize then pool is full.
-    inline size_t allocatedObjectsSize() const
-    {
-        std::lock_guard lock(objects_mutex);
-        return allocated_objects_size;
-    }
-
-    /// Returns allocatedObjectsSize == maxSize
-    inline bool isFull() const
-    {
-        std::lock_guard lock(objects_mutex);
-        return allocated_objects_size == max_size;
-    }
-
-    /// Borrowed objects size. If borrowedObjectsSize == allocatedObjectsSize and pool is full.
-    /// Then client will wait during borrowObject function call.
-    inline size_t borrowedObjectsSize() const
-    {
-        std::lock_guard lock(objects_mutex);
-        return borrowed_objects_size;
-    }
-
-private:
-
-    template <typename FactoryFunc>
-    inline T allocateObjectForBorrowing(const std::unique_lock<std::mutex> &, FactoryFunc && func)
-    {
-        ++allocated_objects_size;
-        ++borrowed_objects_size;
-
-        return std::forward<FactoryFunc>(func)();
-    }
-
-    inline T borrowFromObjects(const std::unique_lock<std::mutex> &)
-    {
-        T dst;
-        detail::moveOrCopyIfThrow(std::move(objects.back()), dst);
-        objects.pop_back();
-
-        ++borrowed_objects_size;
-
-        return dst;
-    }
-
-    size_t max_size;
-
-    mutable std::mutex objects_mutex;
-    std::condition_variable condition_variable;
-    size_t allocated_objects_size = 0;
-    size_t borrowed_objects_size = 0;
-    std::vector<T> objects;
-};

+ 0 - 14
contrib/clickhouse/base/base/DayNum.h

@@ -1,14 +0,0 @@
-#pragma once
-
-#include <base/types.h>
-#include <base/strong_typedef.h>
-
-/** Represents number of days since 1970-01-01.
-  * See DateLUTImpl for usage examples.
-  */
-STRONG_TYPEDEF(UInt16, DayNum)
-
-/** Represent number of days since 1970-01-01 but in extended range,
- * for dates before 1970-01-01 and after 2105
- */
-STRONG_TYPEDEF(Int32, ExtendedDayNum)

+ 0 - 141
contrib/clickhouse/base/base/Decimal.h

@@ -1,141 +0,0 @@
-#pragma once
-#include <base/extended_types.h>
-#include <base/Decimal_fwd.h>
-
-#if !defined(NO_SANITIZE_UNDEFINED)
-#if defined(__clang__)
-    #define NO_SANITIZE_UNDEFINED __attribute__((__no_sanitize__("undefined")))
-#else
-    #define NO_SANITIZE_UNDEFINED
-#endif
-#endif
-
-namespace DB
-{
-template <class> struct Decimal;
-class DateTime64;
-
-using Decimal32 = Decimal<Int32>;
-using Decimal64 = Decimal<Int64>;
-using Decimal128 = Decimal<Int128>;
-using Decimal256 = Decimal<Int256>;
-
-template <class T> struct NativeTypeT { using Type = T; };
-template <is_decimal T> struct NativeTypeT<T> { using Type = typename T::NativeType; };
-template <class T> using NativeType = typename NativeTypeT<T>::Type;
-
-/// Own FieldType for Decimal.
-/// It is only a "storage" for decimal.
-/// To perform operations, you also have to provide a scale (number of digits after point).
-template <typename T>
-struct Decimal
-{
-    using NativeType = T;
-
-    constexpr Decimal() = default;
-    constexpr Decimal(Decimal<T> &&) noexcept = default;
-    constexpr Decimal(const Decimal<T> &) = default;
-
-    constexpr Decimal(const T & value_): value(value_) {} // NOLINT(google-explicit-constructor)
-
-    template <typename U>
-    constexpr Decimal(const Decimal<U> & x): value(x.value) {} // NOLINT(google-explicit-constructor)
-
-    constexpr Decimal<T> & operator=(Decimal<T> &&) noexcept = default;
-    constexpr Decimal<T> & operator = (const Decimal<T> &) = default;
-
-    constexpr operator T () const { return value; } // NOLINT(google-explicit-constructor)
-
-    template <typename U>
-    constexpr U convertTo() const
-    {
-        if constexpr (is_decimal<U>)
-            return convertTo<typename U::NativeType>();
-        else
-            return static_cast<U>(value);
-    }
-
-    const Decimal<T> & operator += (const T & x) { value += x; return *this; }
-    const Decimal<T> & operator -= (const T & x) { value -= x; return *this; }
-    const Decimal<T> & operator *= (const T & x) { value *= x; return *this; }
-    const Decimal<T> & operator /= (const T & x) { value /= x; return *this; }
-    const Decimal<T> & operator %= (const T & x) { value %= x; return *this; }
-
-    template <typename U> const Decimal<T> & operator += (const Decimal<U> & x) { value += x.value; return *this; }
-    template <typename U> const Decimal<T> & operator -= (const Decimal<U> & x) { value -= x.value; return *this; }
-    template <typename U> const Decimal<T> & operator *= (const Decimal<U> & x) { value *= x.value; return *this; }
-    template <typename U> const Decimal<T> & operator /= (const Decimal<U> & x) { value /= x.value; return *this; }
-    template <typename U> const Decimal<T> & operator %= (const Decimal<U> & x) { value %= x.value; return *this; }
-
-    /// This is to avoid UB for sumWithOverflow()
-    void NO_SANITIZE_UNDEFINED addOverflow(const T & x) { value += x; }
-
-    T value;
-};
-
-template <typename T> inline bool operator< (const Decimal<T> & x, const Decimal<T> & y) { return x.value < y.value; }
-template <typename T> inline bool operator> (const Decimal<T> & x, const Decimal<T> & y) { return x.value > y.value; }
-template <typename T> inline bool operator<= (const Decimal<T> & x, const Decimal<T> & y) { return x.value <= y.value; }
-template <typename T> inline bool operator>= (const Decimal<T> & x, const Decimal<T> & y) { return x.value >= y.value; }
-template <typename T> inline bool operator== (const Decimal<T> & x, const Decimal<T> & y) { return x.value == y.value; }
-template <typename T> inline bool operator!= (const Decimal<T> & x, const Decimal<T> & y) { return x.value != y.value; }
-
-template <typename T> inline Decimal<T> operator+ (const Decimal<T> & x, const Decimal<T> & y) { return x.value + y.value; }
-template <typename T> inline Decimal<T> operator- (const Decimal<T> & x, const Decimal<T> & y) { return x.value - y.value; }
-template <typename T> inline Decimal<T> operator* (const Decimal<T> & x, const Decimal<T> & y) { return x.value * y.value; }
-template <typename T> inline Decimal<T> operator/ (const Decimal<T> & x, const Decimal<T> & y) { return x.value / y.value; }
-template <typename T> inline Decimal<T> operator- (const Decimal<T> & x) { return -x.value; }
-
-/// Distinguishable type to allow function resolution/deduction based on value type,
-/// but also relatively easy to convert to/from Decimal64.
-class DateTime64 : public Decimal64
-{
-public:
-    using Base = Decimal64;
-    using Base::Base;
-    using NativeType = Base::NativeType;
-
-    constexpr DateTime64(const Base & v): Base(v) {} // NOLINT(google-explicit-constructor)
-};
-}
-
-constexpr DB::UInt64 max_uint_mask = std::numeric_limits<DB::UInt64>::max();
-
-namespace std
-{
-    template <typename T>
-    struct hash<DB::Decimal<T>>
-    {
-        size_t operator()(const DB::Decimal<T> & x) const { return hash<T>()(x.value); }
-    };
-
-    template <>
-    struct hash<DB::Decimal128>
-    {
-        size_t operator()(const DB::Decimal128 & x) const
-        {
-            return std::hash<DB::Int64>()(x.value >> 64)
-                ^ std::hash<DB::Int64>()(x.value & max_uint_mask);
-        }
-    };
-
-    template <>
-    struct hash<DB::DateTime64>
-    {
-        size_t operator()(const DB::DateTime64 & x) const
-        {
-            return std::hash<DB::DateTime64::NativeType>()(x);
-        }
-    };
-
-    template <>
-    struct hash<DB::Decimal256>
-    {
-        size_t operator()(const DB::Decimal256 & x) const
-        {
-            // FIXME temp solution
-            return std::hash<DB::Int64>()(static_cast<DB::Int64>(x.value >> 64 & max_uint_mask))
-                ^ std::hash<DB::Int64>()(static_cast<DB::Int64>(x.value & max_uint_mask));
-        }
-    };
-}

+ 0 - 46
contrib/clickhouse/base/base/Decimal_fwd.h

@@ -1,46 +0,0 @@
-#pragma once
-
-#include <base/types.h>
-
-namespace wide
-{
-
-template <size_t Bits, typename Signed>
-class integer;
-
-}
-
-using Int128 = wide::integer<128, signed>;
-using UInt128 = wide::integer<128, unsigned>;
-using Int256 = wide::integer<256, signed>;
-using UInt256 = wide::integer<256, unsigned>;
-
-namespace DB
-{
-
-template <class> struct Decimal;
-
-using Decimal32 = Decimal<Int32>;
-using Decimal64 = Decimal<Int64>;
-using Decimal128 = Decimal<Int128>;
-using Decimal256 = Decimal<Int256>;
-
-class DateTime64;
-
-template <class T>
-concept is_decimal =
-    std::is_same_v<T, Decimal32>
-    || std::is_same_v<T, Decimal64>
-    || std::is_same_v<T, Decimal128>
-    || std::is_same_v<T, Decimal256>
-    || std::is_same_v<T, DateTime64>;
-
-template <class T>
-concept is_over_big_int =
-    std::is_same_v<T, Int128>
-    || std::is_same_v<T, UInt128>
-    || std::is_same_v<T, Int256>
-    || std::is_same_v<T, UInt256>
-    || std::is_same_v<T, Decimal128>
-    || std::is_same_v<T, Decimal256>;
-}

+ 0 - 219
contrib/clickhouse/base/base/DecomposedFloat.h

@@ -1,219 +0,0 @@
-#pragma once
-
-#include <cstdint>
-#include <cstddef>
-#include <cstring>
-#include <base/extended_types.h>
-
-
-/// Allows to check the internals of IEEE-754 floating point number.
-
-template <typename T> struct FloatTraits;
-
-template <>
-struct FloatTraits<float>
-{
-    using UInt = uint32_t;
-    static constexpr size_t bits = 32;
-    static constexpr size_t exponent_bits = 8;
-    static constexpr size_t mantissa_bits = bits - exponent_bits - 1;
-};
-
-template <>
-struct FloatTraits<double>
-{
-    using UInt = uint64_t;
-    static constexpr size_t bits = 64;
-    static constexpr size_t exponent_bits = 11;
-    static constexpr size_t mantissa_bits = bits - exponent_bits - 1;
-};
-
-
-/// x = sign * (2 ^ normalized_exponent) * (1 + mantissa * 2 ^ -mantissa_bits)
-/// x = sign * (2 ^ normalized_exponent + mantissa * 2 ^ (normalized_exponent - mantissa_bits))
-template <typename T>
-struct DecomposedFloat
-{
-    using Traits = FloatTraits<T>;
-
-    explicit DecomposedFloat(T x)
-    {
-        memcpy(&x_uint, &x, sizeof(x));
-    }
-
-    typename Traits::UInt x_uint;
-
-    bool isNegative() const
-    {
-        return x_uint >> (Traits::bits - 1);
-    }
-
-    /// Returns 0 for both +0. and -0.
-    int sign() const
-    {
-        return (exponent() == 0 && mantissa() == 0)
-            ? 0
-            : (isNegative()
-                ? -1
-                : 1);
-    }
-
-    uint16_t exponent() const
-    {
-        return (x_uint >> (Traits::mantissa_bits)) & (((1ull << (Traits::exponent_bits + 1)) - 1) >> 1);
-    }
-
-    int16_t normalizedExponent() const
-    {
-        return int16_t(exponent()) - ((1ull << (Traits::exponent_bits - 1)) - 1);
-    }
-
-    uint64_t mantissa() const
-    {
-        return x_uint & ((1ull << Traits::mantissa_bits) - 1);
-    }
-
-    int64_t mantissaWithSign() const
-    {
-        return isNegative() ? -mantissa() : mantissa();
-    }
-
-    /// NOTE Probably floating point instructions can be better.
-    bool isIntegerInRepresentableRange() const
-    {
-        return x_uint == 0
-            || (normalizedExponent() >= 0  /// The number is not less than one
-                /// The number is inside the range where every integer has exact representation in float
-                && normalizedExponent() <= static_cast<int16_t>(Traits::mantissa_bits)
-                /// After multiplying by 2^exp, the fractional part becomes zero, means the number is integer
-                && ((mantissa() & ((1ULL << (Traits::mantissa_bits - normalizedExponent())) - 1)) == 0));
-    }
-
-
-    /// Compare float with integer of arbitrary width (both signed and unsigned are supported). Assuming two's complement arithmetic.
-    /// This function is generic, big integers (128, 256 bit) are supported as well.
-    /// Infinities are compared correctly. NaNs are treat similarly to infinities, so they can be less than all numbers.
-    /// (note that we need total order)
-    /// Returns -1, 0 or 1.
-    template <typename Int>
-    int compare(Int rhs) const
-    {
-        if (rhs == 0)
-            return sign();
-
-        /// Different signs
-        if (isNegative() && rhs > 0)
-            return -1;
-        if (!isNegative() && rhs < 0)
-            return 1;
-
-        /// Fractional number with magnitude less than one
-        if (normalizedExponent() < 0)
-        {
-            if (!isNegative())
-                return rhs > 0 ? -1 : 1;
-            else
-                return rhs >= 0 ? -1 : 1;
-        }
-
-        /// The case of the most negative integer
-        if constexpr (is_signed_v<Int>)
-        {
-            if (rhs == std::numeric_limits<Int>::lowest())
-            {
-                assert(isNegative());
-
-                if (normalizedExponent() < static_cast<int16_t>(8 * sizeof(Int) - is_signed_v<Int>))
-                    return 1;
-                if (normalizedExponent() > static_cast<int16_t>(8 * sizeof(Int) - is_signed_v<Int>))
-                    return -1;
-
-                if (mantissa() == 0)
-                    return 0;
-                else
-                    return -1;
-            }
-        }
-
-        /// Too large number: abs(float) > abs(rhs). Also the case with infinities and NaN.
-        if (normalizedExponent() >= static_cast<int16_t>(8 * sizeof(Int) - is_signed_v<Int>))
-            return isNegative() ? -1 : 1;
-
-        using UInt = std::conditional_t<(sizeof(Int) > sizeof(typename Traits::UInt)), make_unsigned_t<Int>, typename Traits::UInt>;
-        UInt uint_rhs = rhs < 0 ? -rhs : rhs;
-
-        /// Smaller octave: abs(rhs) < abs(float)
-        /// FYI, TIL: octave is also called "binade", https://en.wikipedia.org/wiki/Binade
-        if (uint_rhs < (static_cast<UInt>(1) << normalizedExponent()))
-            return isNegative() ? -1 : 1;
-
-        /// Larger octave: abs(rhs) > abs(float)
-        if (normalizedExponent() + 1 < static_cast<int16_t>(8 * sizeof(Int) - is_signed_v<Int>)
-            && uint_rhs >= (static_cast<UInt>(1) << (normalizedExponent() + 1)))
-            return isNegative() ? 1 : -1;
-
-        /// The same octave
-        /// uint_rhs == 2 ^ normalizedExponent + mantissa * 2 ^ (normalizedExponent - mantissa_bits)
-
-        bool large_and_always_integer = normalizedExponent() >= static_cast<int16_t>(Traits::mantissa_bits);
-
-        UInt a = large_and_always_integer
-            ? static_cast<UInt>(mantissa()) << (normalizedExponent() - Traits::mantissa_bits)
-            : static_cast<UInt>(mantissa()) >> (Traits::mantissa_bits - normalizedExponent());
-
-        UInt b = uint_rhs - (static_cast<UInt>(1) << normalizedExponent());
-
-        if (a < b)
-            return isNegative() ? 1 : -1;
-        if (a > b)
-            return isNegative() ? -1 : 1;
-
-        /// Float has no fractional part means that the numbers are equal.
-        if (large_and_always_integer || (mantissa() & ((1ULL << (Traits::mantissa_bits - normalizedExponent())) - 1)) == 0)
-            return 0;
-        else
-            /// Float has fractional part means its abs value is larger.
-            return isNegative() ? -1 : 1;
-    }
-
-
-    template <typename Int>
-    bool equals(Int rhs) const
-    {
-        return compare(rhs) == 0;
-    }
-
-    template <typename Int>
-    bool notEquals(Int rhs) const
-    {
-        return compare(rhs) != 0;
-    }
-
-    template <typename Int>
-    bool less(Int rhs) const
-    {
-        return compare(rhs) < 0;
-    }
-
-    template <typename Int>
-    bool greater(Int rhs) const
-    {
-        return compare(rhs) > 0;
-    }
-
-    template <typename Int>
-    bool lessOrEquals(Int rhs) const
-    {
-        return compare(rhs) <= 0;
-    }
-
-    template <typename Int>
-    bool greaterOrEquals(Int rhs) const
-    {
-        return compare(rhs) >= 0;
-    }
-};
-
-
-using DecomposedFloat64 = DecomposedFloat<double>;
-using DecomposedFloat32 = DecomposedFloat<float>;

+ 0 - 39
contrib/clickhouse/base/base/EnumReflection.h

@@ -1,39 +0,0 @@
-#pragma once
-
-#include <magic_enum.hpp>
-#include <fmt/format.h>
-
-
-template <class T> concept is_enum = std::is_enum_v<T>;
-
-namespace detail
-{
-template <is_enum E, class F, size_t ...I>
-constexpr void static_for(F && f, std::index_sequence<I...>)
-{
-    (std::forward<F>(f)(std::integral_constant<E, magic_enum::enum_value<E>(I)>()) , ...);
-}
-}
-
-/**
- * Iterate over enum values in compile-time (compile-time switch/case, loop unrolling).
- *
- * @example static_for<E>([](auto enum_value) { return template_func<enum_value>(); }
- * ^ enum_value can be used as a template parameter
- */
-template <is_enum E, class F>
-constexpr void static_for(F && f)
-{
-    constexpr size_t count = magic_enum::enum_count<E>();
-    detail::static_for<E>(std::forward<F>(f), std::make_index_sequence<count>());
-}
-
-/// Enable printing enum values as strings via fmt + magic_enum
-template <is_enum T>
-struct fmt::formatter<T> : fmt::formatter<std::string_view>
-{
-    constexpr auto format(T value, auto& format_context)
-    {
-        return formatter<string_view>::format(magic_enum::enum_name(value), format_context);
-    }
-};

Некоторые файлы не были показаны из-за большого количества измененных файлов