Commit Graph

12816 Commits

Author SHA1 Message Date
Dario Rexin
2d0b19484f Merge pull request #74058 from drexin/wip-127535274
[IRGen] Assign layout strings for static layout generic types in meta…
2024-05-31 15:38:00 -07:00
Dario Rexin
8e2b0ec1d6 [IRGen] Assign layout strings for static layout generic types in metadata initialization function
rdar://127535274

The layout string needs to be assigned before completion, to make it available in recursive metadata initialization. Setting it in the completion function causes a race between other metadata initializers using it and the completion function running.
2024-05-31 11:24:01 -07:00
swift-ci
2aff268350 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-30 20:34:28 -07:00
Alejandro Alonso
324cb2df1f Merge pull request #73955 from Azoy/show-me-those-moves
[IRGen] Add option for raw layout to move as its like type
2024-05-30 20:32:49 -07:00
swift-ci
63205ba9a2 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-30 09:54:36 -07:00
Holly Borla
135e3f2ee9 Merge pull request #73889 from hborla/deprecate-anyactor
[Concurrency] Deprecate `AnyActor`.
2024-05-30 09:36:35 -07:00
Holly Borla
c20b0e0956 [Concurrency] Obsolete AnyActor in Swift 6 using a typealias. 2024-05-29 22:59:19 -07:00
Alejandro Alonso
a9da08ccb6 Add option for raw layout to move as its like type 2024-05-28 14:34:22 -07:00
swift-ci
85ae379988 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-25 15:54:05 -07:00
Hamish Knight
cfdf35ff34 [IRGen] Fix SyncCallEmission::emitCallToUnmappedExplosion crash
We cannot `dyn_cast` directly to `ClassTypeInfo` since it does not
implement `classof`, so will succeed for any `ReferenceTypeInfo`.

