Commit Graph

259 Commits

Author SHA1 Message Date
swift-ci
8d761539c9 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-16 16:54:22 -07:00
finagolfin
8fe0fd1781 Update list of Swift runtime libraries to be de-duplicated, so the autolink-extract tool doesn't repeat them over and over again (#76224) 2024-09-16 16:36:05 -07:00
Ben Barham
a7b50f357f Merge remote-tracking branch 'origin/main' into manual-main-merge
Conflicts:
  - `lib/Driver/ToolChains.cpp` conflicting with the `addAllArgs` rename
    for multiple options
2024-09-16 13:53:18 -07:00
Kavon Farvardin
ba0aac3f39 Merge pull request #76093 from kavon/coldsplit-2
ColdBlockInfo: overhaul analysis pass
2024-09-12 16:06:07 -07:00
Dmitrii Galimzianov
a8b71ea97f Add -print-diagnostic-groups flag
This change adds the `-print-diagnostic-groups` flag as described by SE-0443.
2024-09-11 13:34:42 +02:00
Kavon Farvardin
7203a4fa73 ColdBlockInfo: overhaul analysis pass
The old analysis pass doesn't take into account profile data, nor does
it consider post-dominance. It primarily dealt with _fastPath/_slowPath.

A block that is dominated by a cold block is itself cold. That's true
whether it's forwards or backwards dominance.

