Commit Graph

1397 Commits

Author SHA1 Message Date
Alexis Laferrière
758351110a [Sema] Allow the use of SPI in API for SPI modules
When the whole module has an SPI distribution, SPI declarations can be
used in API.

rdar://75335462
2021-04-20 15:02:51 -07:00
Adrian Prantl
ab3da1625e Make the function to compute the prebuilt module cache path public
so it can be called by LLDB. (NFC).

rdar://76112632
2021-04-06 17:17:32 -07:00
Varun Gandhi
cb6b1ea07b Merge pull request #36677 from varungandhi-apple/vg-emit-irgen
[Frontend] Add -emit-irgen option to driver and frontend.
2021-03-31 16:17:54 -07:00
Pavel Yaskevich
1e9ae59869 Merge pull request #36681 from xedin/revert-implicit-conversion-flag
Revert "[TypeChecker] Add a flag to disable Double<->CGFloat implicit…
2021-03-31 15:36:39 -07:00
Saleem Abdulrasool
c03c3b266d Merge pull request #36592 from drexin/wip-remove-codable-enum-flag
[Frontend] Remove enable-experimental-enum-codable-derivation flag
2021-03-31 15:04:32 -07:00
Varun Gandhi
cc14992281 [Frontend] Add -emit-irgen option to driver and frontend.
Fixes SR-14389, fixes rdar://75715690.
2021-03-31 11:56:36 -07:00
Pavel Yaskevich
ed8491c15b Revert "[TypeChecker] Add a flag to disable Double<->CGFloat implicit conversion"
This reverts commit 3c731d8748.
2021-03-31 11:10:21 -07:00
Pavel Yaskevich
f00c578761 Merge pull request #34401 from xedin/implicit-cgfloat-conversion
[DNM][TypeChecker] Implement Double <-> CGFloat implicit conversion
2021-03-31 10:20:28 -07:00
Alexis Laferrière
cf58bb7eb4 [Sema] Report public imports of private modules
Intro the concept of library access or distribution level to identify
layers of libraries and report public imports of private libraries from
public ones.

rdar://62934005
2021-03-26 16:30:15 -07:00
Doug Gregor
c76dac7155 Banish @asyncHandler to a hidden flag.
We don't want @asyncHandler to be part of the concurrency model, so put
it behind a different flag.
2021-03-25 16:45:21 -07:00
Dario Rexin
e42cf5b154 [Frontend] Remove enable-experimental-enum-codable-derivation flag
SE-295 has been accepted, so we don't need to hide the feature behind a flag anymore.
2021-03-25 15:26:21 -07:00
Saleem Abdulrasool
714eaefc78 Importer: remove ImportAsMember support
This functionality is not actively in use and the last usage of this has
been removed.  Remove the infrastructure that is no longer in need.
2021-03-22 08:53:56 -07:00
Doug Gregor
9579390024 [SE-0304] Rename ConcurrentValue to Sendable 2021-03-18 22:48:20 -07:00
Pavel Yaskevich
3c731d8748 [TypeChecker] Add a flag to disable Double<->CGFloat implicit conversion 2021-03-17 00:18:19 -07:00
Doug Gregor
6efaf7ac0f Introduce -warn-concurrency flag to warn about concurrency issues.
To help support incremental adoption of the concurrency model, a number
of concurrency-related diagnostics are enabled only in "new" code that
takes advantage of concurrency features---async, @concurrent functions,
actors, etc. This warning flag opts into additional warnings that better
approximate the eventual concurrency model, and which will become
errors a future Swift version, allowing one to both experiment with
the full concurrency model and also properly prepare for it.
2021-03-05 10:58:54 -08:00
Andrew Trick
291467c8a5 Merge branch 'main' into mandatory-copyprop 2021-03-03 05:53:51 -08:00
Andrew Trick
a77ced8423 Add frontend flags for developers to easily control copy propagation:
-enable-copy-propagation: enables whatever form of copy propagation
 the current pipeline runs (mandatory-copy-propagation at -Onone,
 regular copy-propation at -O).

-disable-copy-propagation: similarly disables any form of copy
 propagation in the current pipelien.
