[thunk-lowering] Add a pass that performs lowering of ThunkInsts.

Right now it just handles the "identity" case so we can validate the
functionality.
This commit is contained in:
Michael Gottesman
2024-09-23 20:24:56 -07:00
parent 561662d6cc
commit f985b0ee03
7 changed files with 1362 additions and 0 deletions

View File

@@ -940,6 +940,26 @@ void SILModule::performOnceForPrespecializedImportedExtensions(
prespecializedFunctionDeclsImported = true;
}
void SILModule::moveBefore(SILModule::iterator moveAfter, SILFunction *fn) {
assert(&fn->getModule() == this);
assert(&moveAfter->getModule() == this);
assert(moveAfter != end() &&
"We assume that moveAfter must not be end since nothing is after end");
getFunctionList().remove(fn->getIterator());
getFunctionList().insert(moveAfter, fn);
}
void SILModule::moveAfter(SILModule::iterator moveAfter, SILFunction *fn) {
assert(&fn->getModule() == this);
assert(&moveAfter->getModule() == this);
assert(moveAfter != end() &&
"We assume that moveAfter must not be end since nothing is after end");
getFunctionList().remove(fn->getIterator());
getFunctionList().insertAfter(moveAfter, fn);
}
SILProperty *
SILProperty::create(SILModule &M, unsigned Serialized, AbstractStorageDecl *Decl,
std::optional<KeyPathPatternComponent> Component) {