diff options
author | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2024-02-23 13:46:57 +0000 |
---|---|---|
committer | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2024-02-26 09:09:52 +0000 |
commit | 3356818eed3224c50012f8ed2bfa046f2bc8e154 (patch) | |
tree | c4871eafd6cc32105bf2fc97d10d231acb818fae /llvm/lib/IR/BasicBlock.cpp | |
parent | 60677110a2e0b7ba9f5bf2fcfc1b3f8888eb7f58 (diff) | |
download | llvm-3356818eed3224c50012f8ed2bfa046f2bc8e154.zip llvm-3356818eed3224c50012f8ed2bfa046f2bc8e154.tar.gz llvm-3356818eed3224c50012f8ed2bfa046f2bc8e154.tar.bz2 |
Reapply [RemoveDIs] Enable DPLabels conversion [3b/3] (#82639)
Enables conversion between llvm.dbg.label and DPLabel.
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 18 |
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 |