Skip to content

Commit

Permalink
Merge pull request swiftlang#77914 from swiftlang/no-silproperties-in…
Browse files Browse the repository at this point in the history
…-embedded-6.1

[6.1] embedded: Don't emit SILProperties in embedded swift
  • Loading branch information
eeckstein authored Dec 4, 2024
2 parents 5b8242f + 2d18f9f commit d415967
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/IRGen/GenDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1224,10 +1224,12 @@ void IRGenerator::emitGlobalTopLevel(
}
}

// Emit property descriptors.
for (auto &prop : PrimaryIGM->getSILModule().getPropertyList()) {
CurrentIGMPtr IGM = getGenModule(prop.getDecl()->getInnermostDeclContext());
IGM->emitSILProperty(&prop);
if (!SIL.getASTContext().LangOpts.hasFeature(Feature::Embedded)) {
// Emit property descriptors.
for (auto &prop : PrimaryIGM->getSILModule().getPropertyList()) {
CurrentIGMPtr IGM = getGenModule(prop.getDecl()->getInnermostDeclContext());
IGM->emitSILProperty(&prop);
}
}

// Emit differentiability witnesses.
Expand Down
10 changes: 10 additions & 0 deletions test/embedded/keypath-crash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,14 @@ public struct State<Wrapped> {
}
}

public struct S<T> {
public private(set) subscript(x: Int) -> Int {
get {
return 27
}
mutating set {
}
}
}

// CHECK: define {{.*}}@main(

0 comments on commit d415967

Please sign in to comment.