Commit Graph

7 Commits

Author SHA1 Message Date
Ben Cohen
e9d4687e31 De-underscore @frozen, apply it to structs (#24185)
* De-underscore @frozen for enums

* Add @frozen for structs, deprecate @_fixed_layout for them

* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00
Slava Pestov
3e864b26aa AST: @inline(__always) no longer implies @inlinable
Fixes <rdar://problem/44657000>.
2018-11-12 21:00:15 -05:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
Slava Pestov
2584a4878e Sema: Disallow inlinable initializers on non-fixed-layout types even in non-resilient builds
This is technically a source break, but the @_fixed_layout attribute
is not official yet. If anyone really cares, we can make this
conditional on -swift-version 5 later, but I'd rather not.

This change is necessary so that we can give property initializers
non-public linkage. Currently they are public, because they can be
referenced from inlinable initializers.

Now that property initializers inside a @_fixed_layout type can
only reference public symbols, they no longer have to be public,
but making that change requires a bit more work.
2018-01-12 19:03:49 -08:00
Slava Pestov
d65d1d25f9 Sema: Diagnostics for @_inlineable, @_versioned and Swift 4 default arguments model
Piggybacks some resilience diagnostics onto the availability
checking code.

Public and versioned functions with inlineable bodies can only
reference other public and internal entities, since the SIL code
for the function body is serialized and stored as part of the
module.

This includes @_transparent functions, @_inlineable functions,
accessors for @_inlineable storage, @inline(__always) functions,
and in Swift 4 mode, default argument expressions.

The new checks are a source-breaking change, however we don't
guarantee source compatibility for underscored attributes.

The new ABI and tests for the default argument model will come in
subsequent commits.
2017-01-09 16:59:13 -08:00
Doug Gregor
3926c349b2 Eliminate uses of ‘#’ from the testsuite.
Swift SVN r28842
2015-05-20 20:21:42 +00:00
Erik Eckstein
99cc7603be Add an @inline(__always) function attribute.
This will let the performance inliner inline a function even if the costs are too high.
This attribute is only a hint to the inliner.
If the inliner has other good reasons not to inline a function,
it will ignore this attribute. For example if it is a recursive function (which is
currently not supported by the inliner).

Note that setting the inline threshold to 0 does disable performance inlining at all and in
this case also the @inline(__always) has no effect.



Swift SVN r21452
2014-08-26 00:56:34 +00:00