From c84f7715ef73036b6b862b135881de991f66d0d4 Mon Sep 17 00:00:00 2001 From: Aina Niemetz Date: Fri, 26 Mar 2021 11:32:38 -0700 Subject: [PATCH] FloatingPointLiteral: Make constructors that shouldn't be used outside of FloatingPoint(Literal) private. (#6211) --- src/util/floatingpoint_literal_symfpu.h.in | 69 +++++++++++----------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/util/floatingpoint_literal_symfpu.h.in b/src/util/floatingpoint_literal_symfpu.h.in index d7e1a2241..2424bad66 100644 --- a/src/util/floatingpoint_literal_symfpu.h.in +++ b/src/util/floatingpoint_literal_symfpu.h.in @@ -342,40 +342,6 @@ class FloatingPointLiteral const BitVector& bv, bool signedBV); - /** - * Create a FP literal from unpacked representation. - * - * This unpacked representation accounts for additional bits required for the - * exponent to allow subnormals to be normalized. - * - * This should NOT be used to create a literal from its IEEE bit-vector - * representation -- for this, the above constructor is to be used while - * creating a SymFPUUnpackedFloatLiteral via symfpu::unpack. - */ - FloatingPointLiteral(const FloatingPointSize& size, - const bool sign, - const BitVector& exp, - const BitVector& sig) - : d_fp_size(size) -// clang-format off -#if @CVC4_USE_SYMFPU@ - // clang-format on - , - d_symuf(SymFPUUnpackedFloatLiteral(sign, exp, sig)) -#endif - { - } - -// clang-format off -#if @CVC4_USE_SYMFPU@ - // clang-format on - - /** Create a FP literal from a symFPU unpacked float. */ - FloatingPointLiteral(const FloatingPointSize& size, - SymFPUUnpackedFloatLiteral symuf) - : d_fp_size(size), d_symuf(symuf){}; -#endif - ~FloatingPointLiteral() {} /** Return the size of this FP literal. */ @@ -489,6 +455,41 @@ class FloatingPointLiteral #endif private: + + /** + * Create a FP literal from unpacked representation. + * + * This unpacked representation accounts for additional bits required for the + * exponent to allow subnormals to be normalized. + * + * This should NOT be used to create a literal from its IEEE bit-vector + * representation -- for this, the above constructor is to be used while + * creating a SymFPUUnpackedFloatLiteral via symfpu::unpack. + */ + FloatingPointLiteral(const FloatingPointSize& size, + const bool sign, + const BitVector& exp, + const BitVector& sig) + : d_fp_size(size) +// clang-format off +#if @CVC4_USE_SYMFPU@ + // clang-format on + , + d_symuf(SymFPUUnpackedFloatLiteral(sign, exp, sig)) +#endif + { + } + +// clang-format off +#if @CVC4_USE_SYMFPU@ + // clang-format on + + /** Create a FP literal from a symFPU unpacked float. */ + FloatingPointLiteral(const FloatingPointSize& size, + SymFPUUnpackedFloatLiteral symuf) + : d_fp_size(size), d_symuf(symuf){}; +#endif + /** The floating-point size of this floating-point literal. */ FloatingPointSize d_fp_size; // clang-format off -- 2.30.2