Treat private type declarations as "hidden" in SIL (rather than public).

Easy cut down on exported symbols. Unless a private type is referenced in
an inlineable function, there's no way to generate a reference to it
outside of the current file, except in the debugger. (That last bit is why
we can't use fully private linkage, which would keep the symbol out of the
symbol table completely.)

We should be doing this for "internal" declarations as well, but the
standard library /does/ have references to internal types in inlineable
functions, and also has tests that directly access these types.

Swift SVN r24838
This commit is contained in:
Jordan Rose
2015-01-30 03:54:04 +00:00
parent fc847e5686
commit 014fd87928
5 changed files with 37 additions and 5 deletions

View File

@@ -419,6 +419,7 @@ VarDecl *Module::getDSOHandle() {
DSOHandle->setImplicit(true);
DSOHandle->getAttrs().add(
new (Ctx) AsmnameAttr("__dso_handle", /*Implicit=*/true));
DSOHandle->setAccessibility(Accessibility::Internal);
return DSOHandle;
}