[llvm] f835779 - [APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 03:32:15 PDT 2020


Author: Simon Pilgrim
Date: 2020-09-22T11:29:29+01:00
New Revision: f835779160ec30340676918915526615a07e826e

URL: https://github.com/llvm/llvm-project/commit/f835779160ec30340676918915526615a07e826e
DIFF: https://github.com/llvm/llvm-project/commit/f835779160ec30340676918915526615a07e826e.diff

LOG: [APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI.

We do this in all other cases.

Added: 
    

Modified: 
    llvm/include/llvm/ADT/APFloat.h
    llvm/lib/Support/APFloat.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h
index 1f9ac22621a6..5966fc1c48ed 100644
--- a/llvm/include/llvm/ADT/APFloat.h
+++ b/llvm/include/llvm/ADT/APFloat.h
@@ -492,7 +492,7 @@ class IEEEFloat final : public APFloatBase {
   integerPart addSignificand(const IEEEFloat &);
   integerPart subtractSignificand(const IEEEFloat &, integerPart);
   lostFraction addOrSubtractSignificand(const IEEEFloat &, bool subtract);
-  lostFraction multiplySignificand(const IEEEFloat &, IEEEFloat);
+  lostFraction multiplySignificand(const IEEEFloat &, const IEEEFloat &);
   lostFraction multiplySignificand(const IEEEFloat&);
   lostFraction divideSignificand(const IEEEFloat &);
   void incrementSignificand();

diff  --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index 7a4c8bd3639d..c607134e87dc 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -1006,7 +1006,7 @@ IEEEFloat::integerPart IEEEFloat::subtractSignificand(const IEEEFloat &rhs,
    on to the full-precision result of the multiplication.  Returns the
    lost fraction.  */
 lostFraction IEEEFloat::multiplySignificand(const IEEEFloat &rhs,
-                                            IEEEFloat addend) {
+                                            const IEEEFloat &addend) {
   unsigned int omsb;        // One, not zero, based MSB.
   unsigned int partsCount, newPartsCount, precision;
   integerPart *lhsSignificand;


        


More information about the llvm-commits mailing list