[PATCH] D26269: [APFloat] Make functions that produce APFloaat objects use correct semantics.

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 14:20:13 PDT 2016


timshen added a comment.

In https://reviews.llvm.org/D26269#586853, @hfinkel wrote:

> Can you please explain the problem/solution?


Added. Sorry for the oversight!



================
Comment at: llvm/include/llvm/ADT/APFloat.h:645
+    explicit Storage(DoubleAPFloat F, const fltSemantics &S)
+        : Double(std::move(F)) {}
 
----------------
hfinkel wrote:
> Why is S unused? If we're assuming that `semantics` is initialized elsewhere, a comment would be useful explaining why we have the argument.
It should be propagated into DoubleAPFloat, but currently DoubleAPFloat doesn't need to support conversion between different semantics (it only has one!). Put an assert there, and someday DoubleAPFloat may change to actually consume this fltSemantic.


https://reviews.llvm.org/D26269





More information about the llvm-commits mailing list