Commit Graph

4391 Commits

Author SHA1 Message Date
Erik Eckstein
7d70a70acf SIL: add the drop_deinit instruction
his instruction is a marker for a following destroy instruction to suppress the call of the move-only type's deinitializer.
2023-04-11 10:25:48 +02:00
Jonathan Grynspan
22150c5b1f Document which registers are used for the async context on x86-64/ARM64. (#64947)
> LGTM (and you've saved me a [very small] job; I was going to make that change when I had a spare moment).

There was a discussion yesterday where we realized that this wasn't actually documented, so I figured a drive-by fix to documentation was within my abilities. 😇
2023-04-06 11:23:36 -04:00
Alex Lorenz
00181138fd [interop] support 'default' mode for '-cxx-interoperability-mode' option
Default corresponds to the Swift language version used to compile the input. Swift-5.9 is still supported for now, but will be removed shortly
2023-04-04 15:35:48 -07:00
Richard Wei
eb8e984b97 [Macros] Private discriminators for outermost-private MacroExpansionDecl (#64813)
Add a private discriminator to the mangling of an outermost-private `MacroExpansionDecl` so that declaration macros in different files won't have colliding macro expansion buffer names.

rdar://107462515
2023-03-31 20:36:29 -07:00
Rintaro Ishizaki
1d2fd4223f [Test] Add %host_triple and %host_sdkroot substitutions
Macro tests need to build host libraries/tools. We can't use %target-*
substitutions for that.

rdar://107398734
2023-03-31 07:41:41 -07:00
Alastair Houghton
9209bdd8c4 [Backtracing] Add an option to output to stderr.
In CI, it would be better if the backtraces went to stderr rather than
stdout, so provide an option for that.

rdar://107192120
2023-03-24 17:13:52 +00:00
Michael Gottesman
ee451f0862 [move-only] If we have a noncopyable type on an alloc_stack/alloc_box/debug_value, set the [moveable_value_debuginfo] flag.
This still does not have the complete behavior that we want since we are not yet
inserting the debug_value undef to invalidate after performing moves.

NOTE: In printed SIL, I decided to make the flag implicit if we have a
noncopyable type. This is just to reduce the bloat in SIL. If one needs this
property for a copyable type though, it is mandatory.
2023-03-19 16:05:51 -07:00
Michael Gottesman
8d12f893c2 [sil] Add a moveable_value_debuginfo field to AllocBoxInst.
Just getting parsing/serialization to work. I haven't wired it up to anything.
2023-03-19 15:50:29 -07:00
Michael Gottesman
4a309575d7 [sil] Rename [moved] flag on debug_value/alloc_stack to moveable_value_debuginfo.
This is in preparation for wiring up debug info support for noncopyable
values. Originally this flag name made sense since it was set when we performed
consume operator checking. Now I am going to use it for noncopyable types as
well. I think the new name uses_moveable_value_debuginfo actually describes what
the flag is supposed to do, tell IRGen that the value may be moved since it
needs to use moveable value debug info emission.
2023-03-19 15:38:42 -07:00
Konrad `ktoso` Malawski
41f99fc2ae [Executors][Distributed] custom executors for distributed actor (#64237)
* [Executors][Distributed] custom executors for distributed actor

* harden ordering guarantees of synthesised fields

* the issue was that a non-default actor must implement the is remote check differently

* NonDefaultDistributedActor to complete support and remote flag handling

* invoke nonDefaultDistributedActorInitialize when necessary in SILGen

* refactor inline assertion into method

* cleanup

* [Executors][Distributed] Update module version for NonDefaultDistributedActor

* Minor docs cleanup

* we solved those fixme's

* add mangling test for non-def-dist-actor
2023-03-15 23:42:55 +09:00
Zoe Carver
34da940cc3 Follow up from #64088: compatibility -> interoperability 2023-03-08 08:57:45 -08:00
zoecarver
7a5136185d [cxx-interop] Rebase fallout: replace a few instances of swift-5.7 with swift-5.9. 2023-03-07 13:30:29 -08:00
zoecarver
dcd83a807f [nfc][cxx-interop] Rename cxx-compatibility-mode -> cxx-interoperability-mode. 2023-03-07 10:23:19 -08:00
zoecarver
b64b52ae83 [cxx-interop] Add -cxx-compatibility-mode driver flag; deprecate -enable-experimental-cxx-interop. 2023-03-07 10:22:57 -08:00
Alastair Houghton
43ac069ad0 [Backtracing] Add control over symbol caching.
Some symbolication frameworks have a symbol cache; we probably don't want
to use that for test cases, to avoid running into problems where the cache
holds stale information.

rdar://105409147
2023-03-04 08:00:09 +00:00
Alastair Houghton
662c80eade [Backtracing][Docs] Add some information about signal handlers for macOS.
Added a list of handled signals and some notes on what the runtime will
do if it finds signal handlers already configured.

rdar://105394365
2023-03-04 08:00:09 +00:00
Alastair Houghton
24932f2ec1 [Backtracing][Docs] Add an explanation of the workings of the backtracer.
Add some discussion of how the new external backtracer works and what
options are available.

rdar://105394365
2023-03-04 08:00:09 +00:00
Zoe Carver
9c584d89b7 Merge pull request #62953 from apple/zoecarver-patch-1
Update GettingStartedWithC++Interop.md
2023-02-27 15:30:41 -08:00
Slava Pestov
fee32cca3f ASTMangler: Mangle which generic parameters are packs 2023-02-25 16:19:07 -05:00
Dario Rexin
a8d4d57f11 [IRGen] Generate compressed representation of value witnesses (#63813)
rdar://105837040

* WIP: Store layout string in type metadata

* WIP: More cases working

* WIP: Layout strings almost working

* Add layout string pointer to struct metadata

* Fetch bytecode layout strings from metadata in runtime

* More efficient bytecode layout

* Add support for interpreted generics in layout strings

* Layout string instantiation, take and more

* Remove duplicate information from layout strings

* Include size of previous object in next objects offset to reduce number of increments at runtime

* Add support for existentials

* Build type layout strings with StructBuilder to support target sizes and metadata pointers

* Add support for resilient types

* Properly cache layout strings in compiler

* Generic resilient types working

* Non-generic resilient types working

* Instantiate resilient type in layout when possible

* Fix a few issues around alignment and signing

* Disable generics, fix static alignment

* Fix MultiPayloadEnum size when no extra tag is necessary

* Fixes after rebase

* Cleanup

* Fix most tests

* Fix objcImplementattion and non-Darwin builds

* Fix BytecodeLayouts on non-Darwin

* Fix Linux build

* Fix sizes in linux tests

* Sign layout string pointers

* Use nullptr instead of debug value
2023-02-24 15:40:28 -08:00
nate-chandler
77feef5125 Merge pull request #63766 from nate-chandler/lexical_lifetimes/per-function
Add attr to enable lexical lifetime per function.
2023-02-22 12:33:45 -08:00
John McCall
b0aaf78c32 Document the SIL support for variadic generics 2023-02-21 12:26:23 -05:00
Nate Chandler
ec1a5e0911 Add attr to enable lexical lifetime per function.
Enables modules to migrate to the new lifetime rules incrementally.
2023-02-18 11:59:54 -08:00
Anthony Latsis
ea1d0a3a3a Merge pull request #63541 from apple/AnthonyLatsis-patch-2 2023-02-11 17:15:19 +03:00
Anthony Latsis
a7517b0b39 [docs] GettingStarted: Tweak one more Ninja target suggestion to work on Apple Silicon
See https://github.com/apple/swift/issues/62017
2023-02-11 04:21:19 +03:00
Michael Gottesman
85ea8b5d5b [move-only] Rename CheckKind::NoImplicitCopy -> CheckKind::ConsumableAndAssignable
This fits the name of the check better. The reason I am doing this renaming is
b/c I am going to add a nonconsumable but assignable check for
global_addr/ref_element_addr/captures with var semantics.
2023-02-10 13:46:19 -08:00
Michael Gottesman
87829aaa32 [move-only] Rename CheckKind::NoCopy -> CheckKind::NoConsumeOrAssign.
This reflects better the true meaning of this check which is that a value marked
with this check cannot be consumed on its boundary at all (when performing
let/var checking) and cannot be assigned over when performing var checking.
2023-02-10 13:46:19 -08:00
Erik Eckstein
cef6ef9a84 SIL: add a debug_step instruction
This instruction can be inserted by Onone optimizations as a replacement for deleted instructions to
ensure that it's possible to single step on its location.
2023-02-09 06:50:05 +01:00
Anthony Latsis
60bf5447ad [docs] GettingStarted: Bump required CMake version for --xcode once more
2.24.2 is the oldest version that didn't reproduce the code signing issue from 
https://github.com/apple/swift/issues/62023 with the latest Xcode release (14.2).
2023-02-06 22:40:57 +03:00
Anthony Latsis
70a1f9f156 Merge pull request #63451 from apple/AnthonyLatsis-patch-2
[docs] GettingStarted: Replace build variant suffix with asterisks in paths to `--xcode` build artifacts
2023-02-06 21:50:59 +03:00
Anthony Latsis
ff2bed28f1 Merge pull request #63439 from apple/AnthonyLatsis-patch-1
[docs] FAQ: Fix hardcoded arch in suggested build-script option.
2023-02-06 21:49:56 +03:00
Anthony Latsis
bebd0d0fa1 Merge pull request #63440 from AnthonyLatsis/arm64-swift-frontend 2023-02-06 20:49:23 +03:00
Anthony Latsis
fed05f6cb9 [docs] GettingStarted: Remove outdated assumption
The guide is no longer dependent on the architecture.
2023-02-06 14:45:43 +03:00
Anthony Latsis
a2cb93eccb [docs] GettingStarted: Replace build variant suffix with asterisks in paths to --xcode build artifacts
The default build variant for `--xcode` recently changed from ReleaseAssert to MinSizeRelAssert, and we forgot to update these hardcoded paths. Use asterisks to avoid having to do this again.
2023-02-06 14:16:17 +03:00
Anthony Latsis
a8c5f45da5 [docs] Suggest ninja bin/swift-frontend instead of ninja swift-frontend
...to cope with a bootstrapping quirk on arm64 Macs.
2023-02-06 13:09:28 +03:00
Anthony Latsis
43f9869e95 [docs] FAQ: Fix hardcoded arch in suggested build-script option.
Plus a minor spelling correction and rephrasing that makes more sense.
2023-02-05 11:56:31 +03:00
swift-ci
07ad2b6ce4 Merge pull request #63396 from Azoy/fix-runtime-attrs-mangling
[Mangling] Fix Runtime Attribute mangling
2023-02-03 16:47:46 -08:00
Doug Gregor
b63fa566ec [Macros] Add mangling for attached macro expansion.
Extend the name mangling scheme for macro expansions to cover attached
macros, and use that scheme for the names of macro expansions buffers.

Finishes rdar://104038303, stabilizing file/buffer names for macro
expansion buffers.
2023-02-03 13:30:16 -08:00
Alejandro Alonso
1535f305a4 Fix Runtime Attribute mangling
use here

fix tests
2023-02-03 13:26:42 -08:00
Allan Shortlidge
8fde58f6ca Merge pull request #63357 from tshortli/se0376-rename-backdeploy
[SE-0376] Rename `@_backDeploy(before:)` to `@backDeployed(before:)`
2023-02-02 12:36:53 -08:00
Erik Eckstein
ef11448533 docs: fix info about bootstrapping
https://github.com/apple/swift/issues/62017
2023-02-02 16:55:21 +01:00
Egor Zhdan
f92e4eb66b Merge pull request #63347 from apple/egorzhdan/docs-cxxstdlib
[cxx-interop][docs] Update the C++ stdlib module name
2023-02-02 12:39:34 +00:00
Allan Shortlidge
d44c9f2ccc NFC: Add a changelog entry for SE-0376. 2023-02-01 22:04:33 -08:00
Doug Gregor
c85c9053a1 Merge pull request #63352 from DougGregor/macro-fixes 2023-02-01 18:44:00 -08:00
Doug Gregor
f8d78e2eb9 Handle demangling prefix @__swiftmacro_ used for filenames. 2023-02-01 09:20:46 -08:00
Egor Zhdan
8bf3f0f638 [cxx-interop][docs] Update the C++ stdlib module name
The C++ standard library module was renamed from `std` to `CxxStdlib` in the context of Swift.

Also use a top-level module name (`CxxStdlib`) instead of a submodule name, since libstdc++ is not currently split into submodules.
2023-02-01 16:16:25 +00:00
Doug Gregor
0af352314a Merge pull request #63322 from DougGregor/macro-expansion-unique-name-mangling 2023-01-31 20:17:41 -08:00
Anthony Latsis
4409c2fc6c Merge pull request #63271 from AnthonyLatsis/min-size-xcode
build: Override default build variant for `--xcode`
2023-02-01 04:18:19 +03:00
Doug Gregor
ac4aa41d0f [Macros] Use macro expansion mangling for unique names in macros
Use the name mangling scheme we've devised for macro expansions to
back the implementation of the macro expansion context's
`getUniqueName` operation. This way, we guarantee that the names
provided by macro expansions don't conflict, as well as making them
demangleable so we can determine what introduced the names.
2023-01-31 09:40:48 -08:00
Doug Gregor
3fd895a13d Merge pull request #63284 from DougGregor/swift-syntax-macros-module-update 2023-01-29 15:38:27 -08:00