File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -233,13 +233,11 @@ SILLinkage SILDeclRef::getLinkage(ForDefinition_t forDefinition) const {
233
233
return forDefinition ? linkage : addExternalToLinkage (linkage);
234
234
};
235
235
236
- // Native function-local declarations have shared linkage.
237
- // FIXME: @objc declarations should be too, but we currently have no way
238
- // of marking them "used" other than making them external.
236
+ // Function-local declarations have private linkage, unless serialized.
239
237
ValueDecl *d = getDecl ();
240
238
DeclContext *moduleContext = d->getDeclContext ();
241
239
while (!moduleContext->isModuleScopeContext ()) {
242
- if (!isForeign && moduleContext->isLocalContext ()) {
240
+ if (moduleContext->isLocalContext ()) {
243
241
return isSerialized () ? SILLinkage::Shared : SILLinkage::Private;
244
242
}
245
243
moduleContext = moduleContext->getParent ();
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %build-irgen-test-overlays
3
3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) %s -emit-ir | %FileCheck %s
4
+ // RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) %s -emit-ir -O | %FileCheck %s
4
5
5
6
// REQUIRES: objc_interop
6
7
You can’t perform that action at this time.
0 commit comments