[llvm] [DWARF] Speedup .gdb_index dumping (PR #151806)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 04:42:34 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 cpp -- llvm/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp b/llvm/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp
index c076c4547..823e22565 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/DebugInfo/DWARF/DWARFGdbIndex.h"
-#include <llvm/ADT/DenseMap.h>
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataExtractor.h"
@@ -17,6 +16,7 @@
 #include <cassert>
 #include <cinttypes>
 #include <cstdint>
+#include <llvm/ADT/DenseMap.h>
 #include <set>
 #include <utility>
 
@@ -64,13 +64,13 @@ void DWARFGdbIndex::dumpSymbolTable(raw_ostream &OS) const {
 
   llvm::DenseMap<uint32_t, decltype(ConstantPoolVectors)::const_pointer>
       CuVectorMap(ConstantPoolVectors.size());
-  for (const auto& [Offset, CUVector] : ConstantPoolVectors)
+  for (const auto &[Offset, CUVector] : ConstantPoolVectors)
     CuVectorMap.try_emplace(Offset, &CUVector);
 
-  const auto FindCuVector =[&](uint32_t VecOffset) {
-        const auto It = CuVectorMap.find(VecOffset);
-        return It != CuVectorMap.end() ? It->second : ConstantPoolVectors.end();
-      };
+  const auto FindCuVector = [&](uint32_t VecOffset) {
+    const auto It = CuVectorMap.find(VecOffset);
+    return It != CuVectorMap.end() ? It->second : ConstantPoolVectors.end();
+  };
 
   uint32_t I = -1;
   for (const SymTableEntry &E : SymbolTable) {
@@ -84,7 +84,7 @@ void DWARFGdbIndex::dumpSymbolTable(raw_ostream &OS) const {
     StringRef Name = ConstantPoolStrings.substr(
         ConstantPoolOffset - StringPoolOffset + E.NameOffset);
 
-    const auto* CuVector = FindCuVector(E.VecOffset);
+    const auto *CuVector = FindCuVector(E.VecOffset);
     assert(CuVector != ConstantPoolVectors.end() && "Invalid symbol table");
     uint32_t CuVectorId = CuVector - ConstantPoolVectors.begin();
     OS << format("      String name: %s, CU vector index: %d\n", Name.data(),

``````````

</details>


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


More information about the llvm-commits mailing list