[embedded] Start fencing parts of IRGen that are not compatible with embedded Swift.

This commit is contained in:
zoecarver
2023-08-29 23:05:47 -07:00
parent 52cea4250e
commit 349d37ab24
9 changed files with 70 additions and 4 deletions

View File

@@ -2568,6 +2568,10 @@ static void eraseExistingTypeContextDescriptor(IRGenModule &IGM,
void irgen::emitLazyTypeContextDescriptor(IRGenModule &IGM,
NominalTypeDecl *type,
RequireMetadata_t requireMetadata) {
if (type->getASTContext().LangOpts.hasFeature(Feature::Embedded)) {
return;
}
eraseExistingTypeContextDescriptor(IGM, type);
bool hasLayoutString = false;
@@ -6466,6 +6470,10 @@ SpecialProtocol irgen::getSpecialProtocolID(ProtocolDecl *P) {
void IRGenModule::emitProtocolDecl(ProtocolDecl *protocol) {
PrettyStackTraceDecl stackTraceRAII("emitting metadata for", protocol);
if (protocol->getASTContext().LangOpts.hasFeature(Feature::Embedded)) {
return;
}
// Marker protocols are never emitted.
if (protocol->isMarkerProtocol())
return;