Skip to content

Commit ef7ce1a

Browse files
committed
allow empty to empty splice with trailing dpvalues, fixes OpenMP/cancel_codegen.cpp
1 parent 197ab57 commit ef7ce1a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/IR/BasicBlock.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -752,14 +752,13 @@ void BasicBlock::spliceDebugInfoEmptyBlock(BasicBlock::iterator Dest,
752752
// occur when a block is optimised away and the terminator has been moved
753753
// somewhere else.
754754
if (Src->empty()) {
755-
assert(Dest != end() &&
756-
"Transferring trailing DPValues to another trailing position");
757755
DPMarker *SrcTrailingDPValues = Src->getTrailingDPValues();
758756
if (!SrcTrailingDPValues)
759757
return;
760758

761-
Dest->adoptDbgValues(Src, Src->end(), InsertAtHead);
762-
// adoptDbgValues should have released the trailing DPValues.
759+
DPMarker *DestMarker = getMarker(Dest);
760+
DestMarker->absorbDebugValues(*SrcTrailingDPValues, InsertAtHead);
761+
SrcTrailingDPValues->eraseFromParent();
763762
assert(!Src->getTrailingDPValues());
764763
return;
765764
}

0 commit comments

Comments
 (0)