IRGen: support emitting specialized witness tables

This commit is contained in:
Erik Eckstein
2024-09-24 10:27:38 +02:00
parent 1d8f4b009e
commit 401a602b23
3 changed files with 49 additions and 15 deletions

View File

@@ -1381,6 +1381,10 @@ bool IRGenerator::canEmitWitnessTableLazily(SILWitnessTable *wt) {
if (Opts.UseJIT)
return false;
// witness tables are always emitted lazily in embedded swift.
if (SIL.getASTContext().LangOpts.hasFeature(Feature::Embedded))
return true;
// Regardless of the access level, if the witness table is shared it means
// we can safely not emit it. Every other module which needs it will generate
// its own shared copy of it.