[llvm] fcbf617 - [APInt] Fix documentation of *OrSelf methods
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Fri May 13 07:26:54 PDT 2022
Author: Jay Foad
Date: 2022-05-13T15:26:41+01:00
New Revision: fcbf617dcc517291785dbf2d457af5a5f1e60cca
URL: https://github.com/llvm/llvm-project/commit/fcbf617dcc517291785dbf2d457af5a5f1e60cca
DIFF: https://github.com/llvm/llvm-project/commit/fcbf617dcc517291785dbf2d457af5a5f1e60cca.diff
LOG: [APInt] Fix documentation of *OrSelf methods
Document that truncOrSelf, zextOrSelf and sextOrSelf only enforce
an upper or lower bound on the bitwidth of the result.
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 e14fab47a8093..c364679aa457a 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -1261,22 +1261,16 @@ class LLVM_NODISCARD APInt {
/// extended, truncated, or left alone to make it that width.
APInt zextOrTrunc(unsigned width) const;
- /// Truncate to width
- ///
- /// Make this APInt have the bit width given by \p width. The value is
- /// truncated or left alone to make it that width.
+ /// Truncate this APInt if necessary to ensure that its bit width is <= \p
+ /// width.
APInt truncOrSelf(unsigned width) const;
- /// Sign extend or truncate to width
- ///
- /// Make this APInt have the bit width given by \p width. The value is sign
- /// extended, or left alone to make it that width.
+ /// Sign-extend this APInt if necessary to ensure that its bit width is >= \p
+ /// width.
APInt sextOrSelf(unsigned width) const;
- /// Zero extend or truncate to width
- ///
- /// Make this APInt have the bit width given by \p width. The value is zero
- /// extended, or left alone to make it that width.
+ /// Zero-extend this APInt if necessary to ensure that its bit width is >= \p
+ /// width.
APInt zextOrSelf(unsigned width) const;
/// @}
More information about the llvm-commits
mailing list