[clang] [Clang][Comments] Support for parsing headers in Doxygen \par commands (PR #91100)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 15 00:37:17 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 8cc6a2469c95f0815487c442495a829c337913c4 362080b5ab4e0401b24e85a9c28ece3a9b0e0286 -- clang/include/clang/AST/CommentCommandTraits.h clang/include/clang/AST/CommentParser.h clang/lib/AST/CommentParser.cpp clang/unittests/AST/CommentParser.cpp clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/AST/CommentParser.cpp b/clang/lib/AST/CommentParser.cpp
index 24aa1ab8fc..d5e5bb27ce 100644
--- a/clang/lib/AST/CommentParser.cpp
+++ b/clang/lib/AST/CommentParser.cpp
@@ -232,8 +232,8 @@ public:
while (isWhitespace(*(Pos.BufferPtr - Offset)))
Offset++;
- // Once we've reached the whitespace, backtrack and check if the previous four
- // characters are \par or @par.
+ // Once we've reached the whitespace, backtrack and check if the previous
+ // four characters are \par or @par.
llvm::StringRef LineStart(Pos.BufferPtr - Offset - 3, 4);
return LineStart.starts_with("\\par") || LineStart.starts_with("@par");
}
diff --git a/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp b/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp
index 07b26dc2f6..f90ebc4630 100644
--- a/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp
+++ b/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp
@@ -32,8 +32,7 @@ void clang::EmitClangCommentCommandInfo(RecordKeeper &Records,
Record &Tag = *Tags[i];
OS << " { "
<< "\"" << Tag.getValueAsString("Name") << "\", "
- << "\"" << Tag.getValueAsString("EndCommandName") << "\", "
- << i << ", "
+ << "\"" << Tag.getValueAsString("EndCommandName") << "\", " << i << ", "
<< Tag.getValueAsInt("NumArgs") << ", "
<< Tag.getValueAsBit("IsInlineCommand") << ", "
<< Tag.getValueAsBit("IsBlockCommand") << ", "
``````````
</details>
https://github.com/llvm/llvm-project/pull/91100
More information about the cfe-commits
mailing list