diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-03-04 20:26:51 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-03-04 20:26:51 +0000 |
commit | f0a0ceb0341db6288d6a3c4c1117cf6f36d5528b (patch) | |
tree | 212474dc74e37213a3883294d6a3e4bea87825c6 /lib | |
parent | afee151fe8ac235ed0b03d99fffcf851eef8166b (diff) | |
download | llvm-f0a0ceb0341db6288d6a3c4c1117cf6f36d5528b.tar.gz llvm-f0a0ceb0341db6288d6a3c4c1117cf6f36d5528b.tar.bz2 llvm-f0a0ceb0341db6288d6a3c4c1117cf6f36d5528b.tar.xz |
APFloat: Add a move ctor and operator=
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Support/APFloat.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index deb9b05206..85ce31bcab 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -683,6 +683,20 @@ APFloat::operator=(const APFloat &rhs) return *this; } +APFloat & +APFloat::operator=(APFloat &&rhs) { + freeSignificand(); + + semantics = rhs.semantics; + significand = rhs.significand; + exponent = rhs.exponent; + category = rhs.category; + sign = rhs.sign; + + rhs.semantics = &Bogus; + return *this; +} + bool APFloat::isDenormal() const { return isFiniteNonZero() && (exponent == semantics->minExponent) && @@ -806,6 +820,10 @@ APFloat::APFloat(const APFloat &rhs) { assign(rhs); } +APFloat::APFloat(APFloat &&rhs) : semantics(&Bogus) { + *this = std::move(rhs); +} + APFloat::~APFloat() { freeSignificand(); |