We can also consider a call to any `Never` returning function as a
cold-exit, though the block(s) leading up to that call may be executed
frequently because of concurrency. For now, I'm ignoring the concurrency
case and assuming it's cold. To make use of this "no return" prediction,
use the `-enable-noreturn-prediction` flag, which is currently off by
default.
2024-09-03 15:41:10 -07:00
swift-ci
b435447b06 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 09:14:11 -07:00
Jeremy Schonfeld
c069bd63dc Add new Foundation libraries to SwiftRuntimeLibsOrdered (#76019) 2024-09-03 09:07:03 -07:00
Ben Barham
467e528200 Merge remote-tracking branch 'origin/main' into manual-rebranch-merge
Conflicts:
  - `lib/Serialization/ModuleFormat.h` bumped version to account for
    differences between main and rebranch.
2024-08-09 15:22:39 -07:00
Kavon Farvardin
d373f6f604 NFC: throws prediction frontend flag 2024-08-08 11:18:22 -04:00
swift-ci
1c725e6fc1 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-26 10:35:19 -07:00
Nate Chandler
a7c6538d4e Revert "Merge pull request #73275 from nate-chandler/lifetime-completion/enable"
This reverts commit 840198ec9b, reversing
changes made to b74303c214.
2024-07-26 07:12:45 -07:00
swift-ci
24381eddc3 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-25 12:33:16 -07:00
Nate Chandler
bff6c743a9 [LifetimeCompletion] Enable.
Complete all lifetimes during SILGenCleanup.
2024-07-24 17:56:31 -07:00
swift-ci
cd01941fbb Merge remote-tracking branch 'origin/main' into rebranch 2024-07-01 01:35:37 -07:00
Hamish Knight
02a8f24406 Merge pull request #74797 from hamishknight/respect-sigint 2024-07-01 09:27:25 +01:00
swift-ci
f2e68e5db1 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-28 11:36:11 -07:00
Ben Barham
d8f381e660 Merge pull request #74804 from bnbarham/rename-equals
Update `StringRef::equals` references to `operator==`
2024-06-28 11:22:20 -07:00
swift-ci
4fb3c4e0d2 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-28 00:35:37 -07:00
Ben Barham
d72f5b12c4 Update StringRef::equals references to operator==
`equals` has been deprecated upstream, use `operator==` instead.
2024-06-27 19:14:06 -07:00
Allan Shortlidge
470baff865 Driver: Remove swift-api-extract.
Now that API descriptions are emitted during module build jobs when
`-emit-api-descriptor-path` is specified and the build system has been updated
to pass that flag when the output is needed, the `swift-api-extract` frontend
alias is no longer used. Delete it and the tests that were specific to invoking
`swift-api-extract`.

Resolves rdar://116537394.
2024-06-27 17:05:32 -07:00
Ben Barham
b7954411ec Merge remote-tracking branch 'origin/main' into manually-merge-main-to-rebranch
Conflicts:
  - `include/swift/AST/PluginRegistry.h`
2024-06-27 14:56:11 -07:00
Hamish Knight
3910c87113 [Frontend] Respect SIGINT
Make sure we set the default handler for `SIGINT`
before LLVM sets its own handler for it. This
ensures we terminate on receiving SIGINT.
2024-06-27 21:44:07 +01:00
Rintaro Ishizaki
5ebd715a2a Merge pull request #73725 from rintaro/macros-inproc-plugin
[Macros] In-process plugin server
2024-06-26 06:33:38 -07:00
Xi Ge
736ccef626 Merge remote-tracking branch 'apple/main' into rebranch 2024-06-20 15:16:55 -07:00
Tim Kientzle
598e5104ef Merge pull request #74184 from tbkka/tbkka-assertions2
Add `#include "swift/Basic/Assertions.h"` to a lot of source files
2024-06-20 12:13:28 -07:00
swift-ci
aa03394c53 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-20 10:35:23 -07:00
Holly Borla
de78fd4da5 [Concurrency] Remove the disable-region-based-isolation-with-strict-concurrency
flag.
2024-06-19 20:57:25 -07:00
Rintaro Ishizaki
2f7aa428db [Macros] In-process plugin server
Separate swift-syntax libs for the compiler and for the library plugins.
Compiler communicates with library plugins using serialized messages
just like executable plugins.

* `lib/swift/host/compiler/lib_Compiler*.dylib`(`lib/CompilerSwiftSyntax`):
  swift-syntax libraries for compiler. Library evolution is disabled.
* Compiler (`ASTGen` and `swiftIDEUtilsBridging`) only depends on
  `lib/swift/host/compiler` libraries.
* `SwiftInProcPluginServer`: In-process plugin server shared library.
  This has one `swift_inproc_plugins_handle_message` entry point that
  receives a message and return the response.
* In the compiler
  * Add `-in-process-plugin-server-path` front-end option, which specifies
    the `SwiftInProcPluginServer` shared library path.
  * Remove `LoadedLibraryPlugin`, because all library plugins are managed
    by `SwiftInProcPluginServer`
  * Introduce abstract `CompilerPlugin` class that has 2 subclasses:
    * `LoadedExecutablePlugin` existing class that represents an
      executable plugin
    * `InProcessPlugins` wraps `dlopen`ed `SwiftInProcPluginServer`
  * Unified the code path in `TypeCheckMacros.cpp` and `ASTGen`, the
    difference between executable plugins and library plugins are now
    abstracted by `CompilerPlugin`
2024-06-17 11:36:52 -07: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
5abac881ad Merge remote-tracking branch 'origin/main' into rebranch 2024-06-02 15:34:45 -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
63205ba9a2 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-30 09:54:36 -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
b20fedebc6 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-18 02:54:31 -07: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
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
swift-ci
c2e6e9f6e7 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-06 09:14:45 -07:00
Yuta Saito
d3ae633857 modulewrap: Disable ObjC interop by default on non-Darwin platforms
0a5653dbaf started to call
`IGM.finalize()`, which leads the Clang instance to emit ObjC metadata
sections when the ObjC interop is enabled. Emitting ObjC metadata
sections is not well supported on non-Darwin platforms and causes
crashes for WebAssembly and COFF object formats[^1].

modulewrap tool did not configure the ObjC interop option, so it always
enabled the ObjC interop. This patch aligns the default ObjC interop
value with other tools by disabling it on non-Darwin platforms.

[^1]: https://github.com/apple/llvm-project/blob/stable/20230725/clang/lib/CodeGen/CGObjCMac.cpp#L5068-L5074
2024-05-04 15:16:57 +00:00
swift-ci
16e1dca0ff Merge remote-tracking branch 'origin/main' into rebranch 2024-05-02 07:54:19 -07:00
Daniel Grumberg
cffb637f2d Merge pull request #73080 from daniel-grumberg/export-import-sgf-extract
[SymbolGraphGen] Correctly handle exported imports in swift-symbolgraph-extract
2024-05-02 15:39:26 +01:00
swift-ci
6091794850 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-29 22:14:20 -07:00
Michael Gottesman
1eacf03969 [sil-opt] Tighten up how we handle strict concurrency and upcoming features so we match swift-frontend.
Specifically:

1. I added the "upcoming feature already enabled in this swift-version"
diagnostic.

2. I taught sil-opt that in swift-6 mode strict concurrency is enabled by
default.
2024-04-29 18:43:57 -07:00
Michael Gottesman
a29acccf08 [sil-opt] Add the ability to specify a swift-version.
I implemented this by adding a new option called swift-version. If not set, we
just leave LangOpts.EffectiveLanguageVersion alone and get whatever that default
behavior is. If it is set, we use the same version parsing infrastructure used
by the normal frontend. If the parse fails, we exit -1.

To write the test that I wanted to write to show this behavior, I also needed to
add support to sil-opt for verify-additional-prefixes which is just useful
goodness.
2024-04-29 18:43:57 -07:00
swift-ci
9166bfa695 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-29 18:14:42 -07:00
Michael Gottesman
4fb8a20cb7 [sil-opt] Hard exit(-1) instead of finishDiagProcessing when failing to setup a compiler invocation.
Running finishDiagProcessing and potentially silently exiting when -verify is
set is the correct behavior for failures later in sil-opt when running Sema or
when running SIL passes. This is incorrect behavior when just setting up the
compiler instance since in such a case, we want to hard exit -1 since this means
that a test has not properly setup the compiler instance itself. It is better to
hard fail and have the test maintainer just update its command line arguments as
appropriate.
2024-04-29 12:20:46 -07:00
Daniel Grumberg
f0bbbda90e Add option to provide an allow list of reexported modules for swift-symbolgraph-extract 2024-04-18 16:19:28 +01:00
Nate Chandler
c43f87101f Merge branch 'main' into rebranch
Conflicts:
      lib/Basic/Platform.cpp

```
diff --git a/lib/Basic/Platform.cpp b/lib/Basic/Platform.cpp
index 240edfa144a..1797c87635f 100644
--- a/lib/Basic/Platform.cpp
+++ b/lib/Basic/Platform.cpp
@@ -200,10 +200,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
   case llvm::Triple::CUDA:
   case llvm::Triple::DragonFly:
   case llvm::Triple::DriverKit:
-<<<<<<< HEAD
   case llvm::Triple::ELFIAMCU:
-=======
->>>>>>> main
   case llvm::Triple::Emscripten:
   case llvm::Triple::Fuchsia:
   case llvm::Triple::HermitCore:
```
2024-04-17 13:32:48 -07:00
Artem Chikin
1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00
Ben Barham
0f52071c22 Fix up various references to renamed/moved enums
A bunch of enums were moved to enum classes and slightly renamed. Fix up
their references.
2024-04-08 08:58:58 -07:00