Commit Graph

4565 Commits

Author SHA1 Message Date
Rauhul Varma
808ccd47ff [SymbolGraphGen] Handle cxx module imports in swift-symbolgraph-extract
Updates swift-symbolgraph-extract to parse "-cxx-interoperability-mode"
flags and update the underlying compiler invocation. This fixes a bug
where were are unable to extract the symbol graph from swiftmodules with
transitive cxx modules because we parsed cxx headers as c headers.

rdar://128888548 (Add support for parsing cxx headers)
2024-05-29 13:03:27 -07:00
swift-ci
bc80f1ca21 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-28 17:50:40 -07:00
Tim Kientzle
65f78e6268 Merge pull request #73675 from tbkka/tbkka-assertions-v2
New assertions support
2024-05-28 17:25:21 -07:00
swift-ci
061d79af06 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-24 18:34:23 -07:00
Allan Shortlidge
8607953aea Frontend: Lift restrictions on lazy typechecking options.
The `-experimental-skip-all-function-bodies` flag is specified when producing
modules for indexing. These modules are not used for compilation, so it should
be safe to allow `-experimental-lazy-typecheck` and
`-experimental-skip-non-exportable-decls` as well without
`-enable-library-evolution`.

Resolves rdar://128706306
2024-05-24 15:13:31 -07:00
Allan Shortlidge
741a72194e Frontend: Remove -experimental-skip-non-inlinable-function-bodies-is-lazy.
It is no longer needed to work around missing build system support.
2024-05-24 15:13:29 -07:00
swift-ci
eb8e2fcb7d Merge remote-tracking branch 'origin/main' into rebranch 2024-05-22 16:34:36 -07:00
Steven Wu
68c755e99c [Caching] Temporarily using llvm style diagnostics in caching
When caching is enabled, using swift style diagnotics can lead to
crashes due to some uninitialized variables. Even more, the swift style
diagnostics is not going to render the same when replay from the cache
since the currect caching diagnostics processor is not capture all
information that is needed to render diagnostis from SwiftSyntax.
Temprarily using llvm style for caching builds.

rdar://127530204
2024-05-22 13:15:08 -07:00
swift-ci
d03bdc9b7c Merge remote-tracking branch 'origin/main' into rebranch 2024-05-22 11:35:01 -07:00
Augusto Noronha
16755e938b Merge pull request #73727 from augusto2112/remove-dep-irgen
Remove dependency of SILFunction in IRGenOptions
2024-05-22 11:18:49 -07:00
swift-ci
2cb9866dd0 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-21 17:15:28 -07:00
Ellie Shin
165ce9c95f Merge pull request #73717 from apple/elsh/override-flags
Override flags that prevent package-cmo if allow-non-resilient-access is enabled
2024-05-21 16:56:16 -07:00
Augusto Noronha
4aec4e7cc4 Remove dependency of SILFunction in IRGenOptions
SILFunction::shouldBePreservedForDebugger checks if some optimizations
are enabled to decide whether a function should be preserved so its
accessible form the debugger or not. Some of these settings used to live
only in IRGenOptions making SILFunction depend on IRGenOptions.
2024-05-21 15:30:15 -07:00
swift-ci
1d0abfc691 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-20 17:34:38 -07:00
Artem Chikin
31337dd004 Merge pull request #69706 from artemcm/DepScanCPPInterop
[Explicit Module Builds] C++ Interoperability mode fixes
2024-05-20 20:29:17 -04:00
Ellie Shin
84a7c6395c Override flags that prevent package-cmo if allow-non-resilient-access is enabled 2024-05-20 14:13:07 -07:00
artemcm
ec4e0e23aa Allow users to opt-out of implicit Cxx import with -disable-implicit-cxx-module-import 2024-05-20 11:18:45 -07:00
swift-ci
1e55e12c22 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-20 10:54:39 -07:00
Steven Wu
295c845dd2 Merge pull request #73601 from cachemeifyoucan/eng/PR-127844120
[ScanDependency] Pass crossimport overlay file to swift-frontend
2024-05-20 10:38:04 -07:00
Artem Chikin
6ea604bf9f Always add an implicit import of 'Cxx' module when C++ Interop is enabled.
We cannot always rely on being able to do so only as an overlay query upon loading 'requires cplusplus' modulemap modules. The 'requires' statement only applies to submodules, and we may not be able to query language feature modulemap attributes in dependency scanning context.
2024-05-20 10:23:10 -07:00
Artem Chikin
bc17581ae6 [Explicit Module Builds] Propagate the C++ Interop mode to interface sub-invocations and dependency scanner 2024-05-20 10:23:10 -07:00
swift-ci
b20fedebc6 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-18 02:54:31 -07:00
Michael Gottesman
d759ec97ea Merge pull request #73696 from gottesmm/rdar128216574
[sending] Add support for 'sending'
2024-05-18 05:42:41 -04:00
Michael Gottesman
20a3589763 [sending] Enable sending whenever region isolation is enabled and make SE-0430 an upcoming feature.
I also added support for expressing suppressable upcoming features.

