[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 6 13:55:43 PDT 2025
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 HEAD~1 HEAD --extensions h,cpp -- clang-tools-extra/clang-doc/JSONGenerator.cpp clang-tools-extra/test/clang-doc/json/class-template.cpp clang-tools-extra/test/clang-doc/json/class.cpp clang-tools-extra/test/clang-doc/json/method-template.cpp clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp clang-tools-extra/clang-doc/Generators.cpp clang-tools-extra/clang-doc/Generators.h clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clang-doc/JSONGenerator.cpp b/clang-tools-extra/clang-doc/JSONGenerator.cpp
index 773031211..0459d061c 100644
--- a/clang-tools-extra/clang-doc/JSONGenerator.cpp
+++ b/clang-tools-extra/clang-doc/JSONGenerator.cpp
@@ -124,7 +124,7 @@ static void serializeReference(const SmallVector<Reference, 4> &References,
json::Value ReferencesArray = Array();
json::Array &ReferencesArrayRef = *ReferencesArray.getAsArray();
ReferencesArrayRef.reserve(References.size());
- for (const auto& Reference : References) {
+ for (const auto &Reference : References) {
json::Value ReferenceVal = Object();
auto &ReferenceObj = *ReferenceVal.getAsObject();
auto BasePath = Reference.getRelativeFilePath("");
``````````
</details>
https://github.com/llvm/llvm-project/pull/142483
More information about the cfe-commits
mailing list