Commit Graph

13 Commits

Author SHA1 Message Date
Becca Royal-Gordon
7703d115db Filter bad attrs out of module interface @abis
When printing an `@abi` attribute’s decl, we now filter out any attrs that are not valid in that position. Fixes a broken test.
2025-03-26 10:47:58 -07:00
Pavel Yaskevich
dd1be8f6d4 [Frontend] Hide @execution attribute behind an experimental feature ExecutionAttribute
Since the proposal has not been approved yet we cannot expose
`@execution` attribute.
2025-02-20 00:05:03 -08:00
Pavel Yaskevich
e2ff3308be [Frontend] NFC: Rename NonIsolatedAsyncInheritsIsolationFromContext feature
New name is `AsyncCallerExecution` as stated by the proposal.
2025-02-19 20:00:56 -08:00
Pavel Yaskevich
fc1e650b89 [Tests] NFC: Add serialization test for @execution(...) attribute 2025-01-17 15:40:01 -08:00
Becca Royal-Gordon
0d34b4da5b Print @abi into module interface (suppressibly) 2024-12-19 15:49:34 -08:00
Arnold Schwaighofer
7bfa01a817 swiftinterface: print _specialize functions with targetFunction parameter in .swiftinterface
If we have an internal function with a `_specialize` attribute that has
a `targetFunction:` parameter we want the function to appear in the
.swiftinterface file such that the exported specialization can be picked up by
the compiler.
2022-05-09 10:08:52 -07:00
Allan Shortlidge
d3dbe75419 ModuleInterface: Introduce the %target-swift-emit-module-interface and %target-swift-typecheck-module-from-interface lit substitutions and adopt them in some tests that involve emitting a swiftinterface. The substitutions specify the additional flags -swift-version 5 -enable-library-evolution. There are a few motivations for adding these substitutions:
- Tests that depend on emitted interfaces should generally use flags that are typical for modules that have textual interfaces (e.g. `-enable-library-evolution`).
- If a test is intended to produce a valid `swiftinterface` then it should verify that interface. This will help prevent interface printing regressions caused by compiler changes.
- Having commonly used substitutions for tests that emit interfaces makes it easy to experiment with compiler flags that might effect interface printing.

Resolves rdar://91634358
2022-04-14 15:09:36 -07:00
Erik Eckstein
beb2bd2a96 AST: support @_effects attribute with custom strings.
In addition to the predefined cases,  like "readnone", "readonly", etc. support providing a custom string, which will be parsed later.
Also, allow multiple effects attributes to be put onto a function.
2022-01-25 11:29:23 +01:00
Harlan Haskins
d3b8ce7ae2 [test] Update ParseableInterface to ModuleInterface
Also remove uses of -emit-parseable-module-interface from tests
2019-09-13 14:55:48 -07:00
Jordan Rose
73d5ebaad2 Rename "textual interface" to "parseable interface" (#19713)
We already have something called "module interfaces" -- it's the
generated interface view that you can see in Xcode, the interface
that's meant for developers using a library. Of course, that's also a
textual format. To reduce confusion, rename the new module stability
feature to "parseable [module] interfaces".
2018-10-04 17:49:55 -07:00
Jordan Rose
3ea754481e [Frontend] Allow -emit-interface with -typecheck (#19676)
Textual module interfaces don't actually depend on SILGen, so we
shouldn't need to run SILGen (or serialize an entire binary module) if
we're just trying to emit a textual interface. On the other hand, if
we /are/ going to run SILGen and then SIL diagnostics, we shouldn't
delay those diagnostics by spending time emitting a textual interface,
or for that matter a TBD file.

Using this, update all the ModuleInterface tests that use
`-emit-module -o /dev/null` to use `-typecheck` instead, except for
those using `-merge-modules`.
2018-10-03 15:07:31 -07:00
Harlan
665db876ea [InterfaceGen] Print bodies of inlinable functions in textual interfaces (#19224)
* Introduce stored inlinable function bodies

* Remove serialization changes

* [InterfaceGen] Print inlinable function bodies

* Clean up a little bit and add test

* Undo changes to InlinableText

* Add serialization and deserialization for inlinable body text

* Allow parser to parse accessor bodies in interfaces

* Fix some tests

* Fix remaining tests

* Add tests for usableFromInline decls

* Add comments

* Clean up function body printing throughout

* Add tests for subscripts

* Remove comment about subscript inlinable text

* Address some comments

* Handle lack of @objc on Linux
2018-09-14 10:23:15 -07:00
Jordan Rose
7046980f99 [ModuleInterface] Print normally unprinted attributes
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.
2018-08-20 18:30:01 -07:00