[llvm] [BOLT][DWARF][NFC] Refactor GDB Index into a new file (PR #94405)
Alexander Yermolovich via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 5 14:38:22 PDT 2024
================
@@ -0,0 +1,185 @@
+//===- bolt/Core/GDBIndex.cpp - GDB Index support ------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "bolt/Core/GDBIndex.h"
+
+using namespace llvm::bolt;
+using namespace llvm::support::endian;
+
+void GDBIndex::addGDBTypeUnitEntry(const GDBIndexTUEntry &&Entry) {
+ std::lock_guard<std::mutex> Lock(GDBIndexMutex);
+ if (!BC.getGdbIndexSection())
+ return;
+ GDBIndexTUEntryVector.emplace_back(Entry);
+}
+
+void GDBIndex::updateGdbIndexSection(
+ CUOffsetMap &CUMap, uint32_t NumCUs,
----------------
ayermolo wrote:
Make NumCUs const.
Also fix formatting.
https://github.com/llvm/llvm-project/pull/94405
More information about the llvm-commits
mailing list