[llvm] Rename GsymDIContext to GsymContext (PR #140227)
Mariusz Kwiczala via llvm-commits
llvm-commits at lists.llvm.org
Fri May 16 02:25:38 PDT 2025
https://github.com/sfc-gh-mkwiczala created https://github.com/llvm/llvm-project/pull/140227
Renaming based on suggestion here:
https://github.com/llvm/llvm-project/pull/139686#discussion_r2089538528
>From 26a5bde9fc02fbae12cee6d663306c5f14549cb5 Mon Sep 17 00:00:00 2001
From: Mariusz Kwiczala <mariusz.kwiczala at snowflake.com>
Date: Fri, 16 May 2025 09:23:26 +0000
Subject: [PATCH 1/2] Rename GsymDIContext to GsymContext
---
.../GSYM/{GsymDIContext.h => GsymContext.h} | 16 ++++++++--------
llvm/lib/DebugInfo/GSYM/CMakeLists.txt | 2 +-
.../{GsymDIContext.cpp => GsymContext.cpp} | 18 +++++++++---------
llvm/lib/DebugInfo/Symbolize/Symbolize.cpp | 6 +++---
.../secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn | 2 +-
5 files changed, 22 insertions(+), 22 deletions(-)
rename llvm/include/llvm/DebugInfo/GSYM/{GsymDIContext.h => GsymContext.h} (81%)
rename llvm/lib/DebugInfo/GSYM/{GsymDIContext.cpp => GsymContext.cpp} (87%)
diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h b/llvm/include/llvm/DebugInfo/GSYM/GsymContext.h
similarity index 81%
rename from llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h
rename to llvm/include/llvm/DebugInfo/GSYM/GsymContext.h
index 396c08c608d25..9c04ff63c8059 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/GsymContext.h
@@ -1,4 +1,4 @@
-//===-- GsymDIContext.h --------------------------------------------------===//
+//===-- GsymContext.h --------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===/
-#ifndef LLVM_DEBUGINFO_GSYM_GSYMDICONTEXT_H
-#define LLVM_DEBUGINFO_GSYM_GSYMDICONTEXT_H
+#ifndef LLVM_DEBUGINFO_GSYM_GSYMCONTEXT_H
+#define LLVM_DEBUGINFO_GSYM_GSYMCONTEXT_H
#include "llvm/DebugInfo/DIContext.h"
#include <cstdint>
@@ -27,12 +27,12 @@ class GsymReader;
/// interface to different symbolication formats (e.g. GSYM, PDB and DWARF).
/// More control and power over the debug information access can be had by using
/// the GSYM interfaces directly.
-class GsymDIContext : public DIContext {
+class GsymContext : public DIContext {
public:
- GsymDIContext(std::unique_ptr<GsymReader> Reader);
+ GsymContext(std::unique_ptr<GsymReader> Reader);
- GsymDIContext(GsymDIContext &) = delete;
- GsymDIContext &operator=(GsymDIContext &) = delete;
+ GsymContext(GsymContext &) = delete;
+ GsymContext &operator=(GsymContext &) = delete;
static bool classof(const DIContext *DICtx) {
return DICtx->getKind() == CK_GSYM;
@@ -63,4 +63,4 @@ class GsymDIContext : public DIContext {
} // end namespace llvm
-#endif // LLVM_DEBUGINFO_PDB_PDBCONTEXT_H
+#endif // LLVM_DEBUGINFO_GSYM_GSYMCONTEXT_H
diff --git a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
index 724b5b213d643..eb610a6b34f51 100644
--- a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
@@ -4,7 +4,7 @@ add_llvm_component_library(LLVMDebugInfoGSYM
FileWriter.cpp
FunctionInfo.cpp
GsymCreator.cpp
- GsymDIContext.cpp
+ GsymContext.cpp
GsymReader.cpp
InlineInfo.cpp
LineTable.cpp
diff --git a/llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp b/llvm/lib/DebugInfo/GSYM/GsymContext.cpp
similarity index 87%
rename from llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp
rename to llvm/lib/DebugInfo/GSYM/GsymContext.cpp
index 68024a9c9e782..c56a2e12eb004 100644
--- a/llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp
+++ b/llvm/lib/DebugInfo/GSYM/GsymContext.cpp
@@ -1,4 +1,4 @@
-//===-- GsymDIContext.cpp ------------------------------------------------===//
+//===-- GsymContext.cpp ------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===/
-#include "llvm/DebugInfo/GSYM/GsymDIContext.h"
+#include "llvm/DebugInfo/GSYM/GsymContext.h"
#include "llvm/DebugInfo/GSYM/GsymReader.h"
#include "llvm/Support/Path.h"
@@ -14,10 +14,10 @@
using namespace llvm;
using namespace llvm::gsym;
-GsymDIContext::GsymDIContext(std::unique_ptr<GsymReader> Reader)
+GsymContext::GsymContext(std::unique_ptr<GsymReader> Reader)
: DIContext(CK_GSYM), Reader(std::move(Reader)) {}
-void GsymDIContext::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {}
+void GsymContext::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {}
static bool fillLineInfoFromLocation(const SourceLocation &Location,
DILineInfoSpecifier Specifier,
@@ -61,7 +61,7 @@ static bool fillLineInfoFromLocation(const SourceLocation &Location,
}
std::optional<DILineInfo>
-GsymDIContext::getLineInfoForAddress(object::SectionedAddress Address,
+GsymContext::getLineInfoForAddress(object::SectionedAddress Address,
DILineInfoSpecifier Specifier) {
if (Address.SectionIndex != object::SectionedAddress::UndefSection)
return {};
@@ -93,14 +93,14 @@ GsymDIContext::getLineInfoForAddress(object::SectionedAddress Address,
}
std::optional<DILineInfo>
-GsymDIContext::getLineInfoForDataAddress(object::SectionedAddress Address) {
+GsymContext::getLineInfoForDataAddress(object::SectionedAddress Address) {
// We can't implement this, there's no such information in the GSYM file.
return {};
}
DILineInfoTable
-GsymDIContext::getLineInfoForAddressRange(object::SectionedAddress Address,
+GsymContext::getLineInfoForAddressRange(object::SectionedAddress Address,
uint64_t Size,
DILineInfoSpecifier Specifier) {
if (Size == 0)
@@ -131,7 +131,7 @@ GsymDIContext::getLineInfoForAddressRange(object::SectionedAddress Address,
}
DIInliningInfo
-GsymDIContext::getInliningInfoForAddress(object::SectionedAddress Address,
+GsymContext::getInliningInfoForAddress(object::SectionedAddress Address,
DILineInfoSpecifier Specifier) {
auto ResultOrErr = Reader->lookup(Address.Address);
@@ -159,7 +159,7 @@ GsymDIContext::getInliningInfoForAddress(object::SectionedAddress Address,
}
std::vector<DILocal>
-GsymDIContext::getLocalsForAddress(object::SectionedAddress Address) {
+GsymContext::getLocalsForAddress(object::SectionedAddress Address) {
// We can't implement this, there's no such information in the GSYM file.
return {};
diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
index 78a1421005de2..56527719da51f 100644
--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -15,7 +15,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/BTF/BTFContext.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
-#include "llvm/DebugInfo/GSYM/GsymDIContext.h"
+#include "llvm/DebugInfo/GSYM/GsymContext.h"
#include "llvm/DebugInfo/GSYM/GsymReader.h"
#include "llvm/DebugInfo/PDB/PDB.h"
#include "llvm/DebugInfo/PDB/PDBContext.h"
@@ -665,7 +665,7 @@ LLVMSymbolizer::getOrCreateModuleInfo(StringRef ModuleName) {
// If this is a COFF object containing PDB info and not containing DWARF
// section, use a PDBContext to symbolize. Otherwise, use DWARF.
// Create a DIContext to symbolize as follows:
- // - If there is a GSYM file, create a GsymDIContext.
+ // - If there is a GSYM file, create a GsymContext.
// - Otherwise, if this is a COFF object containing PDB info, create a
// PDBContext.
// - Otherwise, create a DWARFContext.
@@ -677,7 +677,7 @@ LLVMSymbolizer::getOrCreateModuleInfo(StringRef ModuleName) {
std::unique_ptr<gsym::GsymReader> Reader =
std::make_unique<gsym::GsymReader>(std::move(*ReaderOrErr));
- Context = std::make_unique<gsym::GsymDIContext>(std::move(Reader));
+ Context = std::make_unique<gsym::GsymContext>(std::move(Reader));
}
}
if (!Context) {
diff --git a/llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn
index 157fa6e885afc..40cddfa67d3bf 100644
--- a/llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn
@@ -12,7 +12,7 @@ static_library("GSYM") {
"FileWriter.cpp",
"FunctionInfo.cpp",
"GsymCreator.cpp",
- "GsymDIContext.cpp",
+ "GsymContext.cpp",
"GsymReader.cpp",
"Header.cpp",
"InlineInfo.cpp",
>From 6a07ff4c9b27f1682e4e5d612590937994416725 Mon Sep 17 00:00:00 2001
From: Mariusz Kwiczala <mariusz.kwiczala at snowflake.com>
Date: Fri, 16 May 2025 09:25:10 +0000
Subject: [PATCH 2/2] reformat
---
llvm/lib/DebugInfo/GSYM/GsymContext.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/DebugInfo/GSYM/GsymContext.cpp b/llvm/lib/DebugInfo/GSYM/GsymContext.cpp
index c56a2e12eb004..18be6d0985462 100644
--- a/llvm/lib/DebugInfo/GSYM/GsymContext.cpp
+++ b/llvm/lib/DebugInfo/GSYM/GsymContext.cpp
@@ -62,7 +62,7 @@ static bool fillLineInfoFromLocation(const SourceLocation &Location,
std::optional<DILineInfo>
GsymContext::getLineInfoForAddress(object::SectionedAddress Address,
- DILineInfoSpecifier Specifier) {
+ DILineInfoSpecifier Specifier) {
if (Address.SectionIndex != object::SectionedAddress::UndefSection)
return {};
@@ -101,8 +101,8 @@ GsymContext::getLineInfoForDataAddress(object::SectionedAddress Address) {
DILineInfoTable
GsymContext::getLineInfoForAddressRange(object::SectionedAddress Address,
- uint64_t Size,
- DILineInfoSpecifier Specifier) {
+ uint64_t Size,
+ DILineInfoSpecifier Specifier) {
if (Size == 0)
return DILineInfoTable();
@@ -132,7 +132,7 @@ GsymContext::getLineInfoForAddressRange(object::SectionedAddress Address,
DIInliningInfo
GsymContext::getInliningInfoForAddress(object::SectionedAddress Address,
- DILineInfoSpecifier Specifier) {
+ DILineInfoSpecifier Specifier) {
auto ResultOrErr = Reader->lookup(Address.Address);
if (!ResultOrErr)
More information about the llvm-commits
mailing list