From 7b57ac44f914e25514b54fa1a254e810a35ec322 Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Wed, 21 Dec 2016 02:39:21 +0000 Subject: [APFloat] Remove 'else' after return. NFC Reviewers: kbarton, iteratee, hfinkel, echristo Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D27934 llvm-svn: 290232 --- llvm/lib/Support/APFloat.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'llvm/lib/Support/APFloat.cpp') diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index 4ad6b07ed2b..30f0deab90a 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -4110,13 +4110,15 @@ void DoubleAPFloat::makeNaN(bool SNaN, bool Neg, const APInt *fill) { APFloat::Storage::Storage(IEEEFloat F, const fltSemantics &Semantics) { if (usesLayout(Semantics)) { new (&IEEE) IEEEFloat(std::move(F)); - } else if (usesLayout(Semantics)) { + return; + } + if (usesLayout(Semantics)) { new (&Double) DoubleAPFloat(Semantics, APFloat(std::move(F), F.getSemantics()), APFloat(semIEEEdouble)); - } else { - llvm_unreachable("Unexpected semantics"); + return; } + llvm_unreachable("Unexpected semantics"); } APFloat::opStatus APFloat::convertFromString(StringRef Str, roundingMode RM) { @@ -4135,24 +4137,24 @@ APFloat::opStatus APFloat::convert(const fltSemantics &ToSemantics, if (&getSemantics() == &ToSemantics) return opOK; if (usesLayout(getSemantics()) && - usesLayout(ToSemantics)) { + usesLayout(ToSemantics)) return U.IEEE.convert(ToSemantics, RM, losesInfo); - } else if (usesLayout(getSemantics()) && - usesLayout(ToSemantics)) { + if (usesLayout(getSemantics()) && + usesLayout(ToSemantics)) { assert(&ToSemantics == &semPPCDoubleDouble); auto Ret = U.IEEE.convert(semPPCDoubleDoubleImpl, RM, losesInfo); - *this = APFloat( - DoubleAPFloat(semPPCDoubleDouble, std::move(*this), APFloat(semIEEEdouble)), - ToSemantics); + *this = APFloat(DoubleAPFloat(semPPCDoubleDouble, std::move(*this), + APFloat(semIEEEdouble)), + ToSemantics); return Ret; - } else if (usesLayout(getSemantics()) && - usesLayout(ToSemantics)) { + } + if (usesLayout(getSemantics()) && + usesLayout(ToSemantics)) { auto Ret = getIEEE().convert(ToSemantics, RM, losesInfo); *this = APFloat(std::move(getIEEE()), ToSemantics); return Ret; - } else { - llvm_unreachable("Unexpected semantics"); } + llvm_unreachable("Unexpected semantics"); } APFloat APFloat::getAllOnesValue(unsigned BitWidth, bool isIEEE) { -- cgit v1.2.3