[llvm] 85fe4ab - Rename GsymDIContext to GsymContext (#140227)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 10:18:26 PDT 2025


Author: Mariusz Kwiczala
Date: 2025-05-16T10:18:21-07:00
New Revision: 85fe4ab8a3faa58317c247051df2195c89bed0fa

URL: https://github.com/llvm/llvm-project/commit/85fe4ab8a3faa58317c247051df2195c89bed0fa
DIFF: https://github.com/llvm/llvm-project/commit/85fe4ab8a3faa58317c247051df2195c89bed0fa.diff

LOG: Rename GsymDIContext to GsymContext (#140227)

Renaming based on suggestion here: 
https://github.com/llvm/llvm-project/pull/139686#discussion_r2089538528

Added: 
    llvm/include/llvm/DebugInfo/GSYM/GsymContext.h
    llvm/lib/DebugInfo/GSYM/GsymContext.cpp

Modified: 
    llvm/lib/DebugInfo/GSYM/CMakeLists.txt
    llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
    llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn

Removed: 
    llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h
    llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp


################################################################################
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 
diff erent 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 82%
rename from llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp
rename to llvm/lib/DebugInfo/GSYM/GsymContext.cpp
index 68024a9c9e782..18be6d0985462 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,8 +61,8 @@ static bool fillLineInfoFromLocation(const SourceLocation &Location,
 }
 
 std::optional<DILineInfo>
-GsymDIContext::getLineInfoForAddress(object::SectionedAddress Address,
-                                     DILineInfoSpecifier Specifier) {
+GsymContext::getLineInfoForAddress(object::SectionedAddress Address,
+                                   DILineInfoSpecifier Specifier) {
   if (Address.SectionIndex != object::SectionedAddress::UndefSection)
     return {};
 
@@ -93,16 +93,16 @@ 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,
-                                          uint64_t Size,
-                                          DILineInfoSpecifier Specifier) {
+GsymContext::getLineInfoForAddressRange(object::SectionedAddress Address,
+                                        uint64_t Size,
+                                        DILineInfoSpecifier Specifier) {
   if (Size == 0)
     return DILineInfoTable();
 
@@ -131,8 +131,8 @@ GsymDIContext::getLineInfoForAddressRange(object::SectionedAddress Address,
 }
 
 DIInliningInfo
-GsymDIContext::getInliningInfoForAddress(object::SectionedAddress Address,
-                                         DILineInfoSpecifier Specifier) {
+GsymContext::getInliningInfoForAddress(object::SectionedAddress Address,
+                                       DILineInfoSpecifier Specifier) {
   auto ResultOrErr = Reader->lookup(Address.Address);
 
   if (!ResultOrErr)
@@ -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",


        


More information about the llvm-commits mailing list