FloatingPointLiteral: Make constructors that shouldn't be used outside of FloatingPoi...
authorAina Niemetz <aina.niemetz@gmail.com>
Fri, 26 Mar 2021 18:32:38 +0000 (11:32 -0700)
committerGitHub <noreply@github.com>
Fri, 26 Mar 2021 18:32:38 +0000 (18:32 +0000)
src/util/floatingpoint_literal_symfpu.h.in

index d7e1a22414cedec68cee5ccbe5572124e1476338..2424bad66c8b00a581ac3ea77e5dac7bb1ab7621 100644 (file)
@@ -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