Commit Graph

162307 Commits

Author SHA1 Message Date
Michael Gottesman
d08359eb20 [region-isolation] Add support for ref_to_raw_pointer, raw_pointer_to_ref, index_raw_pointer. 2023-12-19 15:21:42 -08:00
Michael Gottesman
c90097f1f0 [region-isolation] Add support for *_existential_box instructions.
NOTE: I am just adding coverage that we support these instructions. One can only
use this with Error today and Error is always Sendable. So this is just going
for completeness.
2023-12-19 13:29:12 -08:00
Ian Anderson
f375f2e3f3 Merge pull request #70523 from ian-twilightcoder/pcm-emit-direct-cc1-mode
pcm-emit-direct-cc1-mode.swift also fails on Android
2023-12-19 11:02:52 -08:00
Michael Gottesman
8178eb0a6e Merge pull request #70514 from gottesmm/pr-763529d8ee9f4164b82d03087fec25439cc1d315
[region-isolation] Fix the dataflow and add support for project_block_storage
2023-12-19 10:21:59 -08:00
Kavon Farvardin
dfe3d2a42c Merge pull request #70488 from kavon/ncgenerics-stdlib-building-v2
[NCGenerics] Fix more issues while building the stdlib
2023-12-19 10:19:25 -08:00
Allan Shortlidge
cbc1859559 Merge pull request #70533 from tshortli/catalyst-modify-accessor-inferred-availability
AST: Fix macCatalyst availability for synthesized declarations
2023-12-19 10:16:55 -08:00
Daniel Rodríguez Troitiño
1de0e3bf3a [test] Improve ParseableInterfaceImports check patterns (#70519)
When one configures their toolchain to use a define (`-D`) in either
`SWIFT_FRONTEND_TEST_OPTIONS` or `SWIFT_DRIVER_TEST_OPTIONS`, the
DIModule generated by this test might have other elements like
`configMacros` in between `name:` and `includePath:`.

To account for this possibility, break the check in two, using
`CHECK-SAME` for the second part.
2023-12-19 06:46:52 -08:00
Allan Shortlidge
61111ed4fe AST: Fix macCatalyst availability for synthesized declarations.
The macCatalyst platform availability of a declaration may be inferred from the
iOS platform availability of that declaration in the absence of an explicit
macCatalyst availability attribute. This means that when inheriting macCatalyst
platform availability, the explict iOS availability of an inner ancestor should
take precedence over explicit macCatalyst availability of an outer ancestor.
The algorithm that computes inferred availability attributes for synthesized
declarations was treating macCatalyst and iOS as independent platforms, though,
sometimes yielding inapproparite macCatalyst availability.

Resolves rdar://107766644
2023-12-18 23:49:26 -08:00
Allan Shortlidge
e383631550 Merge pull request #70527 from tshortli/stolen-package
SIL: Allow package decls to be serialized when appropriate
2023-12-18 22:55:27 -08:00
Michael Gottesman
e7f63778c2 [sil] Now that we are enforcing that pack_metadata insts are only allowed in LoweredSIL, update some tests by splitting them into their own Lowered file. 2023-12-18 22:13:15 -08:00
Steven Wu
a6c98879ab Merge pull request #70530 from cachemeifyoucan/eng/PR-no-swift-target-frontend 2023-12-18 20:57:38 -08:00
Alex Lorenz
9db866f881 Merge pull request #70524 from hyp/eng/pdb-for-all-of-us
[windows][build] pass the /debug flag to the linker
2023-12-18 19:01:59 -08:00
Kavon Farvardin
34f359d8d0 [NCGenerics] fix TypeLowering 2023-12-18 18:55:56 -08:00
Kavon Farvardin
d80719827c [NCGenerics] fix missing contextual type 2023-12-18 18:55:56 -08:00
Kavon Farvardin
f0e17af495 [NCGenerics] fix _bridgeAnythingToObjectiveC
Now that there's an actual conformance requirement in the generic
signature, we need a real conformance lookup function.
2023-12-18 18:55:56 -08:00
Kavon Farvardin
a9321d0747 [nfc] add variadic is for types 2023-12-18 18:55:56 -08:00
Allan Shortlidge
b4e1c4883e Tests: Add serialization of vtable for package class tests.
Missing from https://github.com/apple/swift/pull/70100/.
2023-12-18 18:12:54 -08:00
Allan Shortlidge
857c2c3903 Tests: Add serialization of witness for conformance to package protocol tests.
Missing from https://github.com/apple/swift/pull/70100/.
2023-12-18 17:52:48 -08:00
Michael Gottesman
ddd8c01877 [region-isolation] Do not treat mark_dependence as an ignore. Treat it as an assign from op 0 -> result and a require of op 1.
Semantically a mark_dependence returns a value that is equal to its first
parameter with the extra semantics that any destroys of the 2nd operand cannot
occur before any uses of the result of the instruction. From a region
perspective this suggests that the instruction should be an assign from the
first operand onto the result and act as a require on the result. Semantically
the requirement that the 2nd operand cannot be destroyed before any uses of the
result does not expose any memory or state from the first operand implying that
we don't need to merge it into the result region. The restriction is purely to
tell the optimizer what it can/cannot do rather.
2023-12-18 16:56:32 -08:00
Michael Gottesman
71a8c8eedc [region-isolation] Some small comment cleanups/reordering of definitions. NFCI. 2023-12-18 16:29:46 -08:00
Michael Gottesman
998f067d59 [region-isolation] Add support for mark_unresolved_move_addr. It is a store. 2023-12-18 16:21:34 -08:00
Steven Wu
407674ea52 [Test] Fix the wrong subsitution of swift-frontend-target in tests
There is no `%swift-frontend-target` subsitution in test, which is
actually `%target-swift-frontend`. The wrong spelling is actually
interpreted by lit as `%swift`-frontend-target, and surprising didn't
break any tests as the last argument from subsitution is
`-define-availability` so it just leads to an very akward availability
definition.
2023-12-18 16:07:48 -08:00
Allan Shortlidge
d16d9799f2 SIL: Allow package decls to be serialized when appropriate.
https://github.com/apple/swift/pull/70100 prohibited `package` declarations from
ever being serialized in order to solve a problem in which the declarations
were being serialized inappropriately. That's too heavy handed, though, because
an `@_alwaysEmitIntoClient` function with `package` access *must* be serialized
because it has public non-abi linkage.

Resolves rdar://104711625
2023-12-18 15:06:19 -08:00
Saleem Abdulrasool
eda8f15e1d Merge pull request #70473 from AtariDreams/Task
Use aligned_alloc when the platform we use supports it
2023-12-18 14:53:51 -08:00
Joe Groff
614a8e35ac Merge pull request #70507 from jckarter/generic-moveonly-diagnostic-names
Look through copy_addr and opened existentials to diagnose move-only sources.
2023-12-18 13:27:09 -08:00
Alex Lorenz
d2c897a1a1 [windows][build] pass the /debug flag to the linker
when building with debug information enabled

This ensures that every executable and dll get a corresponding
PDB file with the debug information.
2023-12-18 13:01:30 -08:00
Michael Gottesman
f6cda45e52 [region-isolation] Add support for alloc_vector. Its an assign fresh. 2023-12-18 12:47:42 -08:00
Michael Gottesman
58a6e2aa4d [region-isolation] Add Asserting support for {alloc,dealloc}_pack_metadata since they only appear in Lowered SIL.
I also added a note to the SIL.rst and an assert into the SILVerifier to better
document this requirement.
2023-12-18 12:35:40 -08:00
Michael Gottesman
4a635b61a4 [region-isolation] Add support for fix_lifetime.
fix_lifetime just acts as a require.
2023-12-18 12:35:40 -08:00
Michael Gottesman
59fe82d878 [region-isolation] Do not run on non-Ownership SSA SIL and mark certain instructions that can only appear in non-OSSA as asserting.
We already only supported Ownership SSA since we run early in the pipeline
before OSSA is lowered. This just formalizes this behavior. I am marking these
instructions as Asserting (even though we will never see them) so I can
semantically be sure that all of the instructions are covered without using an
"unsupported" like moniker that I fear will lead to new instructions being added
as unsupported. Better to have a semantic thing for new instruction adders to
use.
2023-12-18 12:35:40 -08:00
Andrew Trick
6cc5d674c7 Merge pull request #70479 from atrick/no-pointer-escape-flag
[SIL] Bridge findPointerEscape() and fix OnoneSimplifyable
2023-12-18 12:22:06 -08:00
Ian Anderson
6ee2632015 pcm-emit-direct-cc1-mode.swift also fails on Android
Extend the recently added XFAIL to Android.
2023-12-18 12:11:51 -08:00
Doug Gregor
82ebc54857 Merge pull request #70520 from DougGregor/no-opaque-parameters-in-stdlib
Don't use opaque parameters in the standard library
2023-12-18 10:33:25 -08:00
Doug Gregor
3b4e37e5fe Don't use opaque parameters in the standard library
The SIL printer is printing opaque parameters as <anonymous>, which
breaks the SIL parser. Stop using opaque parameters in the standard
library for the moment to unbreak SIL parsing of the standard library.
2023-12-18 10:14:57 -08:00
Mariusz Borsa
5f4320568b Merge pull request #70508 from apple/eng/m_borsa/112915278
[Sanitizers] Add new sanitize-stable-abi flag for libsanitizers.
2023-12-18 09:58:55 -08:00
Michael Gottesman
7712639ab0 [region-isolation] Add support for project_block_storage.
rdar://119743743
2023-12-18 09:35:57 -08:00
Egor Zhdan
233b80e431 Merge pull request #70503 from apple/egorzhdan/no-abstract-ctors
[cxx-interop] Do not import constructors of abstract C++ classes
2023-12-18 17:24:00 +00:00
Andrew Trick
b637f06acd [SIL] Bridge findPointerEscape() and fix OnoneSimplifyable
Do not bridge the hasPointerEscape flag until it is implemented.
2023-12-18 09:16:55 -08:00
eeckstein
d40fa0893c Merge pull request #70518 from eeckstein/fix-forwarding-instruction
SwiftCompilerSources: bridge_object_to_word is not a ForwardingInstruction
2023-12-18 18:08:40 +01:00
Angela Laar
c1af52c2f2 Merge pull request #70419 from angela-laar/group-actor-isolation-errors
Group actor isolation errors
2023-12-18 08:42:26 -08:00
Egor Zhdan
325868808b [cxx-interop] Do not import constructors of abstract C++ classes
Clang rejects code that tries to call a constructor of an abstract C++ class with an error: "Variable type 'Base' is an abstract class". Swift should reject this as well.

rdar://119689243
2023-12-18 14:52:32 +00:00
Erik Eckstein
84e06322b9 SwiftCompilerSources: bridge_object_to_word is not a ForwardingInstruction
Fix this mismatch between C++ SIL and swift SIL.
Fixes a crash in begin_borrow simplification
Also add an assert to catch such cases.

rdar://119763595
2023-12-18 11:08:22 +01:00
eeckstein
4eddc1d70b Merge pull request #70494 from eeckstein/instruction-simplifications
Add some instruction simplifications
2023-12-17 16:39:02 +01:00
Daniel Rodríguez Troitiño
f2d2a28bea [test] Add REQUIRES: assert to moveonly_addressors using experimental feature (#70517)
moveonly_addressors.swift (added in #70475) uses the experimental
feature `NonescapableTypes`, which requires an asserts compiler to work,
so requires marking the test as `REQUIRES: asserts`.
2023-12-17 07:04:18 -08:00
Doug Gregor
6536f57ab5 Merge pull request #70516 from DougGregor/typed-throw-try-bang
[Typed throws] Terminate with an error message for typed try! failures.
2023-12-17 02:41:48 -08:00
Doug Gregor
d740965753 [Typed throws] Terminate with an error message for typed try! failures. 2023-12-16 23:58:51 -08:00
usama
3053fe01b5 [Sanitizers] Add new sanitize-stable-abi flag for libsanitizers.
This patch adds a new flag sanitize-stable-abi to support linking
against the Sanitizers stable ABI added recently in compiler-rt. The
patch also passes extra options for the ASan pass when using this flag
to outline instrumentation code and remove version check.

rdar://112915278
2023-12-16 14:13:00 -08:00
Kavon Farvardin
15a6c01a16 Merge pull request #70513 from kavon/delet-underscore-copyable
[NCGenerics] delete `_Copyable` from stdlib
swift-DEVELOPMENT-SNAPSHOT-2023-12-17-a
2023-12-16 13:59:58 -08:00
Slava Pestov
f68e0c90f9 Merge pull request #70496 from slavapestov/fix-issue-61934
Sema: Implement missing case in existential erasure
2023-12-16 15:27:55 -05:00
Kavon Farvardin
b43f861827 [NCGenerics] delete _Copyable from stdlib
resolves rdar://115793371
2023-12-16 11:17:31 -08:00