Commit Graph

3778 Commits

Author SHA1 Message Date
Andrew Trick
c14059e92c [comment] Add a semantics note to SIL BindMemory 2022-08-29 13:20:45 -07:00
Alex Lorenz
64b90e8245 [interop][SwiftToCxx] docs: add section on converting Swift's String to NSString * 2022-08-25 15:25:46 -07:00
eeckstein
937d3b9079 Merge pull request #60745 from eeckstein/swift-sil-infrastructure
Add some swift SIL+Optimizer infrastructure
2022-08-25 07:21:53 +02:00
Alex Lorenz
8de79390be [interop][SwiftToCxx] add @_expose(Cxx) attribute support
This attribute instructs the compiler that this declaration should be included in the generated C++ bindings
2022-08-24 10:14:07 -07:00
Erik Eckstein
1407846656 docs: update SIL-Utilities.md
And move it out of the "proposals" folder, directly into "docs". It's now more a documentation of what we have and useful as a programming guide.
2022-08-24 18:18:50 +02:00
Evan Wilde
943852d491 Merge pull request #60686 from Jager-yoo/fix-typo-meantime
[docs] Fix typo in DevelopmentTips.md
2022-08-24 07:42:44 -07:00
nate-chandler
064b713db0 Merge pull request #60599 from nate-chandler/eager_move
Add hooks for emitting lifetimes.
2022-08-22 19:34:27 -07:00
a4z
f96bfb2914 Adopt Cxx header/implementation in example
* Fix header/implemenation content in C++ code listning
* Minor whitespace fix in caption
2022-08-22 20:21:04 +02:00
Nate Chandler
b3ae13ddbe [Sema] Added _eagerMove and _lexical attributes.
The new attributes affect how the lifetimes of values may be shortened.
2022-08-21 21:44:53 -07:00
DylanPerry5@gmail.com
14f7d07cff Updating to clean up the type checker document a little bit - fixed a couple typos 2022-08-21 19:08:54 -04:00
Jager-yoo
d8b95440d3 [docs] Fix typo in DevelopmentTips.md 2022-08-21 23:53:44 +09:00
Michael Gottesman
3e52007562 [builtin] Remove "unsafeGuaranteed" and related code since Unmanaged now has an Ownership SSA based implementation that works completely in SILGen.
This isn't used in the stdlib anymore as well.
2022-08-21 01:22:36 -07:00
Casper Jeukendrup
b57104961a Fix typo in docs/DevelopmentTips.md: boostrapping -> bootstrapping 2022-08-20 00:13:47 +02:00
Alex Lorenz
f5787c9e40 Merge pull request #60564 from WANGJIEKE/cxx-interop-new-enum-design
[Interop][SwiftToCxx] Update current enum implementation for new enum design
2022-08-17 06:32:32 -07:00
Xiaodi Wu
6079452a58 Re-alphabetize underscored attributes reference (#60558) 2022-08-16 09:02:48 -04:00
Tongjie Wang
482e1ac80f [Interop][SwiftToCxx] Implement the new enum header design 2022-08-15 15:31:43 -07:00
Alex Lorenz
f212db5ad5 [interop][SwiftToCxx] docs, fixup UInt mapping for C++ 2022-08-11 21:23:46 -07:00
Alex Lorenz
a654e66f06 [interop][SwiftToCxx] update disclaimer for reverse inteorp user guide 2022-08-11 21:23:27 -07:00
Alex Lorenz
0308404a8a [interop][SwiftToCxx] update reverse interop user guide for new enum design 2022-08-11 21:20:48 -07:00
Michael Gottesman
accc2820f8 Merge pull request #60511 from gottesmm/pr-0796eed23b86f5812f817b15b928dbe11485c361
[move-only-addresses] Slicing some patches off of the larger patch.
2022-08-11 16:25:10 -07:00
Michael Gottesman
5baf2af88a [sil] Add a new instruction called explicit_copy_addr.
This is exactly like copy_addr except that it is not viewed from the verifiers
perspective as an "invalid" copy of a move only value. It is intended to be used
in two contexts:

1. When the move checker emits a diagnostic since it could not eliminate a copy,
we still need to produce valid SIL without copy_addr on move only types since we
will hit canonical SIL eventually even if we don't actually codegen the SIL. The
pass can just convert said copy_addr to explicit_copy_addr and everyone is
happy.

2. To implement the explicit copy function for address only types.
2022-08-11 11:40:53 -07:00
Michael Gottesman
82ae1d1a2d [SIL.rst] Cleanup docs on explicit_copy_value.
There really isn't a point in repeating the verbage from copy_value. So I
removed that and just referred back to the copy_value documentation and focused
instead on what makes explicit_copy_value different semantically from
copy_value, how it is used to work around the invariant in Canonical SIL that
move only typed values can not be copied. This is useful for:

1. Implementing an explicit copy for no implicit copy types.

2. When the move checker errors since it can't produce a move only solution for
a value, we change all of the copies into explicit_copy_value. We need some sort
of copy to ensure later once we are in Canonical SIL, Ownership SSA is correct
/and/ we maintain the no copy of move only typed values in Canonical SIL.
2022-08-11 10:15:48 -07:00
Michael Gottesman
4a81bcafe4 [SIL.rst] Add to copy_value's docs that in non-Raw SIL, one cannot give copy_value a move only value as an operand.
I am enforcing this in the verifier, so it makes sense to document in SIL.rst.
2022-08-11 10:15:48 -07:00
Michael Gottesman
3bdfa239ca [SIL.rst] Add docs explaining how Move Only Types can be copied in Raw SIL, but not in later SIL stages.
Since I am going to start enforcing this invariant more broadly, I want to
document it in SIL.rst. I also included a discussion explaining why we maintain
this invariant: it enables SILGen to use a simple algorithm to insert copies/us
to clean that up using a diagnostic guaranteed optimization pass which runs on
Raw SIL.
2022-08-11 10:15:47 -07:00
Slava Pestov
cb0721fa6e Merge pull request #60470 from slavapestov/rename-conformance-path
AST: Rename ConformanceAccessPath to ConformancePath
2022-08-09 23:45:32 -04:00
Alex Lorenz
74d47a1651 [interop][SwiftToCxx] update swift type representation docs with different opaque type layout 2022-08-09 11:55:28 -07:00
Slava Pestov
4a041c57d0 AST: Rename ConformanceAccessPath to ConformancePath 2022-08-09 13:34:27 -04:00
Alex Lorenz
b8c61e1aed Merge pull request #60446 from hyp/eng/SwiftTypeRepresentationInCxx
[interop][SwiftToCxx] docs: add SwiftTypeRepresentationInC++ document
2022-08-08 13:20:25 -07:00
Alex Lorenz
2361f9c291 [interop][SwiftToCxx] docs: add SwiftTypeRepresentationInC++ document 2022-08-08 11:18:01 -07:00
Luciano Almeida
7f9585463e Merge pull request #60322 from LucianoPAlmeida/getting-started-troubleshooting 2022-08-06 08:17:23 -03:00
Luciano Almeida
ad76797748 Minor fixes 2022-08-05 22:54:56 -03:00
Alex Lorenz
7384ee2a24 Merge pull request #60381 from hyp/eng/i/class-members-docs
[interop][SwiftToCxx] add support for members in class types
2022-08-05 05:57:13 +01:00
Artem Chikin
4e2c1d16f6 Add '@_alwaysEmitConformanceMetadata' protocol attribute
This attribute will, in the near future, be used to inform IRGen that a nominal type that conforms to such protocol must have its type metadata always emitted into the binary, regardless of whether it is used/public.
2022-08-04 14:19:33 -07:00
Alex Lorenz
3873603a90 [interop][SwiftToCxx] docs: update status page to reflect class support 2022-08-03 14:11:08 +01:00
Alex Lorenz
6831130060 [interop][SwiftToCxx] docs: add a user guide section on class inheritance 2022-08-03 14:00:27 +01:00
Luciano Almeida
25a7051b85 Update docs/HowToGuides/GettingStarted.md
Co-authored-by: Anthony Latsis <aqamoss3fan2010@gmail.com>
2022-08-03 09:37:09 -03:00
Luciano Almeida
abb9ee2bc0 Update docs/HowToGuides/GettingStarted.md
Co-authored-by: Anthony Latsis <aqamoss3fan2010@gmail.com>
2022-08-03 09:36:59 -03:00
Luciano Almeida
ff1b455240 Update docs/HowToGuides/GettingStarted.md
Co-authored-by: Anthony Latsis <aqamoss3fan2010@gmail.com>
2022-08-03 09:36:49 -03:00
Luciano Almeida
9a1de83fa2 [Gardening] Add troubleshooting links to getting started 2022-08-02 23:20:41 -03:00
Alex Lorenz
2879a751d3 [interop][SwiftToCxx] docs, add initial user guide docs for class types and ARC 2022-08-02 11:52:26 +01:00
Alex Lorenz
783186486a [interop][docs] Add compiler requirement line to user guide for reverse interop 2022-07-28 12:25:49 +01:00
Alex Lorenz
954e89cef0 [interop][docs] cleanup CallingSwiftFromC++ guide 2022-07-28 12:25:49 +01:00
Alex Lorenz
d9969ad189 Merge pull request #60243 from hyp/eng/ifixes2
[interop][SwiftToCxx] support `is/has` property getters and fix pass/return support for `Unsafe{Mutable}Pointer` types.
2022-07-26 20:51:18 +01:00
Ben Barham
184541484f Merge pull request #60225 from bnbarham/move-cxx-interop-back-to-driver
[Options] Move CXX interop back to a driver option
2022-07-26 09:13:34 -07:00
Alex Lorenz
3b4c6bffd8 [interop][SwiftToCxx] remap bool is/has property getters directly as is/has methods in C++ 2022-07-26 14:34:40 +01:00
Alex Lorenz
62fa2a0eba [interop][docs] add language markers to some doc snippets in reverse interop user guide 2022-07-26 13:47:00 +01:00
Alex Lorenz
c5a617af8a [interop][docs] udpate CppInteroperabilityStatus.md for reverse interop 2022-07-26 13:42:46 +01:00
Ben Barham
3ac580261e [Options] Move CXX interop back to a driver option
This flag is required in the driver to eg. choose `clang` vs `clang++`
for the linker. Move it back to a driver option and hide both it and the
stdlib flag from help.
2022-07-25 15:29:14 -07:00
Alex Lorenz
a3ab0c29f7 [interop][SwiftToCxx] add initial design / user guide document for reverse interop 2022-07-22 17:47:18 +01:00
Michael Gottesman
7a43d246b0 Merge pull request #60047 from gottesmm/plus_zero_fix_noimplicitcopy
[no-implicit-copy] Use default param convention instead of forcing +1
2022-07-20 02:36:52 -07:00