diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2024-01-09 20:00:28 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2024-04-19 21:14:10 +0000 |
| commit | cdc20ff6a7f12464aed70d9b6e67ea07da9f0399 (patch) | |
| tree | 0c2f259d41b6d1f146c344cb9cf2b15ea99d35bb /contrib/llvm-project/llvm/lib/IR/AsmWriter.cpp | |
| parent | 7adf29b6244fe016ef869f287a66048195f9af29 (diff) | |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/IR/AsmWriter.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/IR/AsmWriter.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/IR/AsmWriter.cpp b/contrib/llvm-project/llvm/lib/IR/AsmWriter.cpp index 95cdec722062..278cdfce4110 100644 --- a/contrib/llvm-project/llvm/lib/IR/AsmWriter.cpp +++ b/contrib/llvm-project/llvm/lib/IR/AsmWriter.cpp @@ -859,6 +859,9 @@ private: /// 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 @@ -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)) |
