* [Interface] Print private/internal properties
All properties which contribute to the storage of a type should be
printed, and their names should be hidden from interfaces. Print them
with '_' as their name, and teach the parser to recognize these special
patterns when parsing interface files.
Partially resolves rdar://43810647
* Address review comments
* Disable accessor generation for nameless vars
* Test to ensure interface files preserve type layout
* Ignore attribute differences on Linux
* [InterfaceGen] Remove #ifs from default args
This patch removes all #if configs form the bodies of default arguments,
which can contain multiline closures, while preserving the bodies of the
clauses that are active.
This code is generalized and should "just work" for inlinable function
bodies, which will come in a later patch.
* Address review comments
* Fix and test CharSourceRange.overlaps
* Fix CharSourceRange::print to respect half-open ranges
It's not clear whether we'll actually need this feature in the long
run, but we certainly need it now because non-@usableFromInline
members can (currently) satisfy public requirements when a
@usableFromInline internal type conforms to a public protocol. In
these cases, we'll treat the witnesses as present but opaque, and
clients will perform dynamic dispatch when using them even when
a generic function gets specialized.
With this, we're able to generate a textual interface for the standard
library, compile it back to a swiftmodule, and use it to build a Hello
World program!
This is needed for textual interfaces, but the behavior doesn't
have to be specific to that, since functions without bodies don't
come up in other situations.
We need @_transparent to control mandatory inlining; @_fixed_layout to
control, well, layout; and @_effects to help optimization. We still
don't need the ImplicitlyUnwrappedOptional attribute, and we don't
need access control attributes (because we handle that uniformly).
This also fixes up the printing of the '_effects' attribute to include
its underscore, so that it matches the source spelling.
These are synthesized to satisfy associated type requirements, but
they're not needed in source, and they look like self-referential
definitions (`typealias X = X`).
The presence of a deinitializer will eventually indicate whether a
class's deinitializer is non-trivial for non-resilient modules.
Also improve recovery for normal source files for various bad ways
of declaring a deinitializer.