CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
68 lines
2.8 KiB
C++
68 lines
2.8 KiB
C++
//===-- NVPTXDwarfDebug.h - NVPTX 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 NVPTXDwarfDebug class, the NVPTX-specific subclass
|
|
// of DwarfDebug. It customizes DWARF emission for PTX: address space
|
|
// attributes, compile-unit range suppression, base address handling, and
|
|
// enhanced line information with inlined_at directives.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXDWARFDEBUG_H
|
|
#define LLVM_LIB_TARGET_NVPTX_NVPTXDWARFDEBUG_H
|
|
|
|
#include "../../CodeGen/AsmPrinter/DwarfCompileUnit.h"
|
|
#include "llvm/ADT/DenseSet.h"
|
|
|
|
namespace llvm {
|
|
|
|
/// NVPTX-specific DwarfDebug implementation.
|
|
///
|
|
/// Customizes DWARF emission for PTX targets: DWARF v2 defaults, address
|
|
/// space attributes (DW_AT_address_class) for cuda-gdb, compile-unit range
|
|
/// suppression, range-list base address handling, and enhanced line
|
|
/// information with inlined_at directives.
|
|
class NVPTXDwarfDebug : public DwarfDebug {
|
|
private:
|
|
/// Set of inlined_at locations that have already been emitted.
|
|
/// Used to avoid redundant emission of parent chain .loc directives.
|
|
DenseSet<const DILocation *> EmittedInlinedAtLocs;
|
|
|
|
public:
|
|
NVPTXDwarfDebug(AsmPrinter *A);
|
|
|
|
/// Get or create an MCSymbol in .debug_str for a function's linkage name.
|
|
/// Used to reference the function name in .loc directives with inlined_at.
|
|
MCSymbol *getOrCreateFuncNameSymbol(StringRef LinkageName);
|
|
|
|
/// Returns true if the enhanced lineinfo mode (with inlined_at) is active
|
|
/// for the given MachineFunction.
|
|
bool isEnhancedLineinfo(const MachineFunction &MF) const;
|
|
|
|
bool shouldResetBaseAddress(const MCSection &Section) const override;
|
|
const DIExpression *adjustExpressionForTarget(
|
|
const DIExpression *Expr,
|
|
std::optional<unsigned> &TargetAddrSpace) const override;
|
|
void addTargetVariableAttributes(
|
|
DwarfCompileUnit &CU, DIE &Die, std::optional<unsigned> TargetAddrSpace,
|
|
VariableLocationKind VarLocKind,
|
|
const GlobalVariable *GV = nullptr) const override;
|
|
|
|
protected:
|
|
void finishTargetUnitAttributes(const DICompileUnit &DIUnit,
|
|
DwarfCompileUnit &NewCU) override;
|
|
void initializeTargetDebugInfo(const MachineFunction &MF) override;
|
|
void recordTargetSourceLine(const DebugLoc &DL, unsigned Flags) override;
|
|
bool shouldAttachCompileUnitRanges() const override;
|
|
bool shouldEmitDwarfPubSections() const override { return false; }
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
#endif // LLVM_LIB_TARGET_NVPTX_NVPTXDWARFDEBUG_H
|