Commit Graph

4254 Commits

Author SHA1 Message Date
Kavon Farvardin
dade95dcc0 make python 3.6 the official minimum version 2023-07-25 10:33:21 -07:00
Joe Groff
aee071bf4e Introduce an experimental @_rawLayout attribute.
This attribute can be attached to a noncopyable struct to specify that its
storage is raw, meaning the type definition is (with some limitations)
able to do as it pleases with the storage. This provides a basis for
implementing types for things like atomics, locks, and data structures
that use inline storage to store conditionally-initialized values.
The example in `test/Prototypes/UnfairLock.swift` demonstrates the use
of a raw layout type to wrap Darwin's `os_unfair_lock` APIs, allowing
a lock value to be stored inside of classes or other types without
needing a separate allocation, and using the borrow model to enforce
safe access to lock-guarded storage.
2023-07-24 14:28:19 -07:00
Becca Royal-Gordon
2ab1e05c68 [NFC] Add new DiagnosticEngine Decl features
Implements several enhancements to DiagnosticEngine’s handling of Decl arguments:

• All Decl classes, not just ValueDecls, are now valid to use as arguments.
• There is built-in logic to handle accessors by printing a phrase like `getter for 'foo'`, so this no longer has to be special-cased for each diagnostic.
• `%kind` can be used to insert the descriptive kind before a name; `%kindonly` inserts only the descriptive kind. This can eliminate kind/name argument pairs.
• `%base` can insert only the base name, leaving out any argument labels; `%kindbase` combines `%kind` and `%base`.

This PR is marked NFC because there are no intentional uses of these changes yet.
2023-07-19 13:06:51 -07:00
Slava Pestov
f9f0ea2fe5 Work-in-progress second edition of generics.tex
This is not ready for review yet so I'm not updating the PDF on Swift.org.
2023-07-10 23:39:47 -04:00
eeckstein
7fcfcdeecf Merge pull request #66990 from eeckstein/bare-objects
SIL: add a `bare` attribute to `global_value` and `alloc_ref`
2023-06-29 18:48:44 +02:00
Kuba (Brecka) Mracek
d427696bf9 Allow @_silgen_name to be used on globals and add a @_silgen_name(raw: ...) version that skips mangling (#66540)
Attribute @_silgen_name is today only allowed to be used on functions, this change allows usage on globals as well. The motivation for that is to be able to "forward declare" globals just like it's today possible to do with functions (for the cases where it's not practical or convenient to use a bridging header).

Separately, this change also adds a @_silgen_name(raw: ...) syntax, which simply avoids mangling the name (by using the \01 name prefix that LLVM uses). The motivation for that is to be able to reference the "magic Darwin linker symbols" that can be used to look up section bounds (in the current dylib/module) -- those symbols don't use the underscore prefix in their mangled names.
2023-06-29 08:37:51 -07:00
Erik Eckstein
625619ee17 SIL: add a bare attribute to global_value
The `bare` attribute indicates that the object header is not used throughout the lifetime of the value.
This means, no reference counting operations are performed on the object and its metadata is not used.
The header of bare objects doesn't need to be initialized.
2023-06-29 06:57:05 +02:00
Erik Eckstein
b08710d911 SIL: add a bare attribute to alloc_ref
The `bare` attribute indicates that the object header is not used throughout the lifetime of the object.
This means, no reference counting operations are performed on the object and its metadata is not used.
The header of bare objects doesn't need to be initialized.
2023-06-29 06:57:05 +02:00
Max Desiatov
b395c72658 Merge pull request #41690 from apple/maxd/dso-got-plt 2023-06-22 07:56:22 +01:00
Max Desiatov
f61249d34e GettingStarted.md: fix incorrect list item index 2023-06-20 10:05:32 +01:00
Max Desiatov
3a0802b26f GettingStarted.md: add missing link for Ubuntu 18.04 dependencies 2023-06-20 10:04:23 +01:00
Luciano Almeida
4d99f01e9d Merge pull request #66538 from natsuk4ze/do-todo-of-faq 2023-06-14 09:35:16 -03:00
Meghana Gupta
6a2f3c9f84 Merge pull request #66608 from meg-gupta/removeselectvalue
Remove select_value SIL instruction
2023-06-13 21:20:42 -07:00
Midori
01da1cbc57 Add warnings on top 2023-06-14 11:00:55 +09:00
Pavel Yaskevich
19094e3559 Merge pull request #66456 from simanerush/gettingstarted-spacewarning
[docs] GettingStarted: Add a warning about spaces in the absolute path
2023-06-13 14:35:46 -07:00
Meghana Gupta
5d401fb70a Remove select_value SIL instruction 2023-06-13 14:13:43 -07:00
Midori
7b2c3d2252 Add syntax in FAQ.md 2023-06-13 12:03:21 +09:00
Midori
ff50ccacc8 Update FAQ.md
Make the text more recommended.
2023-06-13 11:59:44 +09:00
Midori
a446df35ba Update docs/HowToGuides/FAQ.md
Co-authored-by: Luciano Almeida <passos.luciano@outlook.com>
2023-06-13 00:28:56 +09:00
Midori
b46943f222 Add syntax 2023-06-11 00:11:31 +09:00
Midori
b1e58cfb05 Update FAQ.md 2023-06-10 23:38:36 +09:00
Mishal Shah
330af0b8d1 Remove out of date triggers 2023-06-10 00:00:00 -07:00
Mishal Shah
f3e940d8b1 Merge pull request #66528 from etcwilde/ewilde/update-CI-docs
Updating docs with new CI triggers
2023-06-09 23:56:46 -07:00
Mishal Shah
51c2af639e Update the build toolchain to Please Build Toolchain 2023-06-09 23:56:27 -07:00
Mishal Shah
0bd1c51c85 Update the trigger for Ubuntu 22.04 2023-06-09 23:52:53 -07:00
Evan Wilde
1c0aaef854 Updating docs with new CI triggers 2023-06-09 23:22:39 -07:00
Zoe Carver
4fe20a82a0 Merge pull request #66472 from apple/zoecarver-patch-2
Add link to Swift.org documentation in UserManual.md
2023-06-08 21:28:04 -07:00
Zoe Carver
3c819c3af1 Merge pull request #66467 from apple/zoecarver-patch-1
Add link to Swift.org documentation in UserGuide-CallingSwiftFromC++.md
2023-06-08 17:47:16 -07:00
Zoe Carver
292e2883f6 Merge pull request #66468 from apple/zoecarver-patch-3
Add link to Swift.org documentation in  InteropOddities.md
2023-06-08 17:47:07 -07:00
Zoe Carver
912e1efdc8 Merge pull request #66469 from apple/zoecarver-patch-4
Add link to Swift.org documentation in GettingStartedWithC++Interop.md
2023-06-08 17:46:58 -07:00
Zoe Carver
a4f760030f Merge pull request #66470 from apple/zoecarver-patch-5
Add link to Swift.org status page in CppInteroperabilityStatus.md
2023-06-08 17:27:11 -07:00
Zoe Carver
c2361ba7a6 Add link to Swift.org documentation in CppInteroperabilityManifesto.md; update the link to the Forward Vision document. 2023-06-08 14:10:51 -07:00
Zoe Carver
250d7d2ec0 Add link to Swift.org status page in CppInteroperabilityStatus.md 2023-06-08 14:09:00 -07:00
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