1//===-- NVPTXDwarfDebug.h - NVPTX DwarfDebug Implementation ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares helper classes and functions for NVPTX-specific debug
10// information processing, particularly for inlined function call sites and
11// enhanced line information with inlined_at directives.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXDWARFDEBUG_H
16#define LLVM_LIB_TARGET_NVPTX_NVPTXDWARFDEBUG_H
17
18#include "../../CodeGen/AsmPrinter/DwarfCompileUnit.h"
19#include "llvm/ADT/DenseSet.h"
20
21namespace llvm {
22
23/// NVPTXDwarfDebug - NVPTX-specific DwarfDebug implementation.
24/// Inherits from DwarfDebug to provide enhanced line information with
25/// inlined_at support.
26class NVPTXDwarfDebug : public DwarfDebug {
27private:
28 /// Set of inlined_at locations that have already been emitted.
29 /// Used to avoid redundant emission of parent chain .loc directives.
30 DenseSet<const DILocation *> EmittedInlinedAtLocs;
31
32public:
33 /// Constructor - Pass through to DwarfDebug constructor.
34 NVPTXDwarfDebug(AsmPrinter *A);
35
36protected:
37 /// Override to collect inlined_at locations.
38 void initializeTargetDebugInfo(const MachineFunction &MF) override;
39 /// Override to record source line information with inlined_at support.
40 void recordTargetSourceLine(const DebugLoc &DL, unsigned Flags) override;
41};
42
43} // end namespace llvm
44
45#endif // LLVM_LIB_TARGET_NVPTX_NVPTXDWARFDEBUG_H
46