Commit Graph

4421 Commits

Author SHA1 Message Date
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
John McCall
d25a8aec8b Add explicit lowering for value packs and pack expansions.
- SILPackType carries whether the elements are stored directly
  in the pack, which we're not currently using in the lowering,
  but it's probably something we'll want in the final ABI.
  Having this also makes it clear that we're doing the right
  thing with substitution and element lowering.  I also toyed
  with making this a scalar type, which made it necessary in
  various places, although eventually I pulled back to the
  design where we always use packs as addresses.

- Pack boundaries are a core ABI concept, so the lowering has
  to wrap parameter pack expansions up as packs.  There are huge
  unimplemented holes here where the abstraction pattern will
  need to tell us how many elements to gather into the pack,
  but a naive approach is good enough to get things off the
  ground.

- Pack conventions are related to the existing parameter and
  result conventions, but they're different on enough grounds
  that they deserve to be separated.
2023-01-29 03:29:06 -05:00
Doug Gregor
182950bacb Update to account for SwiftSyntaxMacros module rename and overhaul 2023-01-28 09:00:54 -08:00
Anthony Latsis
3f4f4ffafa build: Override default build variant for --xcode 2023-01-28 01:29:53 +03:00
nate-chandler
2fc7659ed7 Merge pull request #60670 from nate-chandler/lexical_lifetimes/owned_arguments
[SIL] Maintain owned argument lifetimes at inlining.
2023-01-26 18:30:24 -08:00
Holly Borla
fcfd08920f Merge pull request #63082 from AnthonyLatsis/good-first-issues
docs: Supplant the "starter bug" term by "good first issue"
2023-01-26 08:11:21 -08:00
Doug Gregor
4e50e29f3d Merge pull request #63233 from DougGregor/macros-mangle-buffer-names
[Macros] Mangle the names of macro expansion buffers
2023-01-26 06:57:15 -08:00
Doug Gregor
4ae434eaa1 [Macros] Add a mangling for macro expansions
These aren't ABI, but are useful to provide consistent names to refer
to macro expansions, e.g., in buffer names.
2023-01-25 22:45:14 -08:00
swift-ci
281088eb73 Merge pull request #63204 from meg-gupta/ptrauthcodegenpr
Initial support for ptrauth qualified function pointers in C
2023-01-25 22:19:34 -08:00
Meghana Gupta
ba052abec1 Add signed access enforcement to begin_access
This will be used for supporting imported c function pointers with custom __ptrauth qualifier.
2023-01-25 14:03:15 -08:00
Nate Chandler
69d1abe0c5 [SIL] Protect owned arg lifetimes at inlining.
Previously, `begin_borrow [lexical]` were created during SILGen for
@owned arguments.  Such borrows could be deleted if trivially dead,
which was the original reason why @owned arguments were considered
lexical and could not have their destroys hoisted.

Those borrows were however important during inlining because they would
maintain the lifetime of the owned argument.  Unless of course the
borrow scope was trivially dead.  In which case the owned argument's
lifetime would not be maintained.  And if the caller's value was
non-lexical, destroys of the value could be hoisted over deinit
barriers.

Here, during inlining, `move_value [lexical]`s are introduced during
inlining whever the caller's value is non-lexical.  This maintains the
lifetime of the owned argument even after inlining.
2023-01-25 11:36:33 -08:00
Nate Chandler
1b1972cd5c [SIL] All lexical arguments are lexical.
Previously, only @owned function arguments were treated as lexical.
Here, all function arguments which report themselves to be lexical (i.e.
based on their type and annotation) are regarded as lexical.
2023-01-25 11:36:33 -08:00
Anthony Latsis
a445516615 docs: Supplant the "stater bug" term by "good first issue" 2023-01-25 19:06:10 +03:00
Andrew Trick
61fbf0a3d6 [doc] Fix SIL.rst enum initialization example 2023-01-23 21:19:57 -08:00
John McCall
0e3a9adc32 Add Builtin.PackIndex 2023-01-19 23:57:13 -05:00
Adam Newton
de41784d41 Bump cmake version in GettingStarted.md
Co-authored-by: Anthony Latsis <aqamoss3fan2010@gmail.com>
2023-01-18 17:24:11 -08:00
Zoe Carver
091dd51961 [docs] Add warning to CppInteroperabilityManifesto. (#63025) 2023-01-13 11:43:53 -08:00
Zoe Carver
05d44b128f Update GettingStartedWithC++Interop.md 2023-01-10 17:33:04 -08:00
Anthony Latsis
ad5d55c36e [NFC] AST: Rename IdentTypeReprDeclRefTypeRepr 2023-01-07 07:14:44 +03:00
Gabriel Denoni
f2c8a70a8b Update Lexicon to add reference link to SIL and ir/refutable pattern (#62807)
* Update lexicon.md

* fix typo
2023-01-05 10:06:08 -03:00
Robert Widmann
f97bf693f7 Merge pull request #62772 from teddy5518/patch-1
[docs] modified sentence structure
2023-01-03 20:49:41 -07:00