Commit Graph

6605 Commits

Author SHA1 Message Date
swift-ci
7b5298cd01 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-02 03:15:34 -07:00
Hamish Knight
9f7262e3d7 Merge pull request #73361 from hamishknight/uncache
[SourceKit] Remove cached AST by default on close
2024-05-02 11:14:53 +01:00
swift-ci
c8d364261c Merge remote-tracking branch 'origin/main' into rebranch 2024-05-01 16:55:47 -07:00
Slava Pestov
fda93680df Merge pull request #73363 from slavapestov/pack-expansion-closures-part-2
Extract common code for building opened existential and element signatures
2024-05-01 19:44:05 -04:00
Rintaro Ishizaki
26dbe2f8a1 [Macros] Use 'LibraryPluginProvider' in swift-plugin-server
Move 'PluginProvider' logic to 'SwiftLibraryPluginProvider' module
so the compiler can reuse that logic for the actual in-process plugins.
2024-05-01 16:41:14 -07:00
Slava Pestov
3b2a6d8c1a SourceKit: Use getNextDepth()/getMaxDepth() 2024-05-01 12:09:01 -04:00
Hamish Knight
e710b50255 [SourceKit] Remove cached AST by default on close
This isn't actually used for anything currently,
future requests will always have mismatching
stamps. As such, remove for now.