rdar://128216574
2024-05-17 19:56:29 -07:00
swift-ci
97775b94ad Merge remote-tracking branch 'origin/main' into rebranch 2024-05-17 11:36:37 -07:00
Michael Gottesman
b780ff6696 [sending] Begin parsing 'sending' while still accepting 'transferring'.
A few things:

1. Internally except for in the parser and the clang importer, we only represent
'sending'. This means that it will be easy to remove 'transferring' once enough
time has passed.

2. I included a warning that suggested to the user to change 'transferring' ->
'sending'.

3. I duplicated the parsing diagnostics for 'sending' so both will still get
different sets of diagnostics for parsing issues... but anywhere below parsing,
I have just changed 'transferring' to 'sending' since transferring isn't
represented at those lower levels.

4. Since SendingArgsAndResults is always enabled when TransferringArgsAndResults
is enabled (NOTE not vis-a-versa), we know that we can always parse sending. So
we import "transferring" as "sending". This means that even if one marks a
function with "transferring", the compiler will guard it behind a
SendingArgsAndResults -D flag and in the imported header print out sending.

rdar://128216574
2024-05-16 21:43:50 -07:00
Alexis Laferrière
074df70248 Serialization: Write the target SDK in the binary swiftmodule 2024-05-16 11:52:36 -07:00
Tim Kientzle
5b49a04ddc New assertions support
This adds three new assertion macros:
* `ASSERT` - always compiled in, always checked
* `CONDITIONAL_ASSERT` - always compiled in, checked whenever the `-compiler-assertions` flag is provided
* `DEBUG_ASSERT` - only compiled into debug builds, always checked when compiled in  (functionally the same as Standard C `assert`)

The new `-compiler-assertions` flag is recognized by both `swift-frontend` and
`swiftc`.

The goal is to eventually replace every use of `assert` in the compiler with one of the above:
* Most assertions will use `ASSERT` (most assertions should always be present and checked, even in release builds)
* Expensive assertions can use `CONDITIONAL_ASSERT` to be suppressed by default
* A few very expensive and/or brittle assertions can use `DEBUG_ASSERT` to be compiled out of release builds

This should:
* Improve quality by catching errors earlier,
* Accelerate compiler triage and debugging by providing more accurate crash dumps by default, and
* Allow compiler engineers and end users alike to add `-compiler-assertions` to get more accurate failure diagnostics with any compiler
2024-05-16 11:38:00 -07:00
swift-ci
3169989eed Merge remote-tracking branch 'origin/main' into rebranch 2024-05-16 06:54:32 -07:00
Doug Gregor
359afa89fa Merge pull request #73662 from DougGregor/concurrency-now-with-availability 2024-05-16 06:40:55 -07:00
Doug Gregor
214d3f6980 Remove an old, horrible compatibility hack in the _Concurrency module
The concurrency module was getting an implicit
`-disable-availability-checking` as a workaround from the Swift 5.6
days. Remove it, because it causes problems with the new `Failure`
type in the async for..in loop.

