[PATCH] D27934: [APFloat] Remove 'else' after return. NFC

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 14:10:30 PST 2016


timshen added inline comments.


================
Comment at: llvm/include/llvm/ADT/APFloat.h:772-774
     } else {
       llvm_unreachable("Unexpected semantics");
     }
----------------
mehdi_amini wrote:
> Why aren't you doing the same transformation as before here?
This will also work:
    if (usesLayout<IEEEFloat>(*U.semantics))
      return U.IEEE.makeInf(Neg);
    if (usesLayout<DoubleAPFloat>(*U.semantics))
      return U.Double.makeInf(Neg);
    llvm_unreachable("Unexpected semantics");

But @jtony have opinions on returning an expression as void in D27872, and suggested removing the void.

I'm slightly in favor of the early return version, since it's more consistent with other places; but I didn't have many data points from others. I'm happy to change.


https://reviews.llvm.org/D27934





More information about the llvm-commits mailing list