[llvm-branch-commits] [clang] [Serialization] Code cleanups and polish 83233 (PR #83237)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Oct 16 22:06:44 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 b61bcaafa3700b0797772df58710158eb44eaa69 5df9f526236cff3b2212088bf6bf52c6802044e2 --extensions h,cpp,cppm -- clang/lib/Serialization/TemplateArgumentHasher.cpp clang/lib/Serialization/TemplateArgumentHasher.h clang/test/Modules/recursive-instantiations.cppm clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/ExternalASTSource.h clang/include/clang/Sema/MultiplexExternalSemaSource.h clang/include/clang/Serialization/ASTBitCodes.h clang/include/clang/Serialization/ASTReader.h clang/lib/AST/DeclTemplate.cpp clang/lib/AST/ExternalASTSource.cpp clang/lib/AST/ODRHash.cpp clang/lib/Sema/MultiplexExternalSemaSource.cpp clang/lib/Serialization/ASTCommon.h clang/lib/Serialization/ASTReader.cpp clang/lib/Serialization/ASTReaderDecl.cpp clang/lib/Serialization/ASTReaderInternals.h clang/lib/Serialization/ASTWriter.cpp clang/lib/Serialization/ASTWriterDecl.cpp clang/test/Modules/cxx-templates.cpp clang/test/OpenMP/target_parallel_ast_print.cpp clang/test/OpenMP/target_teams_ast_print.cpp clang/test/OpenMP/task_ast_print.cpp clang/test/OpenMP/teams_ast_print.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/include/clang/Serialization/ASTBitCodes.h b/clang/include/clang/Serialization/ASTBitCodes.h
index 3c9a652052..496242b138 100644
--- a/clang/include/clang/Serialization/ASTBitCodes.h
+++ b/clang/include/clang/Serialization/ASTBitCodes.h
@@ -737,7 +737,7 @@ enum ASTRecordTypes {
 
   /// Record code for updated specialization
   UPDATE_SPECIALIZATION = 73,
-  
+
   CXX_ADDED_TEMPLATE_SPECIALIZATION = 74,
 };
 
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 76190177ad..b7974e9073 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -4146,7 +4146,8 @@ public:
   explicit LazySpecializationInfoLookupTrait(ASTWriter &Writer)
       : Writer(Writer) {}
 
-  template <typename Col, typename Col2> data_type getData(Col &&C, Col2 &ExistingInfo) {
+  template <typename Col, typename Col2>
+  data_type getData(Col &&C, Col2 &ExistingInfo) {
     unsigned Start = Specs.size();
     for (auto *D : C) {
       bool IsPartial = isa<ClassTemplatePartialSpecializationDecl,
@@ -4156,7 +4157,8 @@ public:
       Specs.push_back({GlobalDeclID(Writer.GetDeclRef(ND).getRawValue()),
                        IsPartial});
     }
-    for (const serialization::reader::LazySpecializationInfo &Info : ExistingInfo)
+    for (const serialization::reader::LazySpecializationInfo &Info :
+         ExistingInfo)
       Specs.push_back(Info);
     return std::make_pair(Start, Specs.size());
   }
@@ -4261,13 +4263,15 @@ void ASTWriter::GenerateSpecializationInfoLookupTable(
       Chain ? Chain->getLoadedSpecializationsLookupTables(D) : nullptr;
 
   for (auto &[HashValue, Specs] : SpecializationMaps) {
-    SmallVector<serialization::reader::LazySpecializationInfo, 16> ExisitingSpecs;
-    // We have to merge the lookup table manually here. We can't depend on the merge mechanism
-    // offered by clang::serialization::MultiOnDiskHashTableGenerator since that generator
+    SmallVector<serialization::reader::LazySpecializationInfo, 16>
+        ExisitingSpecs;
+    // We have to merge the lookup table manually here. We can't depend on the
+    // merge mechanism offered by
+    // clang::serialization::MultiOnDiskHashTableGenerator since that generator
     // assumes the we'll get the same value with the same key.
-    // And also underlying llvm::OnDiskChainedHashTableGenerator assumes that we won't insert
-    // the values with the same key twice.
-    // So we have to merge the lookup table here manually.
+    // And also underlying llvm::OnDiskChainedHashTableGenerator assumes that we
+    // won't insert the values with the same key twice. So we have to merge the
+    // lookup table here manually.
     if (Lookups)
       ExisitingSpecs = Lookups->Table.find(HashValue);
 

``````````

</details>


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


More information about the llvm-branch-commits mailing list