mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: need to clear the bitfield ID when moving instructions between functions
I forgot to do this when introducing the `NodeBitfield`. rdar://97095506
This commit is contained in:
@@ -77,12 +77,21 @@ transferNodesFromList(llvm::ilist_traits<SILInstruction> &L2,
|
||||
// If transferring instructions within the same basic block, no reason to
|
||||
// update their parent pointers.
|
||||
SILBasicBlock *ThisParent = getContainingBlock();
|
||||
if (ThisParent == L2.getContainingBlock()) return;
|
||||
SILBasicBlock *l2Block = L2.getContainingBlock();
|
||||
if (ThisParent == l2Block) return;
|
||||
|
||||
bool differentFunctions = (ThisParent->getFunction() != l2Block->getFunction());
|
||||
|
||||
// Update the parent fields in the instructions.
|
||||
for (; first != last; ++first) {
|
||||
SWIFT_FUNC_STAT_NAMED("sil");
|
||||
first->ParentBB = ThisParent;
|
||||
if (differentFunctions) {
|
||||
for (SILValue result : first->getResults()) {
|
||||
result->resetBitfields();
|
||||
}
|
||||
first->asSILNode()->resetBitfields();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user