mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILModule: track opened archetypes per function.
In theory we could map opened archetypes per module because opened archetypes _should_ be unique across the module. But currently in some rare cases SILGen re-uses the same opened archetype in multiple functions. The fix is to add the SILFunction to the map's key. That also requires that we update the map whenever instructions are moved from one function to another. This fixes a compiler crash. rdar://76916931
This commit is contained in:
@@ -1020,19 +1020,12 @@ public:
|
||||
|
||||
/// Transfer all blocks of \p F into this function, at the begin of the block
|
||||
/// list.
|
||||
void moveAllBlocksFromOtherFunction(SILFunction *F) {
|
||||
BlockList.splice(begin(), F->BlockList);
|
||||
}
|
||||
void moveAllBlocksFromOtherFunction(SILFunction *F);
|
||||
|
||||
/// Transfer \p blockInOtherFunction of another function into this function,
|
||||
/// before \p insertPointInThisFunction.
|
||||
void moveBlockFromOtherFunction(SILBasicBlock *blockInOtherFunction,
|
||||
iterator insertPointInThisFunction) {
|
||||
SILFunction *otherFunc = blockInOtherFunction->getParent();
|
||||
assert(otherFunc != this);
|
||||
BlockList.splice(insertPointInThisFunction, otherFunc->BlockList,
|
||||
blockInOtherFunction);
|
||||
}
|
||||
iterator insertPointInThisFunction);
|
||||
|
||||
/// Move block \p BB to immediately before the iterator \p IP.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user