Commit Graph

6730 Commits

Author SHA1 Message Date
Slava Pestov
aae77c16bb Merge pull request #86412 from slavapestov/shrink-smallvectors
Shrink obscenely large SmallVectors
2026-01-09 20:15:36 -05:00
Tim Kientzle
adec1f6cbe Merge pull request #86277 from tbkka/tbkka-rdar149303951-try1
[SE-0474] Implement final `yielding borrow`/`yielding mutate` naming for coroutine accessors
2026-01-09 08:52:21 -08:00
Slava Pestov
fa337cc10c IDE: Fix Fix obscenely large SmallVectors 2026-01-09 09:31:42 -05:00
Steven Wu
a9aa57ee0b Reapply "[DependencyScan] Correct setup clang VFS for dependency scanning"
This reverts commit e60ae24052 and fix
non-deterministic failures introduced by the commit.

Fix two issues when attempting to testing parallel scanning using
`swift-scan-test` tools:
* Make sure the BumpPtrAllocator in ScanningService is thread-safe so
  there are no race condition when a new slab is allocated.
* Make sure the output of `swift-scan-test` only written from one
  thread. This prevents some race conditions when writing to the same
  raw_fd_ostream.

rdar://167760262
2026-01-08 14:14:22 -08:00
Steven Wu
e60ae24052 Revert "[DependencyScan] Correct setup clang VFS for dependency scanning"
This reverts commit e0e69f7ac0. This
causes flaky tests ScanDependencies/scanner_api_working_dir.swift.

rdar://167742034
2026-01-08 08:14:23 -08:00
Steven Wu
e0e69f7ac0 [DependencyScan] Correct setup clang VFS for dependency scanning
Currently, dependency scanner is not reporting the redirecting files
that are baked inside swift-frontend for platform support. This causes
dependency scanner returns virtual path for those files, and
swift-driver/build-system will not be able to correct validate the files
on incremental build, causing incremental build to be almost clean
builds.

This behavior issue is caused by the dependency scanning file system
layer inside clang dependency scanner that caches stats. If the
redirecting files are created underneath the layer, the real path is
lost. This fixes the issue by moving the redirecting files above the
caching layer using `-ivfsoverlay` option.

In addition to that, this commit also unifies how clang importer and
clang dependency scanner initiate the VFS, making the logic much
simpler.
2026-01-07 10:00:25 -08:00
Tim Kientzle
8eabeeb8ca [SE-0474] Read2/Modify2 => YieldingBorrow/YieldingMutate
This updates a large number of internal symbols, function names,
and types to match the final approved terminology.  Matching the
surface language terminology and the compiler internals should
make the code easier for people to understand into the future.
2026-01-03 16:05:12 -08:00
Saleem Abdulrasool
54f5837c7b swift-scan-test: adjust frontend detection for Windows
Ensure that we account for file system arc separators and extensions by
using the LLVM functions rather than trying to simply do string
matching. This allows us to properly handle inputs on Windows.
2025-12-11 15:29:56 -08:00
Hamish Knight
f0d4572a92 [SourceKit] Always check buffer in SemanticAnnotator
Make sure we don't ever try to record semantic tokens for a different
buffer. This works around an ASTWalker issue where it will walk macro
expanded bodies even in non-macro-expansion mode.

rdar://165420658
2025-12-10 17:41:00 +00:00
Egor Zhdan
69be33d3ba [cxx-interop] Remove compatibility versions
This removes the C++ interop compat version mechanism. It was added in mid-2023 and was never used. It complicates the testing story, and makes it harder to reason about the compiler's behavior. It also isn't compatible with explicit module builds.

The flag `-cxx-interoperability-mode` is preserved, so projects that use the flag will continue to build normally.

rdar://165919353
2025-12-05 18:01:09 +00:00
Anthony Latsis
345c601626 Address some overload deprecations in llvm::support::endian
See:
* https://github.com/llvm/llvm-project/pull/161045
* https://github.com/llvm/llvm-project/pull/160979
2025-12-01 11:19:25 +00:00
Ben Barham
632233003d [SourceKit] Remove flakey test assertion
Exactly when this happens is still somewhat of a mystery, but given we
allow annotations in either response, it doesn't seem worth asserting
over.

Resolves rdar://139356981.
2025-11-21 13:13:08 +10:00
Slava Pestov
819738c83e AST: Rename mapTypeIntoContext() => mapTypeIntoEnvironment(), mapTypeOutOfContext() => mapTypeOutOfEnvironment() 2025-11-12 14:48:19 -05:00
Anthony Latsis
bda6edb85c AST: Rename GenericContext::isGeneric to hasGenericParamList
`isGeneric` is a misleading name because this method checks for the
existence of a `GenericParamList`, which is not implied by genericity.
2025-11-11 15:55:16 +00:00
Alex Hoppen
893340d4f6 Merge pull request #85175 from ahoppen/swift-access-level
[Index] Record the access level of declarations in the index
2025-11-04 16:38:38 +01:00
Alex Hoppen
aa9c295ad5 [Index] Record the access level of declarations in the index
rdar://163256878
2025-10-30 14:36:29 +01:00
Becca Royal-Gordon
393965090e Merge pull request #34556 from beccadax/mod-squad-2
[SE-0491] Implement lookup and diagnostics for module selectors (MyMod::someName)
2025-10-28 16:00:26 -07:00
Allan Shortlidge
92227ad1cf AST: Introduce the Swift, anyAppleOS, and DriverKit platform kinds.
This change just stages in a few new platform kinds, without fully adding
support for them yet.

- The `Swift` platform represents availability of the Swift runtime across all
  platforms that support an ABI stable Swift runtime (see the pitch at
  https://forums.swift.org/t/pitch-swift-runtime-availability/82742).
- The `anyAppleOS` platform is an experimental platform that represents all of
  Apple's operating systems. This is intended to simplify writing availability
  for Apple's platforms by taking advantage of the new unified OS versioning
  system announced at WWDC 2025.
- The `DriverKit` platform corresponds to Apple DriverKit which is already
  supported by LLVM.
2025-10-27 19:15:04 -07:00
Becca Royal-Gordon
ffaa35810c Handle lookup into Builtin with module selector
Lookups like Builtin::Int64 were failing because BuiltinUnit rejected all unqualified lookups. Make it allow unqualified lookups with a module selector.
2025-10-24 16:23:48 -07:00
Hamish Knight
6f1417135b [SourceKit] Fix handling of @abi in AnnotatingPrinter
Make sure we avoid adding these to the entity stack entirely, which
avoids hitting the assertion that a top-level entity isn't encountered
with a non-empty stack.
2025-10-23 09:11:17 +01:00
Mads Odgaard
c92e5b47f3 Merge pull request #84574 from madsodgaard/android-availability 2025-10-20 10:40:37 +09:00
Henrik G. Olsson
328e07ac91 address comments, add copyright header 2025-10-17 15:13:59 -07:00
Henrik G. Olsson
ce806415c9 Remove swift-function-caller-generator's dependency on Foundation
Building Foundation seems to be optional in the Linux build script,
which makes it tricky to link against outside of Darwin platforms. This
removes the dependency on Foundation and calls libc for I/O instead.
2025-10-17 15:13:58 -07:00
Henrik G. Olsson
de49d687b0 add swift-function-caller-generator
This helper utility takes a module interface as input, and emits a Swift
file importing the module and calling every function in the module. It's
intended for testing of safe interop wrappers to make sure they go
through the entire pipeline of the compiler instead of succumbing to
laziness.
2025-10-17 15:13:55 -07:00
Mike Ash
3869cb50ea Fix integer type mismatches in swift-inspect when building 32-bit. 2025-10-07 14:00:01 -04:00
Egor Zhdan
62d388a09f Merge pull request #84435 from egorzhdan/egorzhdan/do-not-generate-interface-twice
[cxx-interop] Avoid trying to generate module interfaces twice
2025-10-07 17:50:11 +01:00
swift-ci
499f4ff714 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-29 06:15:20 -07:00
Hamish Knight
a7dd04ed6f Merge pull request #84403 from a7medev/refactor/signature-help-to-ide
[IDE] Move signature help formatting to IDE instead of SourceKit
2025-09-29 14:05:02 +01:00
swift-ci
d5a03fa0e4 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-26 22:36:42 -07:00
eeckstein
a1e5a06c9e Merge pull request #84530 from eeckstein/remove-enable-oss-module-option
Remove the `-enable-ossa-modules` option
2025-09-27 07:35:40 +02:00
swift-ci
fbd33fac59 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-26 16:54:04 -07:00
Mike Ash
3f610e94a3 Merge pull request #84446 from mikeash/swift-inspect-scan-search
[swift-inspect] Add a mode to search for and dump generic metadata without metadata iteration enabled.
2025-09-26 19:46:00 -04:00
Ahmed Mahmoud
456a40a7bb [Test] Improve signature help tests 2025-09-26 22:39:46 +03:00
Mike Ash
513f5fb17a [swift-inspect] Add a mode to search for and dump generic metadata without metadata iteration enabled.
We scan the target's initial allocation pool, and all 16kB heap allocations. We check each pointer-aligned offset within those areas, and try to read it as Swift metadata and get a name from it. If that fails, quietly move on. It's very unlikely for some random memory to look enough like Swift metadata for this to produce a name, so this works very well to print the generic metadata instantiated in the remote process without requiring `SWIFT_DEBUG_ENABLE_METADATA_ALLOCATION_ITERATION`.

rdar://161120936
2025-09-26 10:52:35 -04:00
Erik Eckstein
2f124cf564 Remove the -enable-ossa-modules option.
OSSA modules are enabled by default.
The compiler still accepts this option but it has no effect.
2025-09-26 08:01:08 +02:00
swift-ci
06fb7384ce Merge remote-tracking branch 'origin/main' into rebranch 2025-09-23 03:14:56 -07:00
Egor Zhdan
a610bcd752 [cxx-interop] Avoid trying to generate module interfaces twice
This reverts most of 72050c5385, which led to decreased performance of jump-to-definition.

Instead of re-attempting to generate a module interface with C++ interop enabled, Swift should rely on the IDE to pass the correct `-cxx-interoperability-mode=` value to SourceKit.

rdar://149061322
2025-09-22 18:48:20 +01:00
Hamish Knight
0a55516cf7 Use PrintOptions::forDebugging in a few more places
Use for a few `dump` methods, generic signature debugging, and enable
by default for swift-ide-test.
2025-09-21 23:19:06 +01:00
Hamish Knight
14a125c2ca [IDE] Use consistent PrintOptions in swift-ide-test
Use the same set of PrintOptions when printing the results for
different requests.
2025-09-21 23:19:06 +01:00
swift-ci
ce0f17aeac Merge remote-tracking branch 'origin/main' into rebranch 2025-09-19 21:35:40 -07:00
Henrik G. Olsson
7fcc72f108 Merge pull request #81859 from swiftlang/swiftify-inherit-imports
[MacrosOnImports][Swiftify] Copy module imports from clang node's module to its Swift macro SourceFile
2025-09-19 21:21:09 -07:00
Ahmed Mahmoud
236fed20aa [Test] Remove redundant signature parameter name="" in swift-ide-test 2025-09-19 21:03:05 +03:00
Ahmed Mahmoud
85bf842939 [Test] Add signature help to swift-ide-test 2025-09-19 21:02:59 +03:00
swift-ci
3a31109821 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-19 10:35:08 -07:00
Ahmed Mahmoud
2f6064675e [IDE] Move signature help formatting to IDE instead of SourceKit 2025-09-19 18:24:57 +03:00
Anthony Latsis
ea5d89d0d0 tools: Set Swift bug report message in some executable targets
If these programs crash, we want them to print the Swift bug report
message, not the default LLVM one, which leads to
https://github.com/llvm/llvm-project/issues.

While here, hoist the setting of the bug report message to the
START_PROGRAM macro so that we don't forget to set it in the future.
2025-09-19 12:05:31 +01:00
Henrik G. Olsson
909908d3d8 [IDE] Support combining --print-module-imports w/ --module-print-hidden
This prints all imports instead of just exported imports, for testing
purposes.
2025-09-16 21:10:02 -07:00
swift-ci
0d2c4ca9be Merge remote-tracking branch 'origin/main' into rebranch 2025-09-15 10:29:21 -07:00
Meghana Gupta
c764244df0 Merge pull request #84180 from meg-gupta/borrowandmutatepr
Add preliminary support for borrow accessors
2025-09-15 10:01:15 -07:00
swift-ci
4c7c8c2e22 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-15 06:58:07 -07:00