https://github.com/owenca created https://github.com/llvm/llvm-project/pull/145853
This was done before in https://reviews.llvm.org/D46320 >From 889e392fcf49c05ceea7949690b207b73f83d49b Mon Sep 17 00:00:00 2001 From: Owen Pan <owenpi...@gmail.com> Date: Thu, 26 Jun 2025 01:14:58 -0700 Subject: [PATCH] [clang-format][NFC] Remove `\brief` from comments This was done before in https://reviews.llvm.org/D46320 --- clang/docs/ClangFormatStyleOptions.rst | 13 +++++------ clang/include/clang/Format/Format.h | 28 +++++++++++------------- clang/lib/Format/ContinuationIndenter.h | 15 ++++++------- clang/lib/Format/UnwrappedLineParser.cpp | 12 +++++----- clang/lib/Format/WhitespaceManager.h | 2 +- clang/unittests/Format/FormatTestBase.h | 2 +- 6 files changed, 34 insertions(+), 38 deletions(-) diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst index 548c73af65872..c61c808831704 100644 --- a/clang/docs/ClangFormatStyleOptions.rst +++ b/clang/docs/ClangFormatStyleOptions.rst @@ -1702,9 +1702,9 @@ the configuration (without a prefix: ``Auto``). .. _AllowAllArgumentsOnNextLine: **AllowAllArgumentsOnNextLine** (``Boolean``) :versionbadge:`clang-format 9` :ref:`¶ <AllowAllArgumentsOnNextLine>` - If a function call or braced initializer list doesn't fit on a - line, allow putting all arguments onto the next line, even if - ``BinPackArguments`` is ``false``. + If a function call or braced initializer list doesn't fit on a line, allow + putting all arguments onto the next line, even if ``BinPackArguments`` is + ``false``. .. code-block:: c++ @@ -5528,8 +5528,7 @@ the configuration (without a prefix: ``Auto``). .. _ReferenceAlignment: **ReferenceAlignment** (``ReferenceAlignmentStyle``) :versionbadge:`clang-format 13` :ref:`¶ <ReferenceAlignment>` - Reference alignment style (overrides ``PointerAlignment`` for - references). + Reference alignment style (overrides ``PointerAlignment`` for references). Possible values: @@ -6885,8 +6884,8 @@ the configuration (without a prefix: ``Auto``). .. _TypenameMacros: **TypenameMacros** (``List of Strings``) :versionbadge:`clang-format 9` :ref:`¶ <TypenameMacros>` - A vector of macros that should be interpreted as type declarations - instead of as function calls. + A vector of macros that should be interpreted as type declarations instead + of as function calls. These are expected to be macros of the form: diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h index 2a5cf5fb50db1..5d1fdb153b26e 100644 --- a/clang/include/clang/Format/Format.h +++ b/clang/include/clang/Format/Format.h @@ -651,9 +651,9 @@ struct FormatStyle { /// \version 3.7 TrailingCommentsAlignmentStyle AlignTrailingComments; - /// \brief If a function call or braced initializer list doesn't fit on a - /// line, allow putting all arguments onto the next line, even if - /// ``BinPackArguments`` is ``false``. + /// If a function call or braced initializer list doesn't fit on a line, allow + /// putting all arguments onto the next line, even if ``BinPackArguments`` is + /// ``false``. /// \code /// true: /// callFunction( @@ -3956,7 +3956,7 @@ struct FormatStyle { /// \version 6 std::vector<RawStringFormat> RawStringFormats; - /// \brief The ``&`` and ``&&`` alignment style. + /// The ``&`` and ``&&`` alignment style. enum ReferenceAlignmentStyle : int8_t { /// Align reference like ``PointerAlignment``. RAS_Pointer, @@ -3977,13 +3977,12 @@ struct FormatStyle { RAS_Middle }; - /// \brief Reference alignment style (overrides ``PointerAlignment`` for - /// references). + /// Reference alignment style (overrides ``PointerAlignment`` for references). /// \version 13 ReferenceAlignmentStyle ReferenceAlignment; // clang-format off - /// \brief Types of comment reflow style. + /// Types of comment reflow style. enum ReflowCommentsStyle : int8_t { /// Leave comments untouched. /// \code @@ -4016,7 +4015,7 @@ struct FormatStyle { }; // clang-format on - /// \brief Comment reformatting style. + /// Comment reformatting style. /// \version 3.8 ReflowCommentsStyle ReflowComments; @@ -4151,9 +4150,8 @@ struct FormatStyle { /// \version 16 bool RemoveSemicolon; - /// \brief The possible positions for the requires clause. The - /// ``IndentRequires`` option is only used if the ``requires`` is put on the - /// start of a line. + /// The possible positions for the requires clause. The ``IndentRequires`` + /// option is only used if the ``requires`` is put on the start of a line. enum RequiresClausePositionStyle : int8_t { /// Always put the ``requires`` clause on its own line (possibly followed by /// a semicolon). @@ -4251,7 +4249,7 @@ struct FormatStyle { RCPS_SingleLine, }; - /// \brief The position of the ``requires`` clause. + /// The position of the ``requires`` clause. /// \version 15 RequiresClausePositionStyle RequiresClausePosition; @@ -4281,7 +4279,7 @@ struct FormatStyle { /// \version 16 RequiresExpressionIndentationKind RequiresExpressionIndentation; - /// \brief The style if definition blocks should be separated. + /// The style if definition blocks should be separated. enum SeparateDefinitionStyle : int8_t { /// Leave definition blocks as they are. SDS_Leave, @@ -5188,8 +5186,8 @@ struct FormatStyle { /// \version 17 std::vector<std::string> TypeNames; - /// \brief A vector of macros that should be interpreted as type declarations - /// instead of as function calls. + /// A vector of macros that should be interpreted as type declarations instead + /// of as function calls. /// /// These are expected to be macros of the form: /// \code diff --git a/clang/lib/Format/ContinuationIndenter.h b/clang/lib/Format/ContinuationIndenter.h index ac354aa96f86e..fe957cf43721a 100644 --- a/clang/lib/Format/ContinuationIndenter.h +++ b/clang/lib/Format/ContinuationIndenter.h @@ -210,8 +210,8 @@ struct ParenState { IsChainedConditional(false), IsWrappedConditional(false), UnindentOperator(false) {} - /// \brief The token opening this parenthesis level, or nullptr if this level - /// is opened by fake parenthesis. + /// The token opening this parenthesis level, or nullptr if this level is + /// opened by fake parenthesis. /// /// Not considered for memoization as it will always have the same value at /// the same token. @@ -344,16 +344,15 @@ struct ParenState { bool IsCSharpGenericTypeConstraint : 1; - /// \brief true if the current \c ParenState represents the false branch of - /// a chained conditional expression (e.g. else-if) + /// true if the current \c ParenState represents the false branch of a chained + /// conditional expression (e.g. else-if) bool IsChainedConditional : 1; - /// \brief true if there conditionnal was wrapped on the first operator (the - /// question mark) + /// true if there conditionnal was wrapped on the first operator (the question + /// mark) bool IsWrappedConditional : 1; - /// \brief Indicates the indent should be reduced by the length of the - /// operator. + /// Indicates the indent should be reduced by the length of the operator. bool UnindentOperator : 1; bool operator<(const ParenState &Other) const { diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 61b84126fe1b9..c961ce7959750 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -340,7 +340,7 @@ bool UnwrappedLineParser::precededByCommentOrPPDirective() const { (Previous->IsMultiline || Previous->NewlinesBefore > 0); } -/// \brief Parses a level, that is ???. +/// Parses a level, that is ???. /// \param OpeningBrace Opening brace (\p nullptr if absent) of that level. /// \param IfKind The \p if statement kind in the level. /// \param IfLeftBrace The left brace of the \p if block in the level. @@ -2574,7 +2574,7 @@ bool UnwrappedLineParser::parseBracedList(bool IsAngleBracket, bool IsEnum) { return false; } -/// \brief Parses a pair of parentheses (and everything between them). +/// Parses a pair of parentheses (and everything between them). /// \param AmpAmpTokenType If different than TT_Unknown sets this type for all /// double ampersands. This applies for all nested scopes as well. /// @@ -3438,7 +3438,7 @@ void UnwrappedLineParser::parseAccessSpecifier() { addUnwrappedLine(); } -/// \brief Parses a requires, decides if it is a clause or an expression. +/// Parses a requires, decides if it is a clause or an expression. /// \pre The current token has to be the requires keyword. /// \returns true if it parsed a clause. bool UnwrappedLineParser::parseRequires(bool SeenEqual) { @@ -3582,7 +3582,7 @@ bool UnwrappedLineParser::parseRequires(bool SeenEqual) { return true; } -/// \brief Parses a requires clause. +/// Parses a requires clause. /// \param RequiresToken The requires keyword token, which starts this clause. /// \pre We need to be on the next token after the requires keyword. /// \sa parseRequiresExpression @@ -3612,7 +3612,7 @@ void UnwrappedLineParser::parseRequiresClause(FormatToken *RequiresToken) { FormatTok->Previous->ClosesRequiresClause = true; } -/// \brief Parses a requires expression. +/// Parses a requires expression. /// \param RequiresToken The requires keyword token, which starts this clause. /// \pre We need to be on the next token after the requires keyword. /// \sa parseRequiresClause @@ -3636,7 +3636,7 @@ void UnwrappedLineParser::parseRequiresExpression(FormatToken *RequiresToken) { } } -/// \brief Parses a constraint expression. +/// Parses a constraint expression. /// /// This is the body of a requires clause. It returns, when the parsing is /// complete, or the expression is incorrect. diff --git a/clang/lib/Format/WhitespaceManager.h b/clang/lib/Format/WhitespaceManager.h index 5dd667fb4ba3b..6d18db74cd2e4 100644 --- a/clang/lib/Format/WhitespaceManager.h +++ b/clang/lib/Format/WhitespaceManager.h @@ -212,7 +212,7 @@ class WhitespaceManager { /// \c EscapedNewlineColumn for the first tokens or token parts in a line. void calculateLineBreakInformation(); - /// \brief Align consecutive C/C++ preprocessor macros over all \c Changes. + /// Align consecutive C/C++ preprocessor macros over all \c Changes. void alignConsecutiveMacros(); /// Align consecutive assignments over all \c Changes. diff --git a/clang/unittests/Format/FormatTestBase.h b/clang/unittests/Format/FormatTestBase.h index 9d9472964fd3b..5a78499228f14 100644 --- a/clang/unittests/Format/FormatTestBase.h +++ b/clang/unittests/Format/FormatTestBase.h @@ -137,7 +137,7 @@ class FormatTestBase : public testing::Test { _verifyFormat(File, Line, Code, Code, Style); } - /// \brief Verify that clang-format does not crash on the given input. + /// Verify that clang-format does not crash on the given input. void verifyNoCrash(StringRef Code, const std::optional<FormatStyle> &Style = {}) { format(Code, Style, SC_DoNotCheck); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits