Skip to content

Commit 4a124f1

Browse files
committed
Sema: Remove unused addFixedLayoutAttr() entrypoint
1 parent c2e662c commit 4a124f1

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

lib/Sema/CodeSynthesis.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,24 +1510,6 @@ bool swift::hasLetStoredPropertyWithInitialValue(NominalTypeDecl *nominal) {
15101510
});
15111511
}
15121512

1513-
void swift::addFixedLayoutAttr(NominalTypeDecl *nominal) {
1514-
auto &C = nominal->getASTContext();
1515-
// If nominal already has `@_fixed_layout`, return.
1516-
if (nominal->getAttrs().hasAttribute<FixedLayoutAttr>())
1517-
return;
1518-
auto access = nominal->getEffectiveAccess();
1519-
// If nominal does not have at least internal access, return.
1520-
if (access < AccessLevel::Internal)
1521-
return;
1522-
// If nominal is internal, it should have the `@usableFromInline` attribute.
1523-
if (access == AccessLevel::Internal &&
1524-
!nominal->getAttrs().hasAttribute<UsableFromInlineAttr>()) {
1525-
nominal->getAttrs().add(new (C) UsableFromInlineAttr(/*Implicit*/ true));
1526-
}
1527-
// Add `@_fixed_layout` to the nominal.
1528-
nominal->getAttrs().add(new (C) FixedLayoutAttr(/*Implicit*/ true));
1529-
}
1530-
15311513
void swift::addNonIsolatedToSynthesized(
15321514
NominalTypeDecl *nominal, ValueDecl *value) {
15331515
if (!getActorIsolation(nominal).isActorIsolated())

lib/Sema/CodeSynthesis.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ ValueDecl *getProtocolRequirement(ProtocolDecl *protocol, Identifier name);
7474
// with an initial value.
7575
bool hasLetStoredPropertyWithInitialValue(NominalTypeDecl *nominal);
7676

77-
/// Add `@_fixed_layout` attribute to the nominal type, if possible.
78-
void addFixedLayoutAttr(NominalTypeDecl *nominal);
79-
8077
/// Add 'nonisolated' to the synthesized declaration when needed.
8178
void addNonIsolatedToSynthesized(NominalTypeDecl *nominal, ValueDecl *value);
8279

0 commit comments

Comments
 (0)