[llvm] [NFC][LLVM][ADT] Remove function names from Doxygen comments (PR #195465)
via llvm-commits
llvm-commits at lists.llvm.org
Sat May 2 10:24:13 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-adt
Author: Rahul Joshi (jurahul)
<details>
<summary>Changes</summary>
Adopt LLVM CS recommendation to not repeat function or class name is Doxygen comments.
https://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments
---
Patch is 23.63 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/195465.diff
8 Files Affected:
- (modified) llvm/include/llvm/ADT/APInt.h (+4-4)
- (modified) llvm/include/llvm/ADT/ArrayRef.h (+16-16)
- (modified) llvm/include/llvm/ADT/BitVector.h (+37-43)
- (modified) llvm/include/llvm/ADT/ConcurrentHashtable.h (+1-1)
- (modified) llvm/include/llvm/ADT/DAGDeltaAlgorithm.h (+4-4)
- (modified) llvm/include/llvm/ADT/DeltaAlgorithm.h (+9-9)
- (modified) llvm/include/llvm/ADT/DeltaTree.h (+3-3)
- (modified) llvm/include/llvm/ADT/DenseMap.h (+10-14)
``````````diff
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index 2b85a26fcb371..859cbd5c07147 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -2495,13 +2495,13 @@ LLVM_ABI APInt clmulh(const APInt &LHS, const APInt &RHS);
// order to compile LLVM with IBM xlC compiler.
LLVM_ABI hash_code hash_value(const APInt &Arg);
-/// StoreIntToMemory - Fills the StoreBytes bytes of memory starting from Dst
-/// with the integer held in IntVal.
+/// Fills the StoreBytes bytes of memory starting from Dst with the integer held
+/// in IntVal.
LLVM_ABI void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst,
unsigned StoreBytes);
-/// LoadIntFromMemory - Loads the integer stored in the LoadBytes bytes starting
-/// from Src into IntVal, which is assumed to be wide enough and to hold zero.
+/// Loads the integer stored in the LoadBytes bytes starting from Src into
+/// IntVal, which is assumed to be wide enough and to hold zero.
LLVM_ABI void LoadIntFromMemory(APInt &IntVal, const uint8_t *Src,
unsigned LoadBytes);
diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h
index eafc4330a1b1b..d971ceb439fe4 100644
--- a/llvm/include/llvm/ADT/ArrayRef.h
+++ b/llvm/include/llvm/ADT/ArrayRef.h
@@ -25,7 +25,7 @@
namespace llvm {
template<typename T> class [[nodiscard]] MutableArrayRef;
- /// ArrayRef - Represent a constant reference to an array (0 or more elements
+ /// Represent a constant reference to an array (0 or more elements
/// consecutively in memory), i.e. a start pointer and a length. It allows
/// various APIs to take consecutive elements easily and conveniently.
///
@@ -133,21 +133,21 @@ namespace llvm {
reverse_iterator rbegin() const { return reverse_iterator(end()); }
reverse_iterator rend() const { return reverse_iterator(begin()); }
- /// empty - Check if the array is empty.
+ /// Check if the array is empty.
bool empty() const { return Length == 0; }
const T *data() const { return Data; }
- /// size - Get the array size.
+ /// Get the array size.
size_t size() const { return Length; }
- /// front - Get the first element.
+ /// Get the first element.
const T &front() const {
assert(!empty());
return Data[0];
}
- /// back - Get the last element.
+ /// Get the last element.
const T &back() const {
assert(!empty());
return Data[Length-1];
@@ -174,7 +174,7 @@ namespace llvm {
return MutableArrayRef<T>(Buff, Length);
}
- /// equals - Check for element-wise equality.
+ /// Check for element-wise equality.
bool equals(ArrayRef RHS) const {
if (Length != RHS.Length)
return false;
@@ -282,9 +282,9 @@ namespace llvm {
/// @}
};
- /// MutableArrayRef - Represent a mutable reference to an array (0 or more
- /// elements consecutively in memory), i.e. a start pointer and a length. It
- /// allows various APIs to take and modify consecutive elements easily and
+ /// Represent a mutable reference to an array (0 or more elements
+ /// consecutively in memory), i.e. a start pointer and a length. It allows
+ /// various APIs to take and modify consecutive elements easily and
/// conveniently.
///
/// This class does not own the underlying data, it is expected to be used in
@@ -345,40 +345,40 @@ namespace llvm {
reverse_iterator rbegin() const { return reverse_iterator(end()); }
reverse_iterator rend() const { return reverse_iterator(begin()); }
- /// front - Get the first element.
+ /// Get the first element.
T &front() const {
assert(!this->empty());
return data()[0];
}
- /// back - Get the last element.
+ /// Get the last element.
T &back() const {
assert(!this->empty());
return data()[this->size()-1];
}
- /// consume_front() - Returns the first element and drops it from ArrayRef.
+ /// Returns the first element and drops it from ArrayRef.
T &consume_front() {
T &Ret = front();
*this = drop_front();
return Ret;
}
- /// consume_back() - Returns the last element and drops it from ArrayRef.
+ /// Returns the last element and drops it from ArrayRef.
T &consume_back() {
T &Ret = back();
*this = drop_back();
return Ret;
}
- /// slice(n, m) - Chop off the first N elements of the array, and keep M
- /// elements in the array.
+ /// Chop off the first \p N elements of the array, and keep \p M elements
+ /// in the array.
MutableArrayRef<T> slice(size_t N, size_t M) const {
assert(N + M <= this->size() && "Invalid specifier");
return MutableArrayRef<T>(this->data() + N, M);
}
- /// slice(n) - Chop off the first N elements of the array.
+ /// Chop off the first \p N elements of the array.
MutableArrayRef<T> slice(size_t N) const {
return slice(N, this->size() - N);
}
diff --git a/llvm/include/llvm/ADT/BitVector.h b/llvm/include/llvm/ADT/BitVector.h
index f4645c18a93f0..1b9586064fb9b 100644
--- a/llvm/include/llvm/ADT/BitVector.h
+++ b/llvm/include/llvm/ADT/BitVector.h
@@ -171,13 +171,13 @@ class BitVector {
clear_unused_bits();
}
- /// empty - Tests whether there are no bits in this bitvector.
+ /// returns whether there are no bits in this bitvector.
bool empty() const { return Size == 0; }
- /// size - Returns the number of bits in this bitvector.
+ /// Returns the number of bits in this bitvector.
size_type size() const { return Size; }
- /// count - Returns the number of bits which are set.
+ /// Returns the number of bits which are set.
size_type count() const {
unsigned NumBits = 0;
for (auto Bit : Bits)
@@ -185,12 +185,12 @@ class BitVector {
return NumBits;
}
- /// any - Returns true if any bit is set.
+ /// Returns true if any bit is set.
bool any() const {
return any_of(Bits, [](BitWord Bit) { return Bit != 0; });
}
- /// all - Returns true if all bits are set.
+ /// Returns true if all bits are set.
bool all() const {
for (unsigned i = 0; i < Size / BITWORD_SIZE; ++i)
if (Bits[i] != ~BitWord(0))
@@ -203,14 +203,13 @@ class BitVector {
return true;
}
- /// none - Returns true if none of the bits are set.
+ /// Returns true if none of the bits are set.
bool none() const {
return !any();
}
- /// find_first_in - Returns the index of the first set / unset bit,
- /// depending on \p Set, in the range [Begin, End).
- /// Returns -1 if all bits in the range are unset / set.
+ /// Returns the index of the first set/unset bit, depending on \p Set, in
+ /// the range [Begin, End). Returns -1 if all bits in the range are unset/set.
int find_first_in(unsigned Begin, unsigned End, bool Set = true) const {
assert(Begin <= End && End <= Size);
if (Begin == End)
@@ -244,8 +243,8 @@ class BitVector {
return -1;
}
- /// find_last_in - Returns the index of the last set bit in the range
- /// [Begin, End). Returns -1 if all bits in the range are unset.
+ /// Returns the index of the last set bit in the range [Begin, End).
+ /// Returns -1 if all bits in the range are unset.
int find_last_in(unsigned Begin, unsigned End) const {
assert(Begin <= End && End <= Size);
if (Begin == End)
@@ -275,14 +274,14 @@ class BitVector {
return -1;
}
- /// find_first_unset_in - Returns the index of the first unset bit in the
- /// range [Begin, End). Returns -1 if all bits in the range are set.
+ /// Returns the index of the first unset bit in the range [Begin, End).
+ /// Returns -1 if all bits in the range are set.
int find_first_unset_in(unsigned Begin, unsigned End) const {
return find_first_in(Begin, End, /* Set = */ false);
}
- /// find_last_unset_in - Returns the index of the last unset bit in the
- /// range [Begin, End). Returns -1 if all bits in the range are set.
+ /// Returns the index of the last unset bit in the range [Begin, End).
+ /// Returns -1 if all bits in the range are set.
int find_last_unset_in(unsigned Begin, unsigned End) const {
assert(Begin <= End && End <= Size);
if (Begin == End)
@@ -314,49 +313,45 @@ class BitVector {
return -1;
}
- /// find_first - Returns the index of the first set bit, -1 if none
- /// of the bits are set.
+ /// Returns the index of the first set bit, -1 if none of the bits are set.
int find_first() const { return find_first_in(0, Size); }
- /// find_last - Returns the index of the last set bit, -1 if none of the bits
- /// are set.
+ /// Returns the index of the last set bit, -1 if none of the bits are set.
int find_last() const { return find_last_in(0, Size); }
- /// find_next - Returns the index of the next set bit following the
- /// "Prev" bit. Returns -1 if the next set bit is not found.
+ /// Returns the index of the next set bit following the "Prev" bit.
+ /// Returns -1 if the next set bit is not found.
int find_next(unsigned Prev) const { return find_first_in(Prev + 1, Size); }
- /// find_prev - Returns the index of the first set bit that precedes the
- /// the bit at \p PriorTo. Returns -1 if all previous bits are unset.
+ /// Returns the index of the first set bit that precedes the bit at
+ /// \p PriorTo. Returns -1 if all previous bits are unset.
int find_prev(unsigned PriorTo) const { return find_last_in(0, PriorTo); }
- /// find_first_unset - Returns the index of the first unset bit, -1 if all
- /// of the bits are set.
+ /// Returns the index of the first unset bit, -1 if all of the bits are set.
int find_first_unset() const { return find_first_unset_in(0, Size); }
- /// find_next_unset - Returns the index of the next unset bit following the
- /// "Prev" bit. Returns -1 if all remaining bits are set.
+ /// Returns the index of the next unset bit following the \p Prev bit.
+ /// Returns -1 if all remaining bits are set.
int find_next_unset(unsigned Prev) const {
return find_first_unset_in(Prev + 1, Size);
}
- /// find_last_unset - Returns the index of the last unset bit, -1 if all of
- /// the bits are set.
+ /// Returns the index of the last unset bit, -1 if all of the bits are set.
int find_last_unset() const { return find_last_unset_in(0, Size); }
- /// find_prev_unset - Returns the index of the first unset bit that precedes
- /// the bit at \p PriorTo. Returns -1 if all previous bits are set.
+ /// Returns the index of the first unset bit that precedes the bit at
+ /// \p PriorTo. Returns -1 if all previous bits are set.
int find_prev_unset(unsigned PriorTo) const {
return find_last_unset_in(0, PriorTo);
}
- /// clear - Removes all bits from the bitvector.
+ /// Removes all bits from the bitvector.
void clear() {
Size = 0;
Bits.clear();
}
- /// resize - Grow or shrink the bitvector.
+ /// Grow or shrink the bitvector.
void resize(unsigned N, bool t = false) {
set_unused_bits(t);
Size = N;
@@ -366,7 +361,6 @@ class BitVector {
void reserve(unsigned N) { Bits.reserve(NumBitWords(N)); }
- // Set, reset, flip
BitVector &set() {
init_words(true);
clear_unused_bits();
@@ -379,7 +373,7 @@ class BitVector {
return *this;
}
- /// set - Efficiently set a range of bits in [I, E)
+ /// Efficiently set a range of bits in [I, E)
BitVector &set(unsigned I, unsigned E) {
assert(I <= E && "Attempted to set backwards range!");
assert(E <= size() && "Attempted to set out-of-bounds range!");
@@ -418,7 +412,7 @@ class BitVector {
return *this;
}
- /// reset - Efficiently reset a range of bits in [I, E)
+ /// Efficiently reset a range of bits in [I, E)
BitVector &reset(unsigned I, unsigned E) {
assert(I <= E && "Attempted to reset backwards range!");
assert(E <= size() && "Attempted to reset out-of-bounds range!");
@@ -541,7 +535,7 @@ class BitVector {
return *this;
}
- /// reset - Reset bits that are set in RHS. Same as *this &= ~RHS.
+ /// Reset bits that are set in RHS. Same as *this &= ~RHS.
BitVector &reset(const BitVector &RHS) {
unsigned ThisWords = Bits.size();
unsigned RHSWords = RHS.Bits.size();
@@ -550,7 +544,7 @@ class BitVector {
return *this;
}
- /// test - Check if (This - RHS) is non-zero.
+ /// Check if (This - RHS) is non-zero.
/// This is the same as reset(RHS) and any().
bool test(const BitVector &RHS) const {
unsigned ThisWords = Bits.size();
@@ -567,7 +561,7 @@ class BitVector {
return false;
}
- /// subsetOf - Check if This is a subset of RHS.
+ /// Check if This is a subset of RHS.
bool subsetOf(const BitVector &RHS) const { return !test(RHS); }
template <class F, class... ArgTys>
@@ -721,25 +715,25 @@ class BitVector {
// bit mask is always a whole multiple of 32 bits. If no bit mask size is
// given, the bit mask is assumed to cover the entire BitVector.
- /// setBitsInMask - Add '1' bits from Mask to this vector. Don't resize.
+ /// Add '1' bits from Mask to this vector. Don't resize.
/// This computes "*this |= Mask".
void setBitsInMask(const uint32_t *Mask, unsigned MaskWords = ~0u) {
applyMask<true, false>(Mask, MaskWords);
}
- /// clearBitsInMask - Clear any bits in this vector that are set in Mask.
+ /// Clear any bits in this vector that are set in Mask.
/// Don't resize. This computes "*this &= ~Mask".
void clearBitsInMask(const uint32_t *Mask, unsigned MaskWords = ~0u) {
applyMask<false, false>(Mask, MaskWords);
}
- /// setBitsNotInMask - Add a bit to this vector for every '0' bit in Mask.
+ /// Add a bit to this vector for every '0' bit in Mask.
/// Don't resize. This computes "*this |= ~Mask".
void setBitsNotInMask(const uint32_t *Mask, unsigned MaskWords = ~0u) {
applyMask<true, true>(Mask, MaskWords);
}
- /// clearBitsNotInMask - Clear a bit in this vector for every '0' bit in Mask.
+ /// Clear a bit in this vector for every '0' bit in Mask.
/// Don't resize. This computes "*this &= Mask".
void clearBitsNotInMask(const uint32_t *Mask, unsigned MaskWords = ~0u) {
applyMask<false, true>(Mask, MaskWords);
diff --git a/llvm/include/llvm/ADT/ConcurrentHashtable.h b/llvm/include/llvm/ADT/ConcurrentHashtable.h
index 4e27bc48f9d1f..d3031c37f3384 100644
--- a/llvm/include/llvm/ADT/ConcurrentHashtable.h
+++ b/llvm/include/llvm/ADT/ConcurrentHashtable.h
@@ -27,7 +27,7 @@
namespace llvm {
-/// ConcurrentHashTable - is a resizeable concurrent hashtable.
+/// ConcurrentHashTable is a resizeable concurrent hashtable.
/// The number of resizings limited up to x2^31. This hashtable is
/// useful to have efficient access to aggregate data(like strings,
/// type descriptors...) and to keep only single copy of such
diff --git a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h
index 028b114385cd4..69120bc3a0e91 100644
--- a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h
+++ b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h
@@ -15,7 +15,7 @@
namespace llvm {
-/// DAGDeltaAlgorithm - Implements a "delta debugging" algorithm for minimizing
+/// Implements a "delta debugging" algorithm for minimizing
/// directed acyclic graphs using a predicate function.
///
/// The result of the algorithm is a subset of the input change set which is
@@ -50,7 +50,7 @@ class LLVM_ABI DAGDeltaAlgorithm {
public:
virtual ~DAGDeltaAlgorithm() = default;
- /// Run - Minimize the DAG formed by the \p Changes vertices and the
+ /// Minimize the DAG formed by the \p Changes vertices and the
/// \p Dependencies edges by executing \see ExecuteOneTest() on subsets of
/// changes and returning the smallest set which still satisfies the test
/// predicate and the input \p Dependencies.
@@ -65,12 +65,12 @@ class LLVM_ABI DAGDeltaAlgorithm {
changeset_ty Run(const changeset_ty &Changes,
const std::vector<edge_ty> &Dependencies);
- /// UpdatedSearchState - Callback used when the search state changes.
+ /// Callback used when the search state changes.
virtual void UpdatedSearchState(const changeset_ty &Changes,
const changesetlist_ty &Sets,
const changeset_ty &Required) {}
- /// ExecuteOneTest - Execute a single test predicate on the change set \p S.
+ /// Execute a single test predicate on the change set \p S.
virtual bool ExecuteOneTest(const changeset_ty &S) = 0;
};
diff --git a/llvm/include/llvm/ADT/DeltaAlgorithm.h b/llvm/include/llvm/ADT/DeltaAlgorithm.h
index dbb64579b39c8..a032537953383 100644
--- a/llvm/include/llvm/ADT/DeltaAlgorithm.h
+++ b/llvm/include/llvm/ADT/DeltaAlgorithm.h
@@ -14,7 +14,7 @@
namespace llvm {
-/// DeltaAlgorithm - Implements the delta debugging algorithm (A. Zeller '99)
+/// Implements the delta debugging algorithm (A. Zeller '99)
/// for minimizing arbitrary sets using a predicate function.
///
/// The result of the algorithm is a subset of the input change set which is
@@ -45,22 +45,22 @@ class LLVM_ABI DeltaAlgorithm {
/// since we always reduce following a success.
std::set<changeset_ty> FailedTestsCache;
- /// GetTestResult - Get the test result for the \p Changes from the
- /// cache, executing the test if necessary.
+ /// Get the test result for the \p Changes from the cache, executing the test
+ /// if necessary.
///
/// \param Changes - The change set to test.
/// \return - The test result.
bool GetTestResult(const changeset_ty &Changes);
- /// Split - Partition a set of changes \p S into one or two subsets.
+ /// Partition a set of changes \p S into one or two subsets.
void Split(const changeset_ty &S, changesetlist_ty &Res);
- /// Delta - Minimize a set of \p Changes which has been partitioned into
+ /// Minimize a set of \p Changes which has been partitioned into
/// smaller sets, by attempting to remove individual subsets.
changeset_ty Delta(const changeset_ty &Changes,
const changesetlist_ty &Sets);
- /// Search - Search for a subset (or subsets) in \p Sets which can be
+ /// Search for a subset (or subsets) in \p Sets which can be
/// removed from \p Changes while still satisfying the predicate.
///
/// \param Res - On success, a subset of Changes which satisfies the
@@ -70,11 +70,11 @@ class LLVM_ABI DeltaAlgorithm {
changeset_ty &Res);
protected:
- /// UpdatedSearchState - Callback used when the search state changes.
+ /// Callback used when the search state changes.
virtual void UpdatedSearchState(const changeset_ty &Changes,
const changesetlist_ty &Sets) {}
- /// ExecuteOneTest - Execute a single test predicate on the change set \p S.
+ /// Execute a single test predicate on the change set \p S.
virtual bool ExecuteOneTest(const changeset_ty &S) = 0;
DeltaAlgorithm& operator=(const DeltaAlgorithm&) = default;
@@ -82,7 +82,7 @@ class LLVM_ABI DeltaAlgorithm {
public:
virtual ~DeltaAlgorithm();
- /// Run - Minimize the set \p Changes by executing \see ExecuteOneTest() on
+ /// Minimize the set \p Changes by executing \see ExecuteOneTest() on
/// subsets of changes and returning the smallest set which still satisfies
/// the test predicate.
changeset_ty Run(const changeset_ty &Changes);
diff --git a/llvm/include/llvm/ADT/DeltaTree.h b/llvm/include/llvm/ADT/DeltaTree.h
index 2d7ee87930377..5a3c61f2b2d09 100644
--- a/llvm/include/llvm/ADT/DeltaTree.h
+++ b/llvm/include/llvm/ADT/DeltaTree.h
@@ -17,7 +17,7 @@
namespace llvm {
-/// DeltaTree - a multiway search tree (BTree) structure with some fancy
+/// A multiway search tree (BTree) structure with some fancy
/// features. B-Trees are generally more memory and cache efficient than
/// binary trees, because they store multiple keys/values in each node. This
/// implements a key/value mapping from index to delta, and allows fast lookup
@@ -36,12 +36,12 @@ class DeltaTree {
DeltaTree &operator=(const DeltaTree &) = delete;
LLVM_ABI ~DeltaTree();
- /// getDeltaAt - Return the accumulated delta at the specified file offset.
+ /// Return the accumulated delta at the specified file offset.
...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/195465
More information about the llvm-commits
mailing list