[llvm-branch-commits] [llvm] [DebugInfo] Emit DW_AT_LLVM_address_space for AMDGPU (PR #220789)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Sep 13 07:41:34 PDT 2026
================
@@ -0,0 +1,35 @@
+//===-- AMDGPUDwarfDebug.h - AMDGPU DwarfDebug Implementation -*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares the AMDGPUDwarfDebug class, the AMDGPU-specific subclass
+// of DwarfDebug. It customizes DWARF emission for the AMDGPU DWARF extensions.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUDWARFDEBUG_H
+#define LLVM_LIB_TARGET_AMDGPU_AMDGPUDWARFDEBUG_H
+
+#include "../../CodeGen/AsmPrinter/DwarfDebug.h"
+
+namespace llvm {
+
+/// AMDGPU-specific DwarfDebug implementation.
+class AMDGPUDwarfDebug : public DwarfDebug {
+public:
+ AMDGPUDwarfDebug(AsmPrinter *A) : DwarfDebug(A) {}
+
+ /// The AMDGPU DWARF extensions describe a pointer type's address space with
+ /// DW_AT_LLVM_address_space rather than DW_AT_address_class.
+ dwarf::Attribute getTypeAddressSpaceAttribute() const override {
----------------
arsenm wrote:
This doesn't seems like it calls for a subclass and virtual
https://github.com/llvm/llvm-project/pull/220789
More information about the llvm-branch-commits
mailing list