rdar://127353509
2024-05-01 12:24:13 +01:00
swift-ci
22d81cbbd2 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-01 04:14:10 -07:00
Hamish Knight
7da91bdf79 Merge pull request #73323 from hamishknight/cancel-on-close
[SourceKit] Cancel in-flight builds on `editor.close`
2024-05-01 12:07:34 +01:00
Hamish Knight
de9806e2fa [SourceKit] Introduce key for cancelling on close
Defaults to `true`.
2024-04-30 21:13:20 +01:00
swift-ci
3114640ebc Merge remote-tracking branch 'origin/main' into rebranch 2024-04-30 12:55:53 -07:00
Dave Lee
c3488c60e1 Demangler: Add option to omit closure signatures (#73331)
Add a new demangler option which excludes a closure's type signature.

This will be used in lldb.

Closures are not subject to overloading, and so the signature will never be used to 
disambiguate. A demangled closure is uniquely identifiable by its index(s) and parent.

Where opaque types are involved, the concrete type signature can be quite complex. This 
demangling option allows callers to avoid printing the underlying complex nested 
concrete types.

Example:

before: `closure #1 (Swift.Int) -> () in closure #1 (Swift.Int) -> () in main`
after: `closure #1 in closure #1 in main`
2024-04-30 12:48:02 -07:00
Hamish Knight
69f2e26d35 [SourceKit] Cancel in-flight builds on editor.close
When closing a document, cancel any in-flight
builds happening for it.

rdar://127126348
2024-04-30 12:00:27 +01:00
Hamish Knight
572fc4eae0 [SourceKit] Ensure ASTCache is guarded by mutex
There were a couple of accesses not guarded by
`CacheMtx`, introduce a couple of methods that
guard them, renaming `getASTProducer` while here.

Also make sure we don't ever insert a producer
after it has been purposefully removed by e.g a
close that removes the cached AST.
2024-04-30 12:00:27 +01:00
swift-ci
c283c8f833 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-30 00:15:17 -07:00
eeckstein
74ed041119 Merge pull request #73247 from eeckstein/windows-enable-swift
Enable SwiftCompilerSources on Windows
2024-04-30 09:04:55 +02:00
swift-ci
c9ff828f07 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-29 09:15:24 -07:00
Rintaro Ishizaki
f7c9966420 Merge pull request #72999 from rintaro/macros-pluginjson
[Macros] Use SwiftCompilerPluginMessageHandling JSON encoder/decoder
2024-04-29 08:57:57 -07:00
swift-ci
8743aa2219 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-29 07:54:44 -07:00
Eric Miotto
8c3aba3ced Merge pull request #73303 from edymtt/edymtt/amend-search-path-for-swift-content-from-darwin-toolchain
CMake: amend search path for Swift content from Darwin toolchain
2024-04-29 07:44:13 -07:00
Alastair Houghton
7698836ecc [Test][SourceKit] Use the *builder*'s swiftrt.o when in hosttools.
We were linking with the newly built `swiftrt.o` when in hosttools mode,
which is wrong because the newly built `swiftrt.o` does not match the
compiler we were using for the `SwiftCompilerSources`.

This manifests as a failure in

  `SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift`

because `self is ForwardingInstruction` fails as we can't find the
protocol conformance records.

rdar://123504095
2024-04-29 10:48:23 +01:00
eeckstein
e9d6ba9154 cmake: enable SwiftCompilerSources on Windows 2024-04-29 10:52:24 +02:00
swift-ci
8aa2d1125e Merge remote-tracking branch 'origin/main' into rebranch 2024-04-26 16:34:24 -07:00
Steven Wu
6c5ab241c8 Merge pull request #73265 from cachemeifyoucan/eng/PR-127062609
[Caching] Add fast swift instance setup for cache replay
2024-04-26 16:32:11 -07:00
Eric Miotto
291065d3b1 CMake: amend search path for Swift content from Darwin toolchain
Additional testing showed that the path I initially choose does not work
in all scenarios.

Expands on #73255
Still addresses rdar://127014753
2024-04-26 15:12:24 -07:00
swift-ci
9437f51fce Merge remote-tracking branch 'origin/main' into rebranch 2024-04-26 07:54:41 -07:00
Rintaro Ishizaki
1125828f9d [swift-plugin-server] Use StandardIOMessageConnection 2024-04-25 14:43:46 -07:00
Rintaro Ishizaki
cd54cc1c31 [Macros] Use SwiftCompilerPluginMessageHandling JSON encoder/decoder
Replacing swiftLLVMSJON with SwiftCompilerPluginMessageHandling.JSON
2024-04-25 14:42:20 -07:00
Ben Barham
445ee1ec14 Manually merge rebranch into main
Conflicts:
  - `lib/ClangImporter/ImportDecl.cpp` as `isPure` is now
    `isPureVirtual`
2024-04-25 13:48:57 -07:00
Eric Miotto
5f545b43f9 CMake: add option to link Swift content from Darwin toolchain
This is needed in specific Apple internal configurations -- as a result
of the limited applicability, this option is not exposed through
`build-script` on purpose.

Addresses rdar://127014753
2024-04-25 12:48:50 -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
Rintaro Ishizaki
ae149276ac Merge pull request #69240 from rintaro/macros-message-listener
[Macros] Update for CompilerPluginMessageListener
2024-04-25 00:20:03 -07: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
01d891ad99 Merge pull request #72834 from artemcm/UpstreamVisionOS
Introduce visionOS Platform
2024-04-15 09:33:49 -07:00
swift-ci
63cc776667 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-12 18:35:57 -07:00
Rintaro Ishizaki
895ac3ef96 Merge pull request #71513 from rintaro/astgen-pluginmessage-spi 2024-04-12 18:33:23 -07:00
swift-ci
5b6eadf416 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-12 13:37:42 -07:00
Rintaro Ishizaki
ae3a169338 [ASTGen] Update for SPI in swift-syntax
All symbols in `SwiftCompilerPluginMessageHandling` are now SPI.
2024-04-12 12:08:00 -07:00
Victor Toni
710b1a6f98 Fix typos 2024-04-10 23:50:36 +02: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
a9077d7129 FileEntry to FileEntryRef updates 2024-04-08 08:58:58 -07:00
Ben Barham
440421bcc5 Rename ThreadPool to StdThreadPool
`ThreadPool` was split up in LLVM
6594f428de91e333c1cbea4f55e79b18d31024c4.
2024-04-08 08:58:58 -07:00
Ben Barham
cacfd3e3ae Rename llvm::support::endianness to llvm::endianness
LLVM is gearing up to move to `std::endianness` and as part of that has
moved `llvm::support::endianness` to `llvm::endianness`
(bbdbcd83e6702f314d147a680247058a899ba261). Rename our uses.
2024-04-08 08:58:58 -07:00
Ben Barham
acd0efa67f Migrate to common OptTable macros
`OptTable` was a source of consistent churn due to new arguments to the
`OPTION` macro. LLVM 3f092f37b7362447cbb13f5502dae4bdd5762afd extracted
the handling of the common option parts (eg. an ID and an info) out into
separate macros to reduce this - use those here (since unsurprisingly,
more arguments were added).
2024-04-08 08:58:58 -07:00
Ben Barham
1fdda023b3 Rename StringRef::endswith references to StringRef::ends_with
Missed this when doing the `startswith` renaming. `endswith` has also
been deprecated upstream (and presumably soon to be removed).
2024-04-01 10:59:16 -07:00
Artem Chikin
d9c00d8dd6 Merge pull request #72668 from artemcm/DepScanBinaryModuleHeaderDepModuleDeps
[Explicit Module Builds] Only specify '-fmodule-map-file' for bridging header Clang module dependencies
2024-03-29 09:02:10 -07:00
Artem Chikin
f3816e0335 [Explicit Module Builds] Only specify '-fmodule-map-file' for bridging header Clang module dependencies
Relying on the corresponding field in the '-explicit-swift-module-map-file' provided by the driver.

Only bridging headers require a module map because that's what aids header include resolution. With lazy module loading today, '.modulemap' parsing which happens when instantiating Clang is responsible for associating headers with modules. Then upon encountering a header include inside the bridging header the compiler knows which module corresponds to said header and is then able to load explicitly-provided PCM for that module. For all other module dependencies, they are only ever queried by-name from Swift, so '.modulemap' parsing is not necessary.
2024-03-28 13:47:13 -07:00
Artem Chikin
3947fa9e16 [Dependency Scanning] Add libSwiftScan entrypoint to query binary module dependencies' header inputs' module dependencies 2024-03-28 11:06:55 -07:00
Rintaro Ishizaki
7b3738d1d0 [SourceKit] Adjust newlines between decls
Previously, Clang modules didn't have empty lines between top-level
decls. This was inconsistent with Swift module.
2024-03-25 22:07:50 +09:00
Rintaro Ishizaki
b019fd0c1b Merge pull request #72420 from rintaro/sourcekit-clang-printer-rdar93731287
[SourceKit] Stop printing normal comments in clang generated interface
2024-03-25 17:29:45 +09:00