Skip to content

Commit 14a2d26

Browse files
committed
[SIL] Use Limit::OnDemand for an enum element in SILDeclRef::getLinkage
1 parent 68a6773 commit 14a2d26

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/SIL/IR/SILDeclRef.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ SILLinkage SILDeclRef::getLinkage(ForDefinition_t forDefinition) const {
233233

234234
// Native function-local declarations have shared linkage.
235235
// FIXME: @objc declarations should be too, but we currently have no way
236-
// of marking them "used" other than making them external.
236+
// of marking them "used" other than making them external.
237237
ValueDecl *d = getDecl();
238238
DeclContext *moduleContext = d->getDeclContext();
239239
while (!moduleContext->isModuleScopeContext()) {
@@ -335,6 +335,10 @@ SILLinkage SILDeclRef::getLinkage(ForDefinition_t forDefinition) const {
335335
}
336336
}
337337

338+
if (isEnumElement()) {
339+
limit = Limit::OnDemand;
340+
}
341+
338342
auto effectiveAccess = d->getEffectiveAccess();
339343

340344
// Private setter implementations for an internal storage declaration should

0 commit comments

Comments
 (0)