SIL: remove the SILOpenedArchetypesTracker

Instead, put the archetype->instrution map into SIlModule.

SILOpenedArchetypesTracker tried to maintain and reconstruct the mapping locally, e.g. during a use of SILBuilder.
Having a "global" map in SILModule makes the whole logic _much_ simpler.

I'm wondering why we didn't do this in the first place.

This requires that opened archetypes must be unique in a module - which makes sense. This was the case anyway, except for keypath accessors (which I fixed in the previous commit) and in some sil test files.
This commit is contained in:
Erik Eckstein
2021-04-10 19:22:02 +02:00
parent e5e28ff4c4
commit 6ec788ff09
54 changed files with 447 additions and 1131 deletions

View File

@@ -91,8 +91,7 @@ static bool isTargetTooNew(const llvm::Triple &moduleTarget,
}
ModuleFile::ModuleFile(std::shared_ptr<const ModuleFileSharedCore> core)
: Core(core),
DeserializedTypeCallback([](Type ty) {}) {
: Core(core) {
assert(!core->hasError());
DeclTypeCursor = core->DeclTypeCursor;