rdar://128735092
2024-05-25 16:47:36 +01:00
swift-ci
74c6fdf3e7 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-23 21:34:24 -07:00
Akira Hatanaka
b5cc5615bd [SILGen] Fix a crash when a closure is converted to a block returning a value indirectly (#73520) 2024-05-23 21:22:32 -07:00
Hamish Knight
782ae72efd Merge branch 'main' into merge-rebranch 2024-05-23 20:03:52 +01:00
Adrian Prantl
ece1256585 Merge pull request #73769 from Snowy1803/irgen-declare-all
[IRGenDebugInfo] Fix usage of dbg.declare
2024-05-23 09:22:39 -07:00
swift-ci
a9bcb33a0a Merge remote-tracking branch 'origin/main' into rebranch 2024-05-23 07:15:46 -07:00
Arnold Schwaighofer
69b635a25c Merge pull request #73791 from aschwaighofer/irgen_loadable_by_address_objc_method_closures
IRGen: Properly adjust the closure type of a partial_apply of an objc_method
2024-05-23 07:15:24 -07:00
swift-ci
50ff2bfca4 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-22 10:34:59 -07:00
eeckstein
7c69bec9b4 Merge pull request #73782 from eeckstein/static-arrays-in-embedded
IRGen: support read-only statically initialized arrays in embedded swift
2024-05-22 19:34:42 +02:00
Arnold Schwaighofer
d89bf2893b IRGen: Properly adjust the closure type of a partial_apply of an objc_method
It needs to match with the (large loadable) lowered closure type in the rest of
the program: Large types in the signature need to be passed indirectly.

rdar://127367321
2024-05-22 09:39:15 -07:00
Emil Pedersen
5606fbc1d6 [IRGenDebugInfo] Disable usage of dbg.declare in optimized code
Except for the async context, where it is needed (arguments
within an async function).

We don't support dbg.declare in optimized code, as variables can
be moved by SIL optimization passes. If a partial store is
eliminated, we want a dbg.value on the allocation, and another
dbg.value with a fragment in place of the partial store.

rdar://128155050
2024-05-22 09:35:37 -07:00
swift-ci
efcbe900f9 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-21 10:33:14 -07:00
Becca Royal-Gordon
d9912009b0 Merge pull request #73309 from beccadax/objcimpl-category-on-objc 2024-05-21 10:19:14 -07:00
Erik Eckstein
162139364e IRGen: support read-only statically initialized arrays in embedded swift
Arrays buffers need to be initialized with a (minimal) metatype and with an immortal reference count.
2024-05-21 18:04:10 +02:00
Erik Eckstein
09d2e8f685 IRGen: add forceShared flag to LinkeEntity for type metadata 2024-05-21 18:04:10 +02:00
Erik Eckstein
941a7427d8 handle upcast instructions in statically initialized globals
This allows statically initialized multi-dimensional arrays in embedded swift.
2024-05-21 13:33:06 +02:00
Erik Eckstein
1a32cfe426 IRGen: disable feature availability checking for embedded swift.
In embedded swift features are available independent of deployment and runtime targets because the runtime library is always statically linked to the program.
2024-05-21 13:31:36 +02:00
Emil Pedersen
2726d8318c [IRGenDebugInfo] Allow multiple dbg.declare on an alloca
This is unnecessarily dropping debug info, as there is currently
no assertion in LLVM. The sharing of stack slot can happen
because of AllocStackHoisting, which is run at -Onone too.
2024-05-20 16:55:22 -07:00
swift-ci
b20fedebc6 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-18 02:54:31 -07:00
Michael Gottesman
d759ec97ea Merge pull request #73696 from gottesmm/rdar128216574
[sending] Add support for 'sending'
2024-05-18 05:42:41 -04:00
swift-ci
79df0ab8a1 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-17 09:14:02 -07:00
Akira Hatanaka
335cec0e8d [cxx-interop][IRGen] Do not pass a foreign reference type to objc_retainAutoreleasedReturnValue (#73630)
If a foreign reference type has a custom retain function, emit a call to
it instead of emitting a call to objc_retainAutoreleasedReturnValue.

rdar://117353222
2024-05-17 09:04:02 -07:00
swift-ci
5c0fe0fd6c Merge remote-tracking branch 'origin/main' into rebranch 2024-05-17 00:35:54 -07:00
Becca Royal-Gordon
07b9fe9ce6 Support @objc(CustomName) on extensions
This now specifies a category name that’s used in TBDGen, IRGen, and PrintAsClang. There are also now category name conflict diagnostics; these subsume some @implementation diagnostics.

(It turns out there was already a check for @objc(CustomName) to make sure it wasn’t a selector!)
2024-05-16 13:40:13 -07:00
Erik Eckstein
af68435d90 Optimizer: support static initialization of global arrays
The buffer of global arrays could already be statically initialized.
The missing piece was the array itself, which is basically a reference to the array buffer.
For example:
```
var a = [1, 2, 3]
```
ends up in two statically initialized globals:
1. the array buffer, which contains the elements
2. the variable `a` which is a single reference (= pointer) of the array buffer

This optimization removes the need for lazy initialization of such variables.

rdar://127757554
2024-05-16 21:34:36 +02:00
Michael Gottesman
e3e78ad6bb [sending] Change the internals of sending to be based around 'sending' instead of 'transferring'.
We still only parse transferring... but this sets us up for adding the new
'sending' syntax by first validating that this internal change does not mess up
the current transferring impl since we want both to keep working for now.

rdar://128216574
2024-05-16 12:20:45 -07:00
swift-ci
abf98a0f6c Merge remote-tracking branch 'origin/main' into rebranch 2024-05-16 11:34:58 -07:00
Augusto Noronha
e5a1d61ed8 Merge pull request #73145 from augusto2112/keep-for-deb-def
Fix functions not being kept for debugger
2024-05-16 11:32:43 -07:00
swift-ci
7e5837eb38 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-15 20:34:57 -07:00
Arnold Schwaighofer
b5d9ff4557 Merge pull request #73626 from aschwaighofer/large_types_reg2mem_unchecked_trivial_bitcast_fix
IRGen: Large types reg2mem - Fix visitUncheckedTrivialBitCastInst
2024-05-15 20:16:05 -07:00
swift-ci
35e784e3c2 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-15 19:14:47 -07:00
Slava Pestov
a356b10929 SIL: Sink local archetype substitution into remapType() 2024-05-15 17:39:00 -04:00
Arnold Schwaighofer
1258563c3b IRGen: Large types reg2mem - Fix visitUncheckedTrivialBitCastInst
An unchecked_trivial_bit_cast can go from a bigger type to a smaller
type. Therefore we must allocate stack storage for the operand type
rather than the result type. Otherwise, we can end up storing bigger
values into smaller storage -- not good.

rdar://128086028
2024-05-14 13:45:45 -07:00
Augusto Noronha
529845056b Fix functions not being kept for debugger
At Onone, many types of functions (anything user written, compiler
generated setters and getters, etc), should be kept in the final
binary so they're accessible by the debugger.

rdar://126763340
2024-05-14 10:31:44 -07:00
swift-ci
27875fab06 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-13 10:35:09 -07:00
Emil Pedersen
15cab3a19f Merge pull request #73555 from Snowy1803/complete-getvarinfo
[DebugInfo] Return complete variable info from getVarInfo by default
2024-05-13 10:32:43 -07:00
swift-ci
0025f20d51 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-13 09:14:40 -07:00
Dario Rexin
ace752b230 Merge pull request #73465 from drexin/wip-127511568
[IRGen] Add missing blocklist check for some CVW cases
2024-05-13 08:54:24 -07:00
Emil Pedersen
0be63d0422 [DebugInfo] Return complete variable info from getVarInfo by default
getVarInfo() now always returns a variable with a location and scope.
To opt out of this change, getVarInfo(false) returns an incomplete variable.
This can be used to work around bugs, but should only really be used for
printing.

The complete var info will also contain the type, except for debug_values,
as its type depends on another instruction, which may be inconsistent if
called mid-pass.

All locations in debug variables are now also stripped of flags, to avoid
issues when comparing or hashing debug variables.
2024-05-10 16:12:56 -07:00
swift-ci
1c82c3dedf Merge remote-tracking branch 'origin/main' into rebranch 2024-05-09 13:54:26 -07:00
Anton Korobeynikov
e7e2ad19f1 Ensure we are using mapped SIL type for switch_enum case and not the original lowered one (#73385)
Fixes #73018
2024-05-09 13:41:34 -07:00