[clang-tools-extra] [clang-doc] Use LangOpts when printing types (PR #120308)

via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 17 14:01:37 PST 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 ac3ce2e8bacdf6b2e7f7d812b16b2854d5ca34f2 d64c254665228d24e8d372a42323a9c31049233f --extensions cpp -- clang-tools-extra/clang-doc/Serialize.cpp clang-tools-extra/test/clang-doc/basic.cpp clang-tools-extra/test/clang-doc/templates.cpp clang-tools-extra/unittests/clang-doc/SerializeTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp
index ddac5399b9..93efdd44f4 100644
--- a/clang-tools-extra/clang-doc/Serialize.cpp
+++ b/clang-tools-extra/clang-doc/Serialize.cpp
@@ -236,7 +236,7 @@ static RecordDecl *getRecordDeclForType(const QualType &T) {
   return nullptr;
 }
 
-TypeInfo getTypeInfoForType(const QualType &T, const PrintingPolicy& Policy) {
+TypeInfo getTypeInfoForType(const QualType &T, const PrintingPolicy &Policy) {
   const TagDecl *TD = getTagDeclForType(T);
   if (!TD)
     return TypeInfo(Reference(SymbolID(), T.getAsString(Policy)));
@@ -413,7 +413,7 @@ static void parseEnumerators(EnumInfo &I, const EnumDecl *D) {
 }
 
 static void parseParameters(FunctionInfo &I, const FunctionDecl *D) {
-    auto &LO = D->getLangOpts();
+  auto &LO = D->getLangOpts();
   for (const ParmVarDecl *P : D->parameters()) {
     FieldTypeInfo &FieldInfo = I.Params.emplace_back(
         getTypeInfoForType(P->getOriginalType(), LO), P->getNameAsString());
@@ -543,7 +543,7 @@ static void populateFunctionInfo(FunctionInfo &I, const FunctionDecl *D,
                                  bool &IsInAnonymousNamespace) {
   populateSymbolInfo(I, D, FC, LineNumber, Filename, IsFileInRootDir,
                      IsInAnonymousNamespace);
-    auto &LO = D->getLangOpts();
+  auto &LO = D->getLangOpts();
   I.ReturnType = getTypeInfoForType(D->getReturnType(), LO);
   parseParameters(I, D);
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/120308


More information about the cfe-commits mailing list