aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp8
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 {