Skip to content

Commit 7832887

Browse files
committed
changed hook function names and few comments
1 parent dc6cf37 commit 7832887

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,18 +2204,17 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
22042204
Flags |= DWARF2_FLAG_IS_STMT;
22052205
}
22062206

2207-
// Call the hook that allows targets to customize source line recording
2208-
recordSourceLineHook(*MI, DL, Flags);
2207+
// Call target-specific source line recording.
2208+
recordTargetSourceLine(*MI, DL, Flags);
22092209

22102210
// If we're not at line 0, remember this location.
22112211
if (DL.getLine())
22122212
PrevInstLoc = DL;
22132213
}
22142214

2215-
// Default implementation of target-specific hook for custom source line
2216-
// recording
2217-
void DwarfDebug::recordSourceLineHook(const MachineInstr &MI,
2218-
const DebugLoc &DL, unsigned Flags) {
2215+
// Default implementation of target-specific source line recording.
2216+
void DwarfDebug::recordTargetSourceLine(const MachineInstr &MI,
2217+
const DebugLoc &DL, unsigned Flags) {
22192218
SmallString<128> LocationString;
22202219
if (Asm->OutStreamer->isVerboseAsm()) {
22212220
raw_svector_ostream OS(LocationString);
@@ -2719,8 +2718,8 @@ void DwarfDebug::beginFunctionImpl(const MachineFunction *MF) {
27192718
Asm->OutStreamer->getContext().setDwarfCompileUnitID(
27202719
getDwarfCompileUnitIDForLineTable(CU));
27212720

2722-
// Call target-specific hook for custom initialization
2723-
beginFunctionHook(*MF);
2721+
// Call target-specific debug info initialization.
2722+
initializeTargetDebugInfo(*MF);
27242723

27252724
// Record beginning of function.
27262725
PrologEndLoc = emitInitialLocDirective(

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -717,13 +717,13 @@ class DwarfDebug : public DebugHandlerBase {
717717

718718
void skippedNonDebugFunction() override;
719719

720-
/// Target-specific hook for custom initialization,
721-
/// default implementation is empty, only being used for NVPTX target
722-
virtual void beginFunctionHook(const MachineFunction &MF) {}
720+
/// Target-specific debug info initialization at function start.
721+
/// Default implementation is empty, overridden by NVPTX target.
722+
virtual void initializeTargetDebugInfo(const MachineFunction &MF) {}
723723

724-
/// Target-specific hook for custom source line recording
725-
virtual void recordSourceLineHook(const MachineInstr &MI, const DebugLoc &DL,
726-
unsigned Flags);
724+
/// Target-specific source line recording.
725+
virtual void recordTargetSourceLine(const MachineInstr &MI,
726+
const DebugLoc &DL, unsigned Flags);
727727

728728
const SmallVectorImpl<std::unique_ptr<DwarfCompileUnit>> &getUnits() {
729729
return InfoHolder.getUnits();

llvm/lib/Target/NVPTX/NVPTXDwarfDebug.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,16 @@ void NVPTXDwarfDebug::recordSourceLineAndInlinedAt(const MachineInstr &MI,
151151
}
152152
}
153153

154-
// NVPTX-specific function initialization hook.
155-
void NVPTXDwarfDebug::beginFunctionHook(const MachineFunction &MF) {
154+
// NVPTX-specific debug info initialization.
155+
void NVPTXDwarfDebug::initializeTargetDebugInfo(const MachineFunction &MF) {
156156
InlinedAtLocs.clear();
157157
collectInlinedAtLocations(MF);
158158
}
159159

160160
// NVPTX-specific source line recording with inlined_at support.
161-
void NVPTXDwarfDebug::recordSourceLineHook(const MachineInstr &MI,
162-
const DebugLoc &DL, unsigned Flags) {
161+
void NVPTXDwarfDebug::recordTargetSourceLine(const MachineInstr &MI,
162+
const DebugLoc &DL,
163+
unsigned Flags) {
163164
// Call NVPTX-specific implementation that handles inlined_at.
164165
recordSourceLineAndInlinedAt(MI, Flags);
165166
}

llvm/lib/Target/NVPTX/NVPTXDwarfDebug.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class NVPTXDwarfDebug : public DwarfDebug {
3636
void collectInlinedAtLocations(const MachineFunction &MF);
3737

3838
protected:
39-
/// Override hook to collect inlined_at locations.
40-
void beginFunctionHook(const MachineFunction &MF) override;
41-
/// Override hook to record source line information with inlined_at support.
42-
void recordSourceLineHook(const MachineInstr &MI, const DebugLoc &DL,
43-
unsigned Flags) override;
39+
/// Override to collect inlined_at locations.
40+
void initializeTargetDebugInfo(const MachineFunction &MF) override;
41+
/// Override to record source line information with inlined_at support.
42+
void recordTargetSourceLine(const MachineInstr &MI, const DebugLoc &DL,
43+
unsigned Flags) override;
4444

4545
private:
4646
/// NVPTX-specific source line recording with inlined_at support.

0 commit comments

Comments
 (0)