Commit Graph

4421 Commits

Author SHA1 Message Date
Zoe Carver
1317c928c6 Add link to Swift.org documentation in GettingStartedWithC++Interop.md 2023-06-08 14:07:40 -07:00
Zoe Carver
67afcbded5 Add link to Swift.org documentation in InteropOddities.md 2023-06-08 14:07:24 -07:00
Zoe Carver
7543ad4267 Add link to Swift.org documentation in UserManual.md 2023-06-08 14:07:09 -07:00
Zoe Carver
2ab1707860 Add link to Swift.org documentation in UserGuide-CallingSwiftFromC++.md 2023-06-08 14:06:41 -07:00
Sima Nerush
fdb00bea6d [docs] GettingStarted: Add a warning about spaces in the absolute path 2023-06-08 13:20:55 -07:00
Michael Gottesman
29672c503a Merge pull request #66381 from gottesmm/noimplicitcopy-borrow-consuming
[borrowing/consuming] Make borrowing and consuming parameters no implicit copy.
2023-06-06 21:41:18 -04:00
Slava Pestov
15bd01b076 Mangler: Mangle PackElementType 2023-06-06 15:42:20 -04:00
Michael Gottesman
68fd68bd93 Add some docs for copyable_to_moveonlywrapper_addr and moveonlywrapper_to_copyable_addr. 2023-06-06 12:42:23 -04:00
swift-ci
4ef135cc10 Merge pull request #66201 from nate-chandler/dealloc-on-stack-packs
[IRGen] Dealloc on-stack metadata/wtable packs on the dominance frontier.
2023-06-05 13:30:18 -07:00
Nate Chandler
efca4e57c8 [SIL] Added on-stack pack metadata marker insts.
The new alloc_pack_metadata and dealloc_pack_metadata are inserted as
part of IRGen lowering.  The former indicates that the next instruction
might result in on-stack pack metadata being emitted.  The latter
indicates that this is the position at which metadata emitted on behalf
of its operand should be cleaned up.
2023-06-05 08:11:28 -07:00
Nate Chandler
bab948d1ec [Gardening] Fixed typo in SIL.rst. 2023-06-05 08:11:28 -07:00
Dario Rexin
4842ad5285 [Docs] Remove outdated RuntimeValueWitness doc (#66307)
The design has changed significantly since this document was written and at this point causes more confusion than it is helpful.
2023-06-02 20:59:43 -07:00
Kuba (Brecka) Mracek
2d5f33e2e3 Add @_used and @_section attributes for global variables and top-level functions (#65901)
* Add @_used and @_section attributes for global variables and top-level functions

This adds:
- @_used attribute that flags as a global variable or a top-level function as
  "do not dead-strip" via llvm.used, roughly the equivalent of
  __attribute__((used)) in C/C++.
- @_section("...") attribute that places a global variable or a top-level
  function into a section with that name, roughly the equivalent of
  __attribute__((section("..."))) in C/C++.
2023-05-26 14:02:32 -07:00
Kavon Farvardin
31aa2f77e3 polish noncopyable types diagnostic wordings
- replaces "move-only" terminology with "noncopyable"
- replaces compiler jargon like "guaranteed parameters"
  and "lvalue" with corresponding language-level notions
- simplifies diagnostics about closures.

and probably more.

rdar://109281444
2023-05-24 20:56:36 -07:00
Jaesung
62ce892609 Modified code snippet in OptimizationTips.rst
The given code snippet assigns some value to the method: `doSomething()`, but it seems that it should be just in the form of method invocation.
2023-05-20 10:21:19 +09:00
Max Desiatov
5e511a24b5 Update Lexicon.md: address PR feedback
Update GOT entry.
2023-05-19 17:44:27 +01:00
Ben Barham
515d22a486 [AST] Use a different operator for member attribute macros
Macro expansions are currently written to disk using the mangled name of
the macro. Do not use operators that only differ in case-sensitivity to
avoid issues on case-insensitive filesystems.

Resolves rdar://109371653.
2023-05-17 11:25:37 -07:00
Max Desiatov
d7272069ff docs: Fix shell var substitution in GettingStarted.md (#65803)
We're supposed to use `${platform}` for substituting this previously defined variable. Currently used `$(platform)` will try to run a command named `platform`, which doesn't make sense.
2023-05-09 21:13:03 +01:00
Allan Shortlidge
0366c42293 Merge pull request #65557 from tshortli/unavailable-decl-optimization-stub
Introduce `stub` mode for `-unavailable-decl-optimization`
2023-05-05 09:11:41 -07:00
Max Desiatov
2e879729ba docs/GettingStarted.md: support Linux in incremental build steps (#65653)
Currently, guidance for incremental builds in `docs/GettingStarted.md` is specific to macOS and won't work on Linux. Let's adjust these steps so that they work on Linux too.
2023-05-05 13:45:20 +01:00
Allan Shortlidge
5f4fe4923d Docs: Add missing manglings for {get/store}EnumTagSinglePayload. 2023-05-03 15:19:32 -07:00
Erik Eckstein
da0e769d62 docs: describe -Osize as the default optimization mode in OptimizationTips.rst 2023-04-20 22:02:18 +02:00
Max Desiatov
ab12c4d5c9 docs: convert Modules.rst to Markdown (#65226)
* docs: convert `Modules.rst` to Markdown

Partially resolves https://github.com/apple/swift/issues/49997.

* Update `Modules.md` link in `docs/README.md`

* Delete Modules.rst
2023-04-20 09:24:59 +01:00
Anthony Latsis
0028322485 Merge pull request #65246 from AnthonyLatsis/nfc-debug-constraints
[NFC] CS: Misc minor debug output tweaks
2023-04-19 02:46:05 +03:00
Anthony Latsis
82ac9328ae [NFC] CS: Misc minor debug output tweaks
* Use fancy arrows (`→`) because they are distinct from and shorter than `->`,
  and fancier.
* We have two ways of demarcating locators: `@ <locator>` and `[[<locator>]];`.
  Stick to the first, which is shorter and clearer.
* 'attempting type variable' → 'attempting binding'. *Bindings* are attempted,
  not type variables.
* `considering ->` → `considering:`. I think a colon is semantically more fit
  and makes things easier to read if the considered constraint has arrows in its
  description or types. It’s also shorter this way.
2023-04-18 22:42:59 +03:00
Mishal Shah
25fc3c1aff Update ContinuousIntegration.md with unsupported triggers 2023-04-18 11:13:20 -07:00
Max Desiatov
284af9e0f6 Delete Modules.rst 2023-04-17 15:01:59 +01:00
Max Desiatov
9f637f0396 Update Modules.md link in docs/README.md 2023-04-17 15:01:32 +01:00
Max Desiatov
f4609d97e6 docs: convert Modules.rst to Markdown
Partially resolves https://github.com/apple/swift/issues/49997.
2023-04-17 14:54:03 +01:00
Doug Gregor
a23d39bdfb [Macros] Mangle attached macro expansions based only on syntactic information
The mangling of attached macro expansions based on the declaration to
which they are attached requires semantic information (specifically,
the interface type of that declaration) that caused cyclic
dependencies during type checking. Replace the mangling with a
less-complete mangling that only requires syntactic information from
the declaration, i.e., the name of the declaration to which the macro
was attached.

This eliminates reference cycles that occur with attached macros that
produce arbitrary names.
2023-04-11 23:40:28 -04:00
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