aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/BasicBlock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r--llvm/lib/IR/BasicBlock.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 06807544..6ea876f 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -81,6 +81,12 @@ void BasicBlock::convertToNewDbgValues() {
continue;
}
+ if (DbgLabelInst *DLI = dyn_cast<DbgLabelInst>(&I)) {
+ DPVals.push_back(new DPLabel(DLI->getLabel(), DLI->getDebugLoc()));
+ DLI->eraseFromParent();
+ continue;
+ }
+
if (DPVals.empty())
continue;
@@ -107,16 +113,12 @@ void BasicBlock::convertFromNewDbgValues() {
continue;
DPMarker &Marker = *Inst.DbgMarker;
- for (DbgRecord &DR : Marker.getDbgValueRange()) {
- if (auto *DPV = dyn_cast<DPValue>(&DR))
- InstList.insert(Inst.getIterator(),
- DPV->createDebugIntrinsic(getModule(), nullptr));
- else
- llvm_unreachable("unsupported DbgRecord kind");
- }
+ for (DbgRecord &DR : Marker.getDbgValueRange())
+ InstList.insert(Inst.getIterator(),
+ DR.createDebugIntrinsic(getModule(), nullptr));
Marker.eraseFromParent();
- };
+ }
// Assume no trailing DPValues: we could technically create them at the end
// of the block, after a terminator, but this would be non-cannonical and