2021-03-02 22:20:13 -08:00
Doug Gregor
2f2c0ba437 Add a flag to enable ConcurrentValue inference for public structs/enums. 2021-03-02 17:03:21 -08:00
Dario Rexin
8e0a260414 [Sema]: Add Codable synthesis for enums with associated values (#34855)
* [Sema]: Add Codable synthesis for enums with associated values

* Incorporate review feedback for enum Codable synthesis

* Implement enum specific versions of existing Codable tests

* Encode parameterless enum cases as

* Add test for overloaded case identifiers

* Align code generation with latest proposal revision

* Put enum codable derivation behind flag

* clang-format sources

* Address review feedback and fix tests

* Add diagnostic for conflicting parameter identifiers

* Restructure code after rebase
2021-02-26 17:20:34 -08:00
Evan Wilde
9b75f32c58 Merge pull request #36161 from etcwilde/ewilde/remove-has-async-alt-flag
[Concurrency] Remove @hasAsyncAlternative feature flag
2021-02-26 09:48:52 -08:00
Evan Wilde
c5a67fdcb7 Remove feature flag for has-async-alt attr
This patch removes the feature flag for @hasAsyncAlternative since it's
already protected by the experimental concurrency flag and will go in
with the concurrency features.

This fixes one of Doug's comments on
https://github.com/apple/swift/pull/36027.
2021-02-25 08:58:05 -08:00
Michael Gottesman
91317c723c [ownership] Make whether or not we serialize in OSSA form based off of the flag -enable-ossa-modules.
I added a change to CMake so that the stdlib still gets the option passed in so
should be NFC.
2021-02-22 19:07:45 -08:00
Doug Gregor
ecf36ba6bc Enable ConcurrentValue checking as part of Concurrency mode.
Drop the separate flag guarding this checking.
2021-02-22 00:29:56 -08:00
Ben Barham
3a7bf2301b [AST] Add a new attribute @hasAsyncAlternative
This attribute marks a function has having an async alternative,
optionally providing the name of that function as a string. Intended to
be used to allow warnings when using a function with an async
alternative in an asynchronous context, to make the async refactorings
more accurate, and for documentation.
2021-02-18 16:18:38 +10:00
Michael Gottesman
02784b3cb2 Merge pull request #36025 from gottesmm/pr-36fe6ec4772e3d5e09f5031a505217e7d7aba8dc
[ownership] On non-Darwin platforms, serialize the stdlib in OSSA form.
2021-02-17 19:48:25 -08:00
Michael Gottesman
57654da4db [ownership] On non-Darwin platforms start serializing the stdlib in OSSA as well.
I had to fix a memory corruption bug (see previous commit) to land this. But now
that it is fixed, we are ready!
2021-02-17 15:59:00 -08:00
Arnold Schwaighofer
5e851ac5a0 Merge pull request #35945 from aschwaighofer/revert_make_prespecialization_experimental
Revert "Merge pull request #34848 from aschwaighofer/make_prespecialization_experimental"
2021-02-16 07:35:36 -08:00
Michael Gottesman
dd6439d31e [ownership] Change the stdlib to serialize code in ossa form on Darwin.
There is some sort of ASAN issue that this exposes on Linux, so I am going to do
this on Darwin and then debug the Linux issue using ASAN over the weekend/next
week.
2021-02-12 23:20:17 -08:00
Arnold Schwaighofer
084db0d38f Revert "Merge pull request #34848 from aschwaighofer/make_prespecialization_experimental"
This reverts commit 3aec862e62, reversing
changes made to 158427bd5b.
2021-02-12 10:12:01 -08:00
AG
a5b804602d Merge pull request #35110 from bitjammer/acgarland/emit-symbol-graph
Add optional -emit-symbol-graph output when emitting modules
2021-02-12 09:00:58 -08:00
Doug Gregor
6dd1c4768a [Concurrency] Put the flow-sensitive concurrent captures check behind a flag
We're not quite ready to commit to the flow-sensitive check that would
allow a concurrent function to read from a mutable local capture so
long as the captured variable wasn't changed after the point of
capture. Put it behind a flag and implement the more restrictive rule
(no access to mutable local captures in concurrent code). We can relax
it later.
2021-02-11 11:43:07 -08:00
Doug Gregor
866a8d8944 Introduce checking for ConcurrentValue conformance across actors.
When referring to an actor-isolated declaration from outside of the
actor, ensure that the types involved conform to the `ConcurrentValue`
protocol. Otherwise, produce a diagnostic stating that it is unsafe to
pass such types across actors.

Apply the same rule to local captures within concurrent code.
2021-02-03 17:37:43 -08:00
Ashley Garland
69c4fc47cb Add optional -emit-symbol-graph output when emitting modules
rdar://71497047
2021-01-28 09:55:33 -08:00
swift-ci
601af1352a Merge remote-tracking branch 'origin/main' into rebranch 2021-01-27 15:32:37 -08:00
nate-chandler
20930c3b4a Merge pull request #35595 from nate-chandler/other-main
[SILGen] Enable alternative entry point name.
2021-01-27 15:22:27 -08:00
swift-ci
9aad33b08f Merge remote-tracking branch 'origin/main' into rebranch 2021-01-27 10:32:29 -08:00
Michael Gottesman
6e61279dec Merge pull request #35587 from gottesmm/pr-5db2d0b093c814bacaaf559563926c5dec16acc3
[ast] Enable the ASTVerifier behind the enable-ast-verifier flag in no-asserts builds.
2021-01-27 10:13:54 -08:00
swift-ci
2967e35a49 Merge remote-tracking branch 'origin/main' into rebranch 2021-01-26 20:52:47 -08:00
Nate Chandler
e21550ad90 [SILGen] Enable alternative entry point name.
Previously, the name of the entry point function was always main.  Here,
a new frontend flag is added to enable an arbitrary name to be
specified.

rdar://58275758
2021-01-26 10:43:33 -08:00
Varun Gandhi
f9570b2d34 [NFC] Pass full convention printing boolean for types etc.
When -experimental-print-full-convention is set, we should be printing
the full convention in diagnostics, doc comments etc.
2021-01-25 18:47:39 -08:00
Michael Gottesman
1de2d3f7c0 [ast] Enable the ASTVerifier behind the enable-ast-verifier flag in no-asserts builds.
This follows the design of how we handled this with
sil-verify-all. Specifically, the default behavior is to run only in asserts
builds, but one can use the two flags: enable-ast-verifier and
disable-ast-verifier to override the default behavior.

The reason why this is interesting is that this means that when compiling
normally, we will not run the verifier, so we won't have a perf hit. But we can
now ask the user to run with this flag (or in a future maybe a re-run in the
driver would do this for them), saving us time when screening bugs by avoiding
the need to build an asserts compiler to triage if the ASTVerifier would catch
the bug.
2021-01-25 11:55:47 -08:00
swift-ci
74761e3ffe Merge remote-tracking branch 'origin/main' into rebranch 2021-01-19 18:32:17 -08:00
Slava Pestov
c456748551 Frontend: Remove a couple of obsolete staging flags
-enable-subst-sil-function-types-for-function-values
-enable-large-loadable-types

These defaulted to on, and there were no corresponding flags for
turning them off, so the flags had no effect.
2021-01-19 17:47:53 -05:00
Nate Chandler
20db2c0981 Merge branch 'main' into rebranch
Conflicts:
	include/swift/Basic/AnyValue.h
2021-01-12 16:30:02 -08:00
Brent Royal-Gordon
5036a55550 [Frontend] Allow additional files for diagnostic verifier
This change adds a frontend flag, -verify-additional-file, which can be used to pass extra files directly to the diagnostic verifier. These files are not otherwise considered to be Swift source files; they are not compiled or even properly parsed.

This feature can be used to verify diagnostics emitted in non-source files, such as in module interfaces or header files.
2021-01-11 15:59:25 -08:00
Slava Pestov
28e7ed03d0 AST: Remove the 'legacy' request dependency graph implementation 2021-01-08 23:17:12 -05:00
swift_jenkins
de9e56fb12 Merge remote-tracking branch 'origin/main' into next 2020-12-16 19:43:18 -08:00
Dan Liew
8e95189d24 Merge pull request #35074 from apple/dliew/rdar-69335186
Disable "UseOdrIndicator" ASan instrumentation mode by default.
2020-12-16 19:19:40 -08:00
Dan Liew
9208b52de1 Disable "UseOdrIndicator" ASan instrumentation mode by default.
Previously Swift enabled the "UseOdrIndicator" ASan instrumentation mode
and gave no option to disable this. This probably wasn't intentional but
happened due to the fact the
`createModuleAddressSanitizerLegacyPassPass()` function has a default
value for the `UseOdrIndicator` parameter of `true` and in Swift we
never specified this parameter explicitly.

Clang disables the "UseOdrIndicator" mode by default but allows it to be
enabled using the `-fsanitize-address-use-odr-indicator` flag.
Having "UseOdrIndicator" off by default is probably the right
default choice because it bloats the binary. So this patch changes the
Swift compiler to match Clang's behavior.

This patch disables the "UseOdrIndicator" mode by default but adds a
hidden driver and frontend flag (`-sanitize-address-use-odr-indicator`)
to enable it. The flag is hidden so that we can remove it in the future
if needed.

A side effect  of disabling "UseOdrIndicator" is that by we will no
longer use private aliases for poisoning globals. Private aliases were
introduced to avoid crashes
(https://github.com/google/sanitizers/issues/398) due to ODR violations
with non-instrumented binaries. On Apple platforms the use of two-level
namespaces probably means that using private aliases wasn't ever really
necessary to avoid crashes. On platforms with a flat linking namespace
(e.g. Linux) using private aliases might matter more but should users
actually run into problems they can either:

* Fix their environment to remove the ODR, thus avoiding the crash.
* Instrument the previously non-instrumented code to avoid the crash.
* Use the new `-sanitize-address-use-odr-indicator` flag

rdar://problem/69335186
2020-12-15 11:09:30 -08:00
swift_jenkins
6253b23539 Merge remote-tracking branch 'origin/main' into next 2020-12-11 18:51:07 -08:00