Whenever we compute linkage of something with local linkage, if we can't find an abstract func decl, make the linkage shared.

Once we have real access control at the AST level, this should be changed to
match whatever the access control of the local declcontext.

Swift SVN r16098
This commit is contained in:
Michael Gottesman
2014-04-09 04:40:22 +00:00
parent 2c191278d8
commit ab154ec24a

View File

@@ -152,16 +152,17 @@ static SILLinkage getLinkageForLocalContext(DeclContext *dc) {
while (!dc->isModuleScopeContext()) {
// Local definitions in transparent contexts are forced public because
// external references to them can be exposed by mandatory inlining.
if (auto fn = dyn_cast<AbstractFunctionDecl>(dc)) {
if (auto fn = dyn_cast<AbstractFunctionDecl>(dc))
if (fn->isTransparent())
return SILLinkage::Public;
}
// Check that this local context is not itself in a local transparent
// context.
dc = dc->getParent();
}
return SILLinkage::Private;
// FIXME: Once we have access control at the AST level, we should not assume
// shared always, but rather base it off of the local decl context.
return SILLinkage::Shared;
}
SILLinkage SILDeclRef::getLinkage(ForDefinition_t forDefinition) const {