Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion llvm/lib/IR/AsmWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@ class SlotTracker : public AbstractSlotTrackerStorage {

/// Add all of the metadata from an instruction.
void processInstructionMetadata(const Instruction &I);

/// Add all of the metadata from an instruction.
void processDPValueMetadata(const DPValue &DPV);
};

} // end namespace llvm
Expand Down Expand Up @@ -1126,11 +1129,19 @@ void SlotTracker::processGlobalObjectMetadata(const GlobalObject &GO) {
void SlotTracker::processFunctionMetadata(const Function &F) {
processGlobalObjectMetadata(F);
for (auto &BB : F) {
for (auto &I : BB)
for (auto &I : BB) {
for (const DPValue &DPV : I.getDbgValueRange())
processDPValueMetadata(DPV);
processInstructionMetadata(I);
}
}
}

void SlotTracker::processDPValueMetadata(const DPValue &DPV) {
CreateMetadataSlot(DPV.getVariable());
CreateMetadataSlot(DPV.getDebugLoc());
}

void SlotTracker::processInstructionMetadata(const Instruction &I) {
// Process metadata used directly by intrinsics.
if (const CallInst *CI = dyn_cast<CallInst>(&I))
Expand Down