[llvm] [RemoveDIs][AsmWriter] Process DbgRecord DebugLocs (PR #82482)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 03:21:54 PST 2024


https://github.com/OCHyams created https://github.com/llvm/llvm-project/pull/82482

Otherwise DILocations sometimes get printed inline rather than as !dbg attachments in debug prints.

>From cf519c8c919ea506bc22ead7d1e458afb1cc20e6 Mon Sep 17 00:00:00 2001
From: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
Date: Wed, 21 Feb 2024 11:18:17 +0000
Subject: [PATCH] [RemoveDIs][AsmWriter] Process DbgRecord DebugLocs

Otherwise DILocations sometimes get printed inline rather than as !dbg
attachments in debug prints.
---
 llvm/lib/IR/AsmWriter.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 251485a403fee6..02537c604eb7ad 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -1139,6 +1139,7 @@ void SlotTracker::processFunctionMetadata(const Function &F) {
 }
 
 void SlotTracker::processDbgRecordMetadata(const DbgRecord &DR) {
+  CreateMetadataSlot(DR.getDebugLoc());
   if (const DPValue *DPV = dyn_cast<const DPValue>(&DR)) {
     CreateMetadataSlot(DPV->getVariable());
     CreateMetadataSlot(DPV->getDebugLoc());



More information about the llvm-commits mailing list