Fixes a back-deployment issue with async algorithms in the
_Concurrency library that use the async for..in loop.
2024-05-15 21:28:14 -07:00
swift-ci
38df85afd6 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-15 08:16:25 -07:00
Kavon Farvardin
5ae2f6bd25 CxxInterop: use Unsafe*Pointer for move-only 2024-05-14 17:44:22 -07:00
Steven Wu
cf8187a4fe [ScanDependency] Pass crossimport overlay file to swift-frontend
Teach dependency scanner to pass cross import overlay file to
swift-frontend for main module compilation. This allows swift-frontend
not to repeat the file system search for overlay files when loading
modules.

This also fixes the issue when caching is enabled, the cross import
doesn't work when the first module is a clang module because the module
built with caching using clang include tree does not preserve
DefinitionLoc which is used to inferred the modulemap location for cross
import overlay search.

rdar://127844120
2024-05-14 15:24:35 -07:00
swift-ci
85e6e794ca Merge remote-tracking branch 'origin/main' into rebranch 2024-05-13 13:15:29 -07:00
Steven Wu
431f097e7c [Caching] Mark -typecheck action as caching supported
This is a regression causing lots of cached diagnostics tests not
functioning since the cached diagnostics processors are not initialized
for those tests which are supposed to test diagnostics caching.

The regression is caused by the fix that the typecheck module interface
job need to run a typecheck job in the sub-invocation. Now the typecheck
module interface job is correctly setup to avoid diagnostics about
unsupported file system error.
2024-05-13 09:36:12 -07:00
swift-ci
8547389f7d Merge remote-tracking branch 'origin/main' into rebranch 2024-05-10 08:53:59 -07:00
Kshitij Jain
01654fd323 Merge pull request #71775 from jkshtj/main
[Autodiff] Adds part of the Autodiff specific closure-specialization optimization pass
2024-05-10 08:51:01 -07:00
swift-ci
d0709e4c11 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-07 09:14:00 -07:00
Holly Borla
a7920ce50b [Features] Replace -enable-nonfrozen-enum-exhaustivity-diagnostics with an
upcoming feature.

The bespoke flag still works as a way to enable the `NonfrozenEnumExhaustivity`
upcoming feature. `NonfrozenEnumExhaustivity` is enabled by default in the
Swift 6 language mode as errors, and enabled by default in the Swift 5 language
mode as warnings.
2024-05-06 20:56:20 -07:00
Kshitij
fd609846ae Makes the swift-based closure-spec pass an experimental frontend feature 2024-05-02 09:14:05 -07:00
swift-ci
8aa2d1125e Merge remote-tracking branch 'origin/main' into rebranch 2024-04-26 16:34:24 -07:00
Steven Wu
facfe45bf5 [Caching] Add fast swift instance setup for cache replay
Add a fast path to create swift CompilerInstance when it is only used to
replay output when there is a cache hit. The normal `setup` function is
very expensive to call, especially in cache mode to setup inputs, and it
needs to be called once per input file from libSwiftScan API due to the
current caching granularity.

The fast path will only construct the part that is needed for output
replay, including the CAS, the output backend and caching diagnostic
processor.

rdar://127062609
2024-04-25 12:36:43 -07:00
swift-ci
7b40588c05 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-23 20:15:56 -07:00
Ben Barham
69fc09f6bd [Frontend] Allow building without host Swift
There's no `swift_ASTGen_destroySourceFile` when we're not building
ASTGen.
2024-04-23 13:45:28 -07:00
swift-ci
1f60795e4d Merge remote-tracking branch 'origin/main' into rebranch 2024-04-22 12:53:37 -07:00
Ellie Shin
3f047102c2 Merge pull request #72937 from apple/elsh/pkg-sil-verify
Add a package serialization bit to Module for SIL verifier in Package CMO mode.
2024-04-22 12:44:28 -07:00
swift-ci
58422d4326 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-18 17:49:48 -07:00
Dave Lee
e57f70bd4d [Debugging] Add DebugDescriptionMacro experimental feature (#73107)
This removes the leading underscore from the macro.
2024-04-18 17:25:44 -07:00
Ellie Shin
45e8454a9e Merge branch 'main' into elsh/pkg-sil-verify 2024-04-17 22:46:55 -07:00