diff options
author | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2024-03-18 14:41:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 14:41:32 +0000 |
commit | 487f356b20860a3eeb29b836483c639735f9393c (patch) | |
tree | dd1c1499bc3d73604d403a55646140434845a90e /llvm/lib/IR | |
parent | c5177f149b43dcc5a39c2c1aefaf1bba8518fd2e (diff) | |
download | llvm-487f356b20860a3eeb29b836483c639735f9393c.zip llvm-487f356b20860a3eeb29b836483c639735f9393c.tar.gz llvm-487f356b20860a3eeb29b836483c639735f9393c.tar.bz2 |
[RemoveDIs][AsmWriter] Add empty-metadata operands to the SlotTracker (#85636)
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 11383ea..19acc89 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -1143,9 +1143,15 @@ void SlotTracker::processDbgRecordMetadata(const DbgRecord &DR) { // Process metadata used by DbgRecords; we only specifically care about the // DILocalVariable, DILocation, and DIAssignID fields, as the Value and // Expression fields should only be printed inline and so do not use a slot. + // Note: The above doesn't apply for empty-metadata operands. + if (auto *Empty = dyn_cast<MDNode>(DPV->getRawLocation())) + CreateMetadataSlot(Empty); CreateMetadataSlot(DPV->getRawVariable()); - if (DPV->isDbgAssign()) + if (DPV->isDbgAssign()) { CreateMetadataSlot(cast<MDNode>(DPV->getRawAssignID())); + if (auto *Empty = dyn_cast<MDNode>(DPV->getRawAddress())) + CreateMetadataSlot(Empty); + } } else if (const DPLabel *DPL = dyn_cast<const DPLabel>(&DR)) { CreateMetadataSlot(DPL->getRawLabel()); } else { |