diff options
author | Tim Shen <timshen91@gmail.com> | 2016-12-21 02:39:21 +0000 |
---|---|---|
committer | Tim Shen <timshen91@gmail.com> | 2016-12-21 02:39:21 +0000 |
commit | 7b57ac44f914e25514b54fa1a254e810a35ec322 (patch) | |
tree | e8154c530fd15a4e06d3ff364faf1d8616485711 /llvm/lib/Support/APFloat.cpp | |
parent | 0b7de06a23fcc90d568c250c0f4e29512bb32d67 (diff) | |
download | bcm5719-llvm-7b57ac44f914e25514b54fa1a254e810a35ec322.tar.gz bcm5719-llvm-7b57ac44f914e25514b54fa1a254e810a35ec322.zip |
[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
Diffstat (limited to 'llvm/lib/Support/APFloat.cpp')
-rw-r--r-- | llvm/lib/Support/APFloat.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
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<IEEEFloat>(Semantics)) { new (&IEEE) IEEEFloat(std::move(F)); - } else if (usesLayout<DoubleAPFloat>(Semantics)) { + return; + } + if (usesLayout<DoubleAPFloat>(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<IEEEFloat>(getSemantics()) && - usesLayout<IEEEFloat>(ToSemantics)) { + usesLayout<IEEEFloat>(ToSemantics)) return U.IEEE.convert(ToSemantics, RM, losesInfo); - } else if (usesLayout<IEEEFloat>(getSemantics()) && - usesLayout<DoubleAPFloat>(ToSemantics)) { + if (usesLayout<IEEEFloat>(getSemantics()) && + usesLayout<DoubleAPFloat>(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<DoubleAPFloat>(getSemantics()) && - usesLayout<IEEEFloat>(ToSemantics)) { + } + if (usesLayout<DoubleAPFloat>(getSemantics()) && + usesLayout<IEEEFloat>(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) { |