Commit Graph

758 Commits

Author SHA1 Message Date
Ben Barham
d72f5b12c4 Update StringRef::equals references to operator==
`equals` has been deprecated upstream, use `operator==` instead.
2024-06-27 19:14:06 -07:00
Xi Ge
736ccef626 Merge remote-tracking branch 'apple/main' into rebranch 2024-06-20 15:16:55 -07:00
Tim Kientzle
598e5104ef Merge pull request #74184 from tbkka/tbkka-assertions2
Add `#include "swift/Basic/Assertions.h"` to a lot of source files
2024-06-20 12:13:28 -07:00
swift-ci
e4e79345ad Merge remote-tracking branch 'origin/main' into rebranch 2024-06-19 21:14:11 -07:00
Kuba Mracek
62d7167c3f [embedded] Enable read-only static array promotion in embedded mode 2024-06-19 09:16:04 -07:00
Tim Kientzle
1098054291 Merge branch 'main' into tbkka-assertions2 2024-06-18 17:52:00 -07:00
swift-ci
b861f5c6f3 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-14 07:15:26 -07:00
Konrad `ktoso` Malawski
2ec717b115 [Concurrency] TaskExecutor ownership fixes (#74000) 2024-06-14 22:56:33 +09:00
swift-ci
5e95443f0e Merge remote-tracking branch 'origin/main' into rebranch 2024-06-13 09:34:17 -07:00
Adrian Prantl
bba8b921ab Finalize Swift debug info before running Clang codegen, because it may delete
the llvm module.

rdar://128309024
2024-06-12 10:13:50 -07:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
swift-ci
aed40bd421 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-05 19:34:38 -07:00
artemcm
d70863501e [Dependency Scanning] Collect and report each module dependency's Link Libraries 2024-06-05 10:59:41 -07:00
swift-ci
66a4c36346 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-03 03:36:17 -07:00
Kuba Mracek
399dbc97d5 [embedded] In -emit-empty-object-file mode, don't emit autolink entries 2024-06-01 10:20:18 -07:00
swift-ci
50ff2bfca4 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-22 10:34:59 -07: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
swift-ci
5b6eadf416 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-12 13:37:42 -07:00
Erik Eckstein
ce33d47a4c stdlib: add the swift_clearSensitive runtime function 2024-04-09 12:01:10 +02:00
Ben Barham
17b34312df [IRGen] Start cleaning up typed pointers
Typed pointers are slowly being removed. There's a lot more cleanup to
do here, since really all `IRGenModule::.*PtrTy` should just be `PtrTy`,
but this at least gets us compiling for now.
2024-04-08 08:58:59 -07:00
Artem Chikin
c49d854890 Merge pull request #69694 from apple/revert-69689-revert-69609-AlwaysEmitConformanceMetadataPreservation
Revert "Revert "Add mandatory SIL pass implementing '@_alwaysEmitConformanceMetadata' protocol attribute""
2024-04-03 15:28:57 -07:00
Adrian Prantl
1b5d61b8fa Merge pull request #72467 from adrian-prantl/123923517
Work around a memory leak caught by the LSAN bot.
2024-04-03 13:49:05 -07:00
Artem Chikin
69fdc1356c Revert "Revert "Add mandatory SIL pass implementing '@_alwaysEmitConformanceMetadata' protocol attribute"" 2024-04-03 09:29:51 -07:00
Kuba Mracek
507280bb95 [embedded] Use << instead of .dump() to fix build breakage with asserts off 2024-03-30 13:39:45 -07:00
Kuba Mracek
70781b2dc4 [embedded] Avoid DropAllSILPass, reuse StopOptimizationAfterSerialization instead 2024-03-28 15:32:19 -07:00
Kuba Mracek
90e7595df5 [embedded] Add a frontend flag to drop all code from a module and emit an empty object file 2024-03-28 11:03:50 -07:00
Adrian Prantl
0742c01806 Work around a memory leak caught by the LSAN bot.
Fundamentally the problem here is that SILPassManager is creating an IRGenModule
without calling finalize() on it under some circumstances. It would be better to
fix that instead.

rdar://123923517
2024-03-20 13:02:46 -07:00
John McCall
d8767b7724 Pass the task option record pointer to swift_task_create as a pointer.
We add the `memory(argmem: readwrite)` attribute to swift_task_create,
which means that the call is only allowed to read or write "pointer
operands".  LLVM is smart enough to look through obvious ptrtoint
casts, but not to look through integer selects and so on, which is what
we produce when there's an opaque optional operand that feeds into the
builtin.  This was causing miscompiles under optimization when using
`@isolated(any)` function types for task creation, since we're not yet
clever enough to fold the function_extract_isolation for a known function
(and of course it's not necessarily a known function anyway).
2024-03-15 00:40:54 -04:00
John McCall
0901b2b0b3 Add builtin support for starting a task on a specific executor.
This should be close enough to the creation of this builtin that we don't
need a new feature for it specifically.
2024-03-11 19:44:50 -04:00
Augusto Noronha
9178c4a346 Merge pull request #71962 from augusto2112/embedded-flag
[DebugInfo] Emit embedded swift into DW_AT_APPLE_flags
2024-03-01 15:12:39 -08:00
John McCall
237dd4faab Merge pull request #71970 from rjmccall/isolated-any-availability
Fix metadata availability testing for parameterized existentials and implement it for @isolated(any) function types
2024-03-01 04:11:22 -05:00
Augusto Noronha
0b8abda060 [DebugInfo] Emit embedded swift into DW_AT_APPLE_flags
To properly initialize the compiler instance on LLDB when debugging
embedded Swift programs, emit "-enable-embedded-swift" into the
DW_AT_APPLE_flags attribute of the compile unit.
2024-02-29 16:37:13 -08:00
Konrad `ktoso` Malawski
c56a1e8be7 [Distributed] Handle mangling thunks in extensions with generic AS and $Stubs (#71914) 2024-02-29 04:22:00 -08:00
John McCall
69c8f53e76 [NFC] Remove "Runtime" from this feature name to avoid confusion 2024-02-29 03:00:43 -05:00
Konrad `ktoso` Malawski
1d44e2e8e0 [Distributed] Undo new record and mangling scheme for dist.p.witnesses (#71801) 2024-02-22 23:02:29 +09:00
Konrad `ktoso` Malawski
e9c7f3c382 [Distributed] Target identifiers for protocol calls (#70928) 2024-02-16 07:19:20 -08:00
Alastair Houghton
4c7822cdac Merge pull request #71213 from al45tair/eng/PR-121522431
[Frontend][AST][IRGen] Improve availability support.
2024-02-02 22:30:19 +00:00
Guillaume Lessard
114f235d17 Merge pull request #71167 from vanvoorden/vanvoorden/inclusive-language
[Inclusive Language][Comments][Documentation] migrate "sanity" checks to "soundness" checks
2024-02-02 10:27:34 -08:00
Alastair Houghton
c226bf3c3c [AST][IRGen] Add -min-runtime-version option and IRGen support code.
Add a `-min-runtime-version` option that can be used to avoid problems
when building on Linux and Windows where because the runtime isn't
part of the OS, availability doesn't solve the problem of trying to
build the compiler against an older runtime.

Also add functions to IRGen to make it easy to test feature
availability using both the runtime version and the existing Darwin
availability support.

rdar://121522431
2024-02-02 16:17:08 +00:00
Rick van Voorden
f8ae46b3f3 [inclusive-language] changed sanity to soundness 2024-01-25 18:18:02 -08:00
Arnold Schwaighofer
49e8ffb735 IRGen: Outline by-address SIL enum instructions
Use a heuristic to decide when to outline indirect enum operations.
2024-01-23 15:01:24 -08:00
Erik Eckstein
eaabcfd933 IRGen: restrict generation of read-only static objects to Array buffers
Currently only arrays can be put into a read-only data section.
"Regular" classes have dynamically initialized metadata, which needs to be stored into the isa field at runtime.
2024-01-10 09:33:17 +01:00
eeckstein
2993e3bdc3 Merge pull request #70712 from eeckstein/fix-static-array-storage
IRGen: get metadata symbol of class __StaticArrayStorage the correct way
2024-01-05 08:32:37 +01:00
Erik Eckstein
ded1b6ea8c IRGen: get metadata symbol of class __StaticArrayStorage the correct way
Fixes an unresolved symbol error when building the stdlib on some platforms.

rdar://119991570
2024-01-04 18:32:23 +01:00
Kuba Mracek
2c24c1216f [embedded] In -no-allocations, avoid linking allocating/deallocating runtime functions 2024-01-04 13:28:56 +01:00
Erik Eckstein
e4ea7491a2 IRGen: fix and re-enable static read-only arrays
Static read-only arrays didn't work when passed to ObjectiveC as NSArray.
The storage class of static read-only arrays doesn't carry information about the Element type.
The new `__SwiftDeferredStaticNSArray` is generic over the element type and doesn't have to rely on the element type information of the array storage.

rdar://94185998
2023-12-13 11:45:01 +01:00
Kuba (Brecka) Mracek
ec87fbcaca Merge pull request #70344 from kubamracek/embedded-nounwind
[embedded] Mark all functions as 'nounwind' in embedded Swift, add dependency tests
2023-12-12 10:37:54 -08:00
Konrad `ktoso` Malawski
828f589be4 Initial Task Executor implementation Task(on:), addTask(on:) etc. (#68793)
Co-authored-by: John McCall <rjmccall@gmail.com>
2023-12-12 17:14:24 +09:00
Kuba Mracek
fdc69fb6a1 [embedded] Actually, use 'nounwind' even with C++ interop on, add comment 2023-12-11 13:37:41 -08:00
Kuba Mracek
9e8db64f45 [embedded] Don't apply 'nounwind' if C++ interop is enabled 2023-12-11 09:08:06 -08:00