Commit Graph

4590 Commits

Author SHA1 Message Date
Alexis Laferrière
f53be71874 ModuleInterface: Print imports shadowed by a cross-import overlay
In some cases this import may be superfluous as it's also
`@_exported` imported by the overlay. However, when the overlay
is hidden and the import not printed, the import can go entierly
missing.
2024-06-12 10:06:05 -07:00
swift-ci
2b008ffa34 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-11 16:15:18 -07:00
Yuta Saito
8428b36571 Merge pull request #74277 from kateinoigakukun/katei/save-public-autolink-library-interface
[ModuleInterface] Save `-public-autolink-library` module option
2024-06-12 08:08:18 +09:00
swift-ci
43c0f2fe4a Merge remote-tracking branch 'origin/main' into rebranch 2024-06-11 14:35:19 -07:00
Saleem Abdulrasool
dc131ee180 Frontend: share the module cache path with clang
Rather than trying to re-compute the cache path manually for the
default, use the clang provided interface to home the module cache. This
ensures that we do not write the files into a top-level directory on
Windows.
2024-06-11 08:58:53 -07:00
Yuta Saito
6a11171755 [ModuleInterface] Save -public-autolink-library module option
Serialize the `-public-autolink-library <name>` option to the
moduleinterface file because it can affect the LINK_LIBRARY entries in a
swiftmodule file. Without saving the option, the library won't be linked
when a module compiled from the moduleinterface is used.

This change marks the `-public-autolink-library` option as a module
interface option and reads it when building a swiftmodule by module
loader.
2024-06-11 02:22:31 +00:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
swift-ci
aed40bd421 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-05 19:34:38 -07:00
artemcm
d70863501e [Dependency Scanning] Collect and report each module dependency's Link Libraries 2024-06-05 10:59:41 -07:00
swift-ci
f196fa91ec Merge remote-tracking branch 'origin/main' into rebranch 2024-06-03 14:35:06 -07:00
Steven Wu
48237b86f1 Merge pull request #74012 from cachemeifyoucan/eng/PR-128873665
[ScanDependency] Handle `-Xcc` options that affects module generation
2024-06-03 14:33:56 -07:00
swift-ci
563c233c0e Merge remote-tracking branch 'origin/main' into rebranch 2024-06-03 11:15:43 -07:00
Steven Wu
0aa0687fe0 Merge pull request #73853 from cachemeifyoucan/eng/PR-128067152
[ScanDependency][canImport] Improve canImport handling in explicit build
2024-06-03 11:07:02 -07:00
Steven Wu
42732c0073 [ScanDependency] Handle -Xcc options that affects module generation
Make sure the `-Xcc` options to the scanner are correctly considered
when creating ClangImporterCC1 arguments for constructed swift interface
compilation job. Under directcc1 mode, `-Xcc` options should be used to
constructed sub-invocation but should not be added to GenericArgs for
constructing interface compilation jobs.

rdar://128873665
2024-06-03 09:57:10 -07:00
swift-ci
6950a31397 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-03 09:33:41 -07:00
Steven Wu
81c0636dd9 Merge pull request #73822 from cachemeifyoucan/eng/PR-128423393
[Caching] Don't rely on FileSystem when replaying diagnostics
2024-06-03 09:25:35 -07:00
swift-ci
5abac881ad Merge remote-tracking branch 'origin/main' into rebranch 2024-06-02 15:34:45 -07:00
Michael Gottesman
b2808d1d23 Merge pull request #73381 from gottesmm/rdar120420024
[sending] Change CheckedContinuation.resume and Async{Throwing,}Stream.yield to use transferring parameters.
2024-06-02 15:19:40 -07:00
Michael Gottesman
88729b9e34 [sending] Make {Transferring,Sending}ArgsAndResults a LANGUAGE_FEATURE instead of an UPCOMING_FEATURE.
TLDR: This makes it so that we always can parse sending/transferring but changes
the semantic language effects to be keyed on RegionBasedIsolation instead.

----

The key thing that makes this all work is that I changed all of the "special"
semantic changes originally triggered on *ArgsAndResults to now be triggered
based on RegionBasedIsolation being enabled. This makes a lot of sense since we
want these semantic changes specifically to be combined with the checkers that
RegionBasedIsolation turns on. As a result, even though this causes these two
features to always be enabled, we just parse it but we do not use it for
anything semantically.

rdar://128961672
2024-06-01 23:25:16 -07:00
swift-ci
4950da6290 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-01 15:53:49 -07:00
Steven Wu
026fcd24fe [ScanDependency][canImport] Improve canImport handling in explicit build
Teach dependency scanner to report all the module canImport check result
to swift-frontend, so swift-frontend doesn't need to parse swiftmodule
or parse TBD file to determine the versions. This ensures dependency
scanner and swift-frontend will have the same resolution for all
canImport checks.

This also fixes two related issues:
* Previously, in order to get consistant results between scanner and
  frontend, scanner will request building the module in canImport check
  even it is not imported later. This slightly alters the definition of
  the canImport to only succeed when the module can be found AND be
  built. This also can affect the auto-link in such cases.
* For caching build, the location of the clang module is abstracted away
  so swift-frontend cannot locate the TBD file to resolve
  underlyingVersion.

rdar://128067152
2024-05-31 15:36:55 -07:00
Steven Wu
c132f74c3c [Caching] Don't rely on FileSystem when replaying diagnostics
Stop relying on file system to provide source buffer for diagnostics
when replying. This avoids initializing CASFS which is quite expensive.
Now cached diagnostics contains CASID for the file buffer so it can
initialize its own source manager without relying on the underlying file
system.

rdar://128423393
2024-05-31 14:51:26 -07:00
Pavel Yaskevich
b5b4cba038 [Frontend] Swift 6: Enable checked continuations when suspending for an async ObjC calls
Enables `-checked-async-objc-bridging` flag by default starting
from swift 6 language mode to provide enhanced debugging and
runtime checking for the correct usage of continuations passed
in a call to ObjC from Swift.
2024-05-31 13:05:11 -07:00
swift-ci
63205ba9a2 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-30 09:54:36 -07:00
Rauhul Varma
9a280613c3 Merge pull request #73963 from apple/cxx-swift-symbolgraph-extract
[SymbolGraphGen] Handle cxx module imports in swift-symbolgraph-extract
2024-05-30 09:48:57 -07:00
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