Commit Graph

12848 Commits

Author SHA1 Message Date
Alejandro Alonso
8b773dcdf7 Add an ArrayLayoutEntry and dispatch to that for array raw layout 2024-09-04 15:13:28 -07:00
Alejandro Alonso
7c85261a77 Add runtime support 2024-09-04 15:13:27 -07:00
Alejandro Alonso
75c2cbf593 Implement value generics
Some requirement machine work

Rename requirement to Value

Rename more things to Value

Fix integer checking for requirement

some docs and parser changes

Minor fixes
2024-09-04 15:13:25 -07:00
swift-ci
756fe355fa Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 22:34:34 -07:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00
swift-ci
33cd94ec00 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 10:04:55 -07:00
Allan Shortlidge
3f626f50fe Merge pull request #76203 from tshortli/availability-context-cleanup
AST: Clean up `AvailabilityContext` and uses
2024-09-03 09:42:25 -07:00
swift-ci
dd7533d4e7 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 09:33:55 -07:00
Konrad `ktoso` Malawski
c86e4a8738 Merge pull request #60057 from nickolas-pohilets/mpokhylets/isolated-deinit
Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com>
2024-09-04 01:16:56 +09:00
Arnold Schwaighofer
eaf90dff38 IRGen: Add metadata for async funclets denoting frame entry and frame exists
Adds sections `__TEXT,__swift_as_entry`, and `__TEXT,__swift_as_ret` that
contain relative pointers to async functlets modelling async function entries,
and function returns, respectively.

Emission of the sections can be trigger with the frontend option
`-Xfrontend -enable-async-frame-push-pop-metadata`.

This is done by:

* IRGen adding a `async_entry` function attribute to async functions.
* LLVM's coroutine splitting identifying continuation funclets that
  model the return from an async function call by adding the function
  attribute `async_ret`.  (see #llvm-project/pull/9204)
* An LLVM pass that keys off these two function attribute and emits the
  metadata into the above mention sections.

rdar://134460666
2024-09-03 08:44:16 -07:00
swift-ci
fa132ddeda Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 07:15:45 -07:00
Slava Pestov
ba585fd6c0 Merge pull request #76206 from slavapestov/existential-signature-rework-part-1
AST: Add new implementation of getOpenedExistentialSignature()
2024-09-03 10:05:29 -04:00
Allan Shortlidge
89ea92d550 AST: Introduce ASTContext::getTargetPlatformStringForDiagnostics().
NFC.
2024-09-02 18:24:31 -07:00
Allan Shortlidge
8ab7f54cd4 AST/Sema: Favor AvailabilityContext over VersionTuple/VersionRange.
For the purposes of availability calculations, direct use of
`llvm::VersionTuple` and `VersionRange` is discouraged, since these fundamental
version representations are divorced from their context. For example, comparing
an iOS platform version to a visionOS platform version is invalid since the
versioning systems of the two platforms differ. Although visionOS inherits
avialability from iOS, an iOS version must be converted to a visionOS version
prior to comparison. In the future, `AvailabilityContext` can be enriched to
carry the information necessary to verify that its algebraic operations are
being performed on compatible values.

NFC.
2024-09-02 18:24:31 -07:00
Allan Shortlidge
8052e3f9dc AST: Remove 'OS' from AvailabilityContext member names.
An `AvailabilityContext` represents an abstract version range in which
something is available. In the future, these version ranges may not necessarily
always correspond to operating system version ranges.

NFC.
2024-09-02 16:47:14 -07:00
Konrad `ktoso` Malawski
c55ad6fa88 Merge branch 'main' into mpokhylets/isolated-deinit 2024-09-02 23:16:17 +09:00
swift-ci
e984fa4cbf Merge remote-tracking branch 'origin/main' into rebranch 2024-09-02 03:54:41 -07:00
Egor Zhdan
39b8b3c67e Merge pull request #76106 from swiftlang/egorzhdan/cxx-mutable-rac
[cxx-interop] Add `CxxMutableRandomAccessCollection` protocol
2024-09-02 11:35:43 +01:00
Slava Pestov
2fbf2f6b81 IRGen: Use new form of getOpenedExistentialSignature() in emitExtendedExistentialTypeShape() 2024-09-01 18:03:35 -04:00
Gabor Horvath
cdbe999188 [cxx-interop] Emit type metadata for foreign types more often
Metadata for foreign types are emitted lazily, when SILGen generates a
reference to it. Unfortunately, C++ reverse interop can also introduce
references to such metadata in the generated header when types are used
as generic arguments. This adds a type visitor to make note of the type
metadata use for those generic arguments in public APIs when C++ interop
is enabled.

rdar://132925256
2024-08-30 14:45:22 +01:00
swift-ci
a625059d81 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-29 09:14:52 -07:00
Mykola Pokhylets
e0ad7bde82 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/AST/ASTPrinter.cpp
#	lib/AST/FeatureSet.cpp
2024-08-29 11:28:43 +02:00
Arnold Schwaighofer
7fc028c57f IRGen: We need to map the direct type error explosion back to the native result in IRGenThunk
rdar://134730970
2024-08-28 10:56:25 -07:00
Arnold Schwaighofer
42a55ab9a5 IRGen: Add missing case in IRGenThunk when we pass typed errors directly
rdar://134730970
2024-08-28 10:56:19 -07:00
Egor Zhdan
0ab681514b [cxx-interop] Add CxxMutableRandomAccessCollection protocol
This conforms mutable C++ container types, such as `std::vector`, to `MutableCollection` via a new overlay protocol `CxxMutableRandomAccessCollection`.

rdar://134531554
2024-08-28 12:43:42 +01:00
swift-ci
6e7b0a9f52 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-26 11:34:27 -07:00
Arnold Schwaighofer
bbcc3054d7 Merge pull request #75967 from aschwaighofer/non_copyable_deinit_private_field
IRGen: We cannot call destroy through metadata of private types of non-copyable fields
2024-08-26 11:27:12 -07:00
swift-ci
aa1688e468 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-25 18:34:28 -07:00
Kavon Farvardin
7abd8890b5 Merge pull request #76078 from kavon/coldsplit-1
ColdSplit: avoid with -Osize
2024-08-25 18:19:44 -07:00
Kavon Farvardin
1c3ef6c51d ColdSplit: avoid with -Osize
Based on prior evaluation, this optimization always increases code
size. It splits out blocks and introduces calls, which always adds
extra instructions to shuffle values for calling conventions and
to make the actual call/return. Apple clang avoids the optimization
in `-Oz`, which I think is pretty close to what Swift's `-Osize`
really means.
2024-08-25 13:56:58 -07:00
swift-ci
ee0d59cc91 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-24 12:35:16 -07:00
Slava Pestov
8315120eaf Merge pull request #76051 from slavapestov/archetype-get-parent
AST: Remove ArchetypeType::getParent()
2024-08-24 15:31:01 -04:00
Slava Pestov
cf784f980e AST: Remove SubstFlags::AllowLoweredTypes 2024-08-23 13:14:05 -04:00
Slava Pestov
da4d076f02 AST: Introduce SubstFlags::SubstitutePrimaryArchetypes 2024-08-22 18:41:14 -04:00
Arnold Schwaighofer
50156f2bb5 Address review comments 2024-08-22 12:35:26 -07:00
Arnold Schwaighofer
c7b91a9a1b Address review comments 2024-08-22 07:50:52 -07:00
swift-ci
d4e029702d Merge remote-tracking branch 'origin/main' into rebranch 2024-08-21 19:16:12 -07:00
Kavon Farvardin
afe1fa0c09 Merge pull request #75989 from kavon/reflection-fix-existentials
IRGen: metadata for noncopyable exist. metatype
2024-08-21 18:53:36 -07:00
swift-ci
e27edcada1 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-21 16:49:14 -07:00
Slava Pestov
863afad0a2 Merge pull request #75947 from slavapestov/type-subst-rework-2
Type::subst() rework, part 2
2024-08-21 19:31:08 -04:00
Arnold Schwaighofer
ad6f6dec6e IRGen: We cannot call destroy through metadata of private types of non-copyable fields
So call the destroy on the closing type instead.

Amends the concepts areFieldsABIAccessible/isABIAccessible to take metadata
accessibility of non-copyable types into account.

rdar://133990500
2024-08-21 11:22:30 -07:00
Slava Pestov
bbea8ec1a2 AST: Use TypeTransform::transformSubMap() to transform SILBoxType 2024-08-21 13:21:48 -04:00
swift-ci
9db9710585 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-21 09:56:52 -07:00
Kavon Farvardin
cd09269187 IRGen: metadata for noncopyable exist. metatype
Missed a case when determining the strategy to use for obtaining the
metadata for a noncopyable existential metatype. Without this patch,
trying to use a metatype like `any ~Copyable.Type` can cause a crash at
runtime when setting a deployment target that predates Swift 6.0, due to
that runtime not knowing how to demangle inverses.

resolves rdar://134280902
2024-08-21 09:54:26 -07:00
Augusto Noronha
1b2c13b12e Merge pull request #75920 from ellishg/debug-info-verify
[IRGen][DebugInfo] Emit declarations for CFunctionPointer reps
2024-08-21 09:43:08 -07:00
swift-ci
1450e0889d Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 19:16:30 -07:00
swift-ci
b08f7a1307 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 13:58:19 -07:00
Slava Pestov
5577f27661 AST: Opened existential environments store outer substitutions 2024-08-20 16:54:51 -04:00
Slava Pestov
ff308e9510 AST: Remove TypeBase::openAnyExistentialType() 2024-08-20 12:15:27 -04:00
Slava Pestov
0c2f28fd3d AST: Remove GenericSignature parameter from OpenedArchetypeType::get() 2024-08-20 12:15:27 -04:00