[llvm] 08d1d74 - [APInt] Move a comment from urem to srem where it belongs.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 23 10:47:39 PST 2022


Author: Craig Topper
Date: 2022-12-23T10:26:28-08:00
New Revision: 08d1d74289f4cf74b9ebbb1c0d2bd4bf6eec0561

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

LOG: [APInt] Move a comment from urem to srem where it belongs.

This comment talks about sign of the dividend and the result. I
think it belongs to the srem function.

This is the commit that added it
https://github.com/llvm/llvm-project/commit/709a820a5338ca5c4b949f2f0286f7da39f00661
and the code change with it was for srem.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D140611

Added: 
    

Modified: 
    llvm/include/llvm/ADT/APInt.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index 33b38653f6da7..ab8bf3eb1fe14 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -955,9 +955,7 @@ class [[nodiscard]] APInt {
   ///
   /// Perform an unsigned remainder operation on this APInt with RHS being the
   /// divisor. Both this and RHS are treated as unsigned quantities for purposes
-  /// of this operation. Note that this is a true remainder operation and not a
-  /// modulo operation because the sign follows the sign of the dividend which
-  /// is *this.
+  /// of this operation.
   ///
   /// \returns a new APInt value containing the remainder result
   APInt urem(const APInt &RHS) const;
@@ -966,6 +964,9 @@ class [[nodiscard]] APInt {
   /// Function for signed remainder operation.
   ///
   /// Signed remainder operation on APInt.
+  ///
+  /// Note that this is a true remainder operation and not a modulo operation
+  /// because the sign follows the sign of the dividend which is *this.
   APInt srem(const APInt &RHS) const;
   int64_t srem(int64_t RHS) const;
 


        


More information about the llvm-commits mailing list