Commit Graph

161142 Commits

Author SHA1 Message Date
Rintaro Ishizaki
47f18d492e [ASTGen] Move regex literal parsing from SwiftCompilerSources to ASTGen
ASTGen always builds with the host Swift compiler, without requiring
bootstrapping, and is enabled in more places. Move the regex literal
parsing logic there so it is enabled in more host environments, and
makes use of CMake's Swift support. Enable all of the regex literal
tests when ASTGen is built, to ensure everything is working.

Remove the "AST" and "Parse" Swift modules from SwiftCompilerSources,
because they are no longer needed.
2023-11-16 10:59:23 -08:00
Rintaro Ishizaki
23effda44d Merge pull request #69877 from rintaro/parser-isforastgen
[Parse] Unguard Parser.IsForASTGen for SWIFT_BUILD_SWIFT_SYNTAX
2023-11-15 10:47:39 -08:00
Rintaro Ishizaki
553e55fcfa Merge pull request #69876 from rintaro/astgen-generate-label
[ASTGen] Give argument labels to all generate(_:) functions
2023-11-15 10:47:26 -08:00
Saleem Abdulrasool
7688cd9c29 Merge pull request #69865 from compnerd/macro-installs
macros: install the runtime component for Windows
2023-11-15 09:22:18 -08:00
Adrian Prantl
71bbe17dc2 Merge pull request #69679 from adrian-prantl/precise-compiler-invocation
Extend the LLDB test matrix to support precise compiler invocations.
2023-11-15 08:46:06 -08:00
Egor Zhdan
dc43a44fa8 Merge pull request #69862 from apple/egorzhdan/re-disable-test
Revert "Revert "[cxx-interop] Partially disable a test on Linux""
2023-11-15 17:09:34 +01:00
nate-chandler
b944ab877a Merge pull request #69857 from nate-chandler/nfc/20231114/1/delete-dead-lowered-value-kind
[IRGen] NFC: Deleted dead LoweredValue kind.
2023-11-15 07:38:26 -08:00
Choo Hyun Ho
36e01c23ae stdlib/Concurrency/PartialAsyncTask.swift: Correct typos (#69880) 2023-11-15 07:01:57 -08:00
Konrad `ktoso` Malawski
7636866af1 Merge pull request #69874 from ktoso/wip-another-getRequiredProtocols-fix
[Distributed] Another fix for getting required protocols for SR
2023-11-15 22:16:38 +09:00
Ellie Shin
e8d43434db Merge pull request #69733 from apple/es-pkg-intf
Introduce a package interface
2023-11-15 03:53:49 -08:00
Alastair Houghton
b693cce3b8 Merge pull request #69859 from al45tair/eng/PR-118402226
[Backtracing] Fix ARM64e build failure.
2023-11-15 11:14:13 +00:00
Hamish Knight
6298d24781 Merge pull request #69782 from hamishknight/hash-it-out 2023-11-15 11:08:19 +00:00
nate-chandler
96ee4ebbd8 Merge pull request #69871 from nate-chandler/rdar118134637
[Test] Avoid LSAN report of leaked FunctionTest.
2023-11-15 01:27:11 -08:00
Ellie Shin
82eef756ee Guard with env var SWIFT_ENABLE_PACKAGE_INTERFACE_LOAD
Update tests and formatting
2023-11-15 01:16:23 -08:00
eeckstein
c768d36b14 Merge pull request #69847 from eeckstein/fix-simplify-begin-borrow
SimplifyBeginBorrow: don't remove begin_borrow instructions which have the `[point_escape]` flag set.
2023-11-15 08:30:14 +01:00
Rintaro Ishizaki
e5472ad21e [Parse] Unguard Parser.IsForASTGen for SWIFT_BUILD_SWIFT_SYNTAX
Changing a field depending on `-D` was not a good idea.
2023-11-14 20:07:29 -08:00
Rintaro Ishizaki
07a432d2a5 [ASTGen] Soft deprecate generate(choices:) 2023-11-14 19:49:10 -08:00
Rintaro Ishizaki
5fdeabd045 [ASTGen] Give argument labels to all generate(_:) functions
Explicit argument labels are useful for "Open Quickly..." in Xcode,
reduce the fear of miss overload resolution, and better crash
backtrace as they might not show parameter types.
2023-11-14 19:49:10 -08:00
Pavel Yaskevich
79ac431780 Merge pull request #69742 from xedin/transitive-keypath-base-inference
[ConstraintSystem] More changes to key path inference
2023-11-14 17:31:14 -08:00
Ellie Shin
2e14df5621 Merge pull request #69863 from apple/es-fixtest
Fix test: add a missing env
2023-11-14 17:07:48 -08:00
Allan Shortlidge
8aa0a3c753 Merge pull request #69841 from tshortli/silgen-lazy-typecheck-pattern-executable-init
AST/SILGen: Requestify var initializer expression typechecking
2023-11-14 16:57:24 -08:00
Rintaro Ishizaki
8ca707b574 Merge pull request #69829 from rintaro/astgen-node-syntaxenum
[ASTGen] Utilize base specific SyntaxEnum and start Pattern generation
2023-11-14 16:24:01 -08:00
Andrew Trick
0eded5f514 Merge pull request #69864 from atrick/disable-test
Disable SILOptimizer/moveonly_computed_property.swift
2023-11-14 15:41:08 -08:00
Cyndy Ishida
831b098fcc Merge pull request #69779 from cyndyishida/Swift-tbdv5
[TBDGen] Capture segment symbols are defined in & emit tbd-v5 format
2023-11-14 15:36:38 -08:00
Pavel Yaskevich
dcbfa984da Merge pull request #69827 from xedin/fix-invalid-sendable-handling-in-existential-types
[Sema] Don't propagate `allowsMissing` to existential superclass check
2023-11-14 15:32:55 -08:00
Konrad `ktoso` Malawski
cd23ddad85 [Distributed] Another fix for getting required protocols for SR 2023-11-15 08:16:54 +09:00
Nate Chandler
73d57c9012 [Test] Avoid LSAN report of leaked FunctionTest.
Avoid heap-allocating an immortal FunctionTest with `new` because it
results in LSAN reporting a leak.

In fact, the "leaked" value wasn't leaked: a reference to it was stored
in a global map when the type's constructor ran.  It was only a leak in
the sense that it was never freed, not that there was a dangling
allocation which couldn't be freed.

Work around this by storing the global instances themselves in a second
static structure.  Store pointers to the instances into the global map
as before.

rdar://118134637
2023-11-14 15:05:18 -08:00
Daniel Rodríguez Troitiño
094e9abaa1 [ASTGen] Protect parseASTFromSyntaxTree for SWIFT_BUILD_SWIFT_SYNTAX (#69858)
The field `IsForASTGen` only exists when `SWIFT_BUILD_SWIFT_SYNTAX` is
defined, but the usage was unprotected. The whole function can be inside
the protected block because it only seems to be invoked from inside
blocks already protected by `SWIFT_BUILD_SWIFT_SYNTAX`.

Fix for #69761
2023-11-14 14:47:07 -08:00
Alex Hoppen
9ccb2ef65c Merge pull request #69784 from ahoppen/ahoppen/remove-syntacticrename
Remove the `source.request.syntacticrename` request
2023-11-14 14:14:07 -08:00
Felipe de Azevedo Piovezan
7fd5cae61a Merge pull request #69851 from felipepiovezan/felipe/reenable_async_x86_test2
[DebugInfo] Re-enable x86 async tests
2023-11-14 13:56:57 -08:00
Hamish Knight
5aab237468 [Profiler] Emit skipped regions for inactive #if branches
For any `#if` blocks in the function we're emitting,
emit skipped ranges for the inactive clauses, including
the syntax for the `#if` itself, since that should
not be considered executable code.

rdar://116860865
2023-11-14 20:41:35 +00:00
Hamish Knight
d31f76853a [SIL] Introduce skipped coverage ranges
Introduce a skipped region kind, printed using
a `skipped` keyword.
2023-11-14 20:41:35 +00:00
Hamish Knight
6a58991cc4 [Parse] Store #if ranges on the SourceFile
Record any `#if`'s we encounter, and make a note
of their active region.
2023-11-14 20:41:35 +00:00
Saleem Abdulrasool
cd216843e1 macros: install the runtime component for Windows
Windows uses the runtime component for the DLL, the library component
for the import library, and archive component for static archives.  This
is in contrast to Darwin that uses library for the DLL and archive for
static archives.

This is required to enable packaging the ObservableMacros.
2023-11-14 12:36:27 -08:00
Saleem Abdulrasool
75c1651c3d Merge pull request #69852 from compnerd/logging
build: add additional logging when extracting the MSIs
2023-11-14 12:35:27 -08:00
Slava Pestov
d9ed08870b Merge pull request #69826 from slavapestov/assoc-type-inference-cycle
Sema: Associated type inference skips witnesses that might trigger a request cycle
2023-11-14 15:10:58 -05:00
Allan Shortlidge
111eea7f5d AST/SILGen: Requestify var initializer expression typechecking.
Allow initializer expressions to be emitted during SILGen when
`-experimental-lazy-typecheck` is specified by introducing a new request that
fully typechecks the init expressions of pattern binding declarations
on-demand.

There are still a few rough edges, like missing support for wrapped properties
and incomplete handling of subsumed initializers. Fixing these issues is not an
immediate priority because in the short term `-experimental-lazy-typecheck`
will always be accompanied by `-enable-library-evolution` and
`-experimental-skip-non-exportable-decls`. This means that only the
initializers of properties on `@frozen` types will need to be emitted and
property wrappers are not yet fully supported on properties belonging to
`@frozen` types.

Resolves rdar://117448868
2023-11-14 11:54:01 -08:00
Doug Gregor
89bda715ce Merge pull request #69840 from DougGregor/macro-role-metaprogramming
[Macros] Macro-metaprogram macro roles
2023-11-14 11:51:50 -08:00
Andrew Trick
90c3fa3590 Disable SILOptimizer/moveonly_computed_property.swift
This test is blocking CI and the pass is not actively maintained.

rdar://118135397 (Swift CI: test:
SILOptimizer/moveonly_computed_property.swift (SIL verification
failed: 'MoveOnly' types can only be copied in Raw SIL?!))
2023-11-14 11:26:56 -08:00
Ellie Shin
8aebee63d2 Add a missing env to test
Resolves rdar://117594759
2023-11-14 11:06:04 -08:00
Ellie Shin
0f3625bf54 Remove @objc CHECK as it only applies to Darwin 2023-11-14 10:59:44 -08:00
Nate Chandler
e673344060 [IRGen] NFC: Deleted dead LoweredValue kind.
Follow-up to https://github.com/apple/swift/pull/10077 .
2023-11-14 10:49:02 -08:00
Rintaro Ishizaki
215abe6d40 [ASTGen] Start generating Patterns 2023-11-14 10:47:31 -08:00
Rintaro Ishizaki
038597c80f [ASTGen] Use kind specific SyntaxEnum 2023-11-14 10:47:16 -08:00
Egor Zhdan
5e4e83e247 Revert "Revert "[cxx-interop] Partially disable a test on Linux""
This reverts commit 4cf34abe99.

Unfortunately still failing on Ubuntu 18.04 and Amazon Linux 2.

rdar://118401796
2023-11-14 18:41:52 +00:00
Holly Borla
4557ed6f76 Merge pull request #69853 from hborla/downgrade-global-actor-accessor
[Concurrency] Downgrade invalid global actors on accessors to a warning until Swift 6.
2023-11-14 13:28:34 -05:00
Alex Hoppen
fdca46c462 Merge pull request #69785 from ahoppen/ahoppen/move-optionset
Move `OptionSet` to its own namespace
2023-11-14 09:52:20 -08:00
Alastair Houghton
5c427124ae [Backtracing] Fix ARM64e build failure.
Accessing the thread context structures is complicated because their
member variables change name depending on various macros.  This caused
a build failure for ARM64e.

rdar://118402226
2023-11-14 17:37:00 +00:00
Doug Gregor
ffa5ba7ce3 More macro metaprogramming for macro roles 2023-11-14 09:20:15 -08:00
Slava Pestov
96432e6092 Sema: Extract isExtensionUsableForInference() into a top-level function 2023-11-14 12:13:36 -05:00