Commit Graph

9293 Commits

Author SHA1 Message Date
Slava Pestov
da4d076f02 AST: Introduce SubstFlags::SubstitutePrimaryArchetypes 2024-08-22 18:41:14 -04:00
Erik Eckstein
c96b196ffa SwiftCompilerSources: bridge SILLinkage
Make SILLInkage available in SIL as `SIL.Linkage`.
Also, rename the misleading Function and GlobalVariable ABI `isAvailableExternally` to `isDefinedExternally`
2024-08-22 08:56:27 +02:00
Slava Pestov
271be17491 SIL: Fix SILVerifier for local archetype substitution change
It's up to the client to substitute member types now.
2024-08-21 14:23:38 -04:00
Slava Pestov
b4265020f6 SIL: Use MapLocalArchetypesOutOfContext directly from buildSILFunctionThunkType() 2024-08-21 14:23:38 -04:00
Slava Pestov
39b4bda1dc AST: Introduce SubstFlags::SubstituteLocalArchetypes 2024-08-21 14:23:37 -04:00
Slava Pestov
5577f27661 AST: Opened existential environments store outer substitutions 2024-08-20 16:54:51 -04:00
Slava Pestov
0c2f28fd3d AST: Remove GenericSignature parameter from OpenedArchetypeType::get() 2024-08-20 12:15:27 -04:00
Slava Pestov
66cd708a16 SIL: Compute canonical type earlier 2024-08-17 22:04:15 -04:00
Slava Pestov
0e853a358e Merge pull request #75935 from slavapestov/remove-transform
AST: Replace remaining uses of Type::transform() with transformRec()
2024-08-17 09:11:52 -04:00
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
Augusto Noronha
ae98212c1a Eagerly emit getters at Onone.
Force SILGen to also eagerly emit getters when compiling at Onone.
The reason for this is that getters (even not user-written ones,
generated by result builders) can, and are often called by users
debugging swift programs, and should be available for that reason.

rdar://133329303
2024-08-13 14:53:41 -07:00
Slava Pestov
b601c294ac AST: Replace remaining uses of Type::transform() with transformRec() 2024-08-12 16:05:43 -04:00
Michael Gottesman
f275c27413 Merge pull request #75810 from gottesmm/pr-48fc81afd13a4e0fdcaaa5badf561845da837f6f
Clean up some NDEBUG code errors
2024-08-09 14:20:45 -07:00
Kavon Farvardin
9d69f2bceb Merge pull request #75382 from kavon/static-branch-prediction
Throws Prediction + HotColdSplitting
2024-08-09 15:24:22 -04:00
Michael Gottesman
2e08d6110d Fix SILBasicBlock::{dump,print}ID so that they are available in no-asserts but just print out NOASSERTS instead of a debug id. 2024-08-09 11:10:37 -07:00
Slava Pestov
375363a473 AST: Move global conformance lookup entry points to ConformanceLookup.h 2024-08-08 23:35:58 -04:00
Kavon Farvardin
0cce602bce SIL: branch weights for try_apply's 2024-08-08 21:21:52 -04:00
Akira Hatanaka
e21c117831 [cxx-interop] Use unowned return convention for ObjC methods returning foreign reference types (#75640)
This fixes a runtime crash that occurs when a pointer to a foreign
reference type is passed to objc_retainAutoreleasedReturnValue.

This reverts 335cec0e8d.

rdar://117353222
2024-08-07 21:16:47 -07:00
Slava Pestov
293a36c052 SIL: Pass SubstFlags::PreservePackExpansionLevel in a spot in SILVerifier 2024-08-03 22:40:49 -04:00
Erik Eckstein
50e22f986c SIL: allow atomic operations in @_noLocks functions
https://github.com/swiftlang/swift/issues/74407
2024-08-01 13:38:39 +02:00
Erik Eckstein
bf3b69bba8 SILBuilder: use the new ASSERT macro in the SILBuilder
It's important to catch assert failures in the SILBuilder also in a release build of the compiler
2024-07-31 15:31:03 +02:00
Erik Eckstein
031f23547a SILType: remove the now obsolete aggregateContainsRecord function 2024-07-29 17:33:46 +02:00
Erik Eckstein
4c49e0039b Verifier: in the swift verifier call the bridged C++ verificationFailure function in case of a failure
This brings all the nice verifier features to the swift verifier, like printing the surrounding instructions in case of a failure, etc.
2024-07-29 17:33:43 +02:00
Erik Eckstein
04e0907ab0 SIL: rename Type.instanceTypeOfMetatype -> Type.loweredInstanceTypeOfMetatype
The same for SILType

It needs to be made clear that this is not the "original", but the lowered SIL type.

NFC
2024-07-29 17:33:36 +02:00
Andrew Trick
57374e47ce SILVerifier: allow trivial extend_liveness 2024-07-26 08:27:31 -07:00
Andrew Trick
3316a58ba7 Allow move_value of trivial values.
Required for SIL level local variable scopes.
2024-07-26 08:27:31 -07:00
Andrew Trick
075d3a42c1 Add SILValue::isFromVarDecl utility. 2024-07-26 08:27:31 -07:00
Konrad `ktoso` Malawski
eb675c222e [Distributed] Correct tbd handling for distributed thunks (#74935) 2024-07-26 16:52:18 +09:00
Nate Chandler
cfdbd992cd [Test] Underscored instruction_move_before.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:25 -07:00
Nate Chandler
47a874a322 [Test] Underscored is_lexical.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:25 -07:00
Nate Chandler
3c18f532c7 [Test] Underscored linear_liveness.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:25 -07:00
Nate Chandler
e5a6974edd [Test] Underscored scoped_address_liveness.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:25 -07:00
Nate Chandler
3589246778 [Test] Underscored fieldsensitive_multidefuse_liverange.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:25 -07:00
Nate Chandler
5a93b7d7d5 [Test] Underscored visit_inner_adjacent_phis.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:18 -07:00
Nate Chandler
1fbc526bc8 [Test] Underscored find_borrow_introducers.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:18 -07:00
Nate Chandler
a3922144f6 [Test] Underscored find_enclosing_defs.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:18 -07:00
Nate Chandler
7119b9e713 [Test] Underscored has_pointer_escape.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:18 -07:00
Nate Chandler
bf65f21cc8 [Test] Underscored is_sil_trivial.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:17 -07:00
Nate Chandler
d6071c636b [Test] Underscored get_ownership_kind.
Use underscores rather than hyphens so that text editors understand the
name as a single word.
2024-07-25 13:50:17 -07:00
Becca Royal-Gordon
7dd8914d88 Merge pull request #75431 from beccadax/objcimpl-private-property 2024-07-24 10:46:26 -07:00
Allan Shortlidge
66e2f972ab Merge pull request #75432 from tshortli/maccatalyst-upstream
Upstream missing macCatalyst support
2024-07-24 09:58:04 -07:00
Allan Shortlidge
e4331af916 IRGen: Introduce macCatalyst target variant version check builtins. 2024-07-23 17:00:10 -07:00
Becca Royal-Gordon
9cffd4528d Fix objcImpl SILGen crash with initial value
The initial value expressions of stored properties in objcImpl classes were being incorrectly marked as serializable. As a result, the compiler would crash with a SIL verification failure if one of them called a non-public function or initializer.

Fix this problem by not marking these initial value expression functions as serializable. Code in other modules should not call them anyway, since they think of the class as a pure ObjC class.

Fixes rdar://114874429.
2024-07-23 16:17:30 -07:00
Nate Chandler
812891cf81 [NFC] PrunedLiveness: Clarified boundary API.
When checking whether an instruction is contained in a liveness
boundary, a pointer to a DeadEndBlocks instance must always be passed.
When the pointer is null, it is only checked that the instruction occurs
within the direct live region.  When the pointer is non-null, it is
checked whether the instruction occurs within the region obtained by
extending the live region up to the availability boundary within
dead-end regions that are adjacent to the non-lifetime-ending portion of
the liveness boundary.
2024-07-23 13:38:35 -07:00
Nate Chandler
e0da318129 [PrunedLiveness] Fix extended boundary check.
The areUsesWithinBoundary/areUsesOutsideBoundary methods take the
dead-ends because the region that they're checking for containment
within contains more than just (is a (non-strict) superset of) the
pruned live region.  On the other hand, the region also contains _less_
than (is a (non-strict) subset of) the available region.  Instructions
are in this extended region only if they're in a dead-end block which is
forwards reachable from the non-lifetime-ending liveness boundary.
2024-07-22 21:51:34 -07:00
Mykola Pokhylets
816d62c972 Merge remote-tracking branch 'upstream/main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/SILGen/SILGenDestructor.cpp
#	test/Concurrency/flow_isolation.swift
#	test/abi/macOS/arm64/concurrency.swift
#	test/abi/macOS/x86_64/concurrency.swift
2024-07-11 13:11:59 +02:00
Mykola Pokhylets
485965a759 Reviewed code comments. Fixed typos and addressed some TODOs 2024-07-11 13:09:06 +02:00
Mykola Pokhylets
28a06feaad Added isolated deallocator to TBDGen 2024-07-11 13:09:06 +02:00
Mykola Pokhylets
d7248e3acf Fixed linkage logic for isolated deallocating deinit 2024-07-11 13:09:06 +02:00
Mykola Pokhylets
d4e449b62d SILGen for isolated deinit 2024-07-11 13:09:05 +02:00