Commit Graph

88033 Commits

Author SHA1 Message Date
Nate Chandler
8c48ca2e8c [OpaqueValues] Addr-only consumes emit loadably. 2023-08-22 11:18:44 -07:00
Doug Gregor
e7a5887fec Merge pull request #68057 from DougGregor/fileprivate-extension-macros 2023-08-22 09:13:02 -07:00
Slava Pestov
15c4822495 Merge pull request #68055 from slavapestov/rdar113943346
RequirementMachine: Fix potential 'pollution' from installing an invalid requirement machine
2023-08-22 08:56:04 -04:00
Doug Gregor
323561b157 [Macros] Use outermost source file for establishing (file)private access scope
Fixes rdar://114048069.
2023-08-21 22:01:19 -07:00
nate-chandler
1f05436a99 Merge pull request #68049 from nate-chandler/opaque-values/20230821/1/all-local-archetypes
[AddressLowering] Consider opening instructions of all local archetypes.
2023-08-21 20:55:25 -07:00
Slava Pestov
595a7a530b RequirementMachine: Fix potential 'pollution' from installing an invalid requirement machine
If the substitution terms of a concrete type symbol contain unresolved
name symbols, we have an invalid requirement that is dropped from the
minimized signature. In this case, the rewrite system used for minimization
cannot be installed as the official rewrite system for this generic
signature, because building a rewrite system from the signature will
produce a different result.

This might be the cause of the crash in rdar://114111159.
2023-08-21 23:36:37 -04:00
Pavel Yaskevich
4ba01733cd Merge pull request #67769 from xedin/rdar-113421273
[TypeChecker] InitAccessors: Fix default initialization of init accessor properties
2023-08-21 14:25:47 -07:00
Nate Chandler
efc9c6df10 [AddressLowering] Consider all local archetypes.
When determining where the "latest opening instruction" is, consider not
just `OpenedArchetypeType`s but any `LocalArchetypeType` which includes
`PackArchetypeType`s.
2023-08-21 13:46:11 -07:00
Artem Chikin
871118e827 Merge pull request #67928 from artemcm/DoNotCountOverlayDepsAsDirect
[Dependency Scanning] Remove Swift Overlay dependencies from the set of direct dependencies
2023-08-21 11:52:02 -07:00
Hamish Knight
535a5c67b6 Merge pull request #68037 from hamishknight/tracing-paper 2023-08-21 19:45:49 +01:00
Egor Zhdan
1f676071a1 Merge pull request #67865 from apple/egorzhdan/cfoptions
[cxx-interop] Import custom `NS_OPTIONS` correctly
2023-08-21 17:48:26 +01:00
Pavel Yaskevich
416bbaec8d [TypeChecker] InitAccessors: Fix handling of defaultable init accessor properties during default init synthesis
Default initializable init properties shouldn't prevent default
init synthesis and such properties without anything to initialize
should be considered by it.
2023-08-21 09:05:26 -07:00
Pavel Yaskevich
2149a4630a [DI] InitAccessors: Ignore unreachable blocks when check property initialization inside of an init accessor 2023-08-21 09:04:34 -07:00
Pavel Yaskevich
645e8df6bd [TypeChecker] InitAccessors: Synthesize default init for init accessor properties
Fixes a bug were default initializer for an init accessor property
hasn't been synthesized even when the property is marked as default
initializable.

Resolves: rdar://113421273
2023-08-21 09:04:34 -07:00
Pavel Yaskevich
1542bb5a71 Merge pull request #67763 from xedin/rdar-113412104
[DI] Properties with init accessors without "initializes" act as stored
2023-08-21 09:03:43 -07:00
Hamish Knight
7982e4bd7e [AST] Handle null in printDeclDescription
Sink down the null Decl printing into
`printDeclDescription` such that all callers
benefit from it.

This is an attempt at fixing at least the secondary
crash in rdar://113491294, it does not address the
underlying crash.
2023-08-21 15:35:16 +01:00
Doug Gregor
df2e2eee30 Merge pull request #68028 from DougGregor/supersede-pre-macro-expansion-implied-conformances
Always supersede conformances implied by pre-macro-expansion conformances
2023-08-20 21:41:36 -07:00
Michael Gottesman
361562aef5 [consume-operator] Emit a better error message when failing to consume globals or escaping captures.
Specifically, we previously emitted a "compiler doesn't understand error", so we
were always emitting an error appropriately. This just gives a better error
message saying instead that the compiler did understand what happened and that
one cannot apply consume to globals or escaping captures.

https://github.com/apple/swift/issues/67755
rdar://112561671
2023-08-20 18:59:37 -07:00
Doug Gregor
ab576b31a7 Always supersede conformances implied by pre-macro-expansion conformances
Pre-macro-expansion conformances are introduced at the point where an
attached extension macro is attached to a particular nominal type, and
can imply other conformances. Once the macro is expanded, they are
expected to be replaced by the real conformance from the extension
produced by the macro. This includes any other conformances that are
implied by that conformances. Ensure that the real conformance---and
every conformances it implies---are considered "better" than the
pre-expansion conformances.

Fixes a bug where we would pick the wrong (pre-expansion)
conformances, which would then fail to get fully type-checked prior to
serialization. This could accept invalid code that then crashed the
compiler, as in rdar://112916159.
2023-08-20 09:27:38 -07:00
Michael Gottesman
36d333cd0c Merge pull request #68024 from gottesmm/pr-41b9d05e5b76061c0db11b5507cf80af25fc6dbe
[silgen] Hide ManagedValue::forUnmanaged and rewrite all uses to use more specific APIs
2023-08-19 20:39:22 -07:00
Ben Barham
ec485ba433 Merge pull request #67954 from bnbarham/do-not-depend-on-stringmap-iteration
[Index] Write stdlib records in alphabetical order
2023-08-19 17:46:47 -07:00
Michael Gottesman
8cfb3d238f [silgen] Cleanup a few Cleanups dump output. 2023-08-19 14:11:44 -07:00
Michael Gottesman
7c5c548968 [silgen] Fix PartialDestroyPackCleanup dumping output to handle LimitWithinComponent to be nullptr. 2023-08-19 14:11:44 -07:00
Michael Gottesman
543063ef0e [silgen] Make ManagedValue::forUnmanaged private and change users to use other more specific APIs.
I have been doing this over the past couple of days in preparation for changing
ManagedValue to specify the type of scope its cleanup is connected to.
2023-08-19 14:11:44 -07:00
Michael Gottesman
104379adab [silgen] Rename SILGenFunction::emitManagedRetain -> emitManagedCopy.
This is an old API that should have been renamed a long time ago. It just kept
its early name due to inertia.
2023-08-19 14:11:44 -07:00
Allan Shortlidge
b234b79b31 Merge pull request #68021 from tshortli/experimental-lazy-typecheck
Frontend: Introduce -experimental-lazy-typecheck action
2023-08-19 09:30:10 -07:00
Alejandro Alonso
d04d8c1c49 Merge pull request #68001 from Azoy/raw-deserialize
[Sema] Fix raw layout deserialization
2023-08-19 08:55:56 -07:00
Sophia Poirier
aec59f2f9c Merge pull request #67974 from sophiapoirier/global-static-data-race-safety
enforce under strict concurrency that globals and statics be either…
2023-08-19 08:28:02 -07:00
Alejandro Alonso
dadbbb4d02 Fix raw layout deserialization
Update raw_layout.swift
2023-08-18 20:36:27 -07:00
Ben Barham
5cdc7db420 [Index] Write stdlib records in alphabetical order
The order for writing records of the stdlib currently depends on
`StringMap` iteration (in a slightly roundabout manner). Sort these
alphabetically instead.
2023-08-18 19:38:26 -07:00
swift-ci
978395bc11 Merge pull request #62959 from meg-gupta/simplifycfgossapr3
Migrate simple and dominator based jump threading to OSSA
2023-08-18 17:18:10 -07:00
Artem Chikin
392bbfd72d Merge pull request #68011 from artemcm/ConstExtractTypeAliasUnderlyingType
[Compile Time Constant Extraction] Emit underlying types for typealias types
2023-08-18 16:40:45 -07:00
Allan Shortlidge
54435aca4f Frontend: Introduce -experimental-lazy-typecheck action.
This action is currently just an alias of the `-resolve-imports` action.
However, it's named to more clearly reflect the purpose which is to do the
minimal typechecking needed in order to emit the requested outputs. This mode
is intended to improve performance when emitting `.swiftinterface` and `.tbd`
files.
2023-08-18 16:15:33 -07:00
Artem Chikin
753d54576e Merge pull request #67994 from artemcm/NoPostSerializationOptimizationForExplicitInterface
Enable `StopOptimizationAfterSerialization` SIL Option for explicit `-compile-module-from-interface` tasks
2023-08-18 15:40:28 -07:00
Konrad `ktoso` Malawski
c7538c07c7 Merge pull request #68006 from ktoso/wip-null-witness-executor
[Executors] tryDiagnoseExecutor must survive null witness, when using Backdeploy library
2023-08-19 07:33:44 +09:00
Sophia Poirier
936ab20e5d enforce under strict concurrency that globals and statics be either isolated to a global actor or Sendable plus immutable
rdar://81629027 Global and static variable data-race safety
2023-08-18 15:08:42 -07:00
Allan Shortlidge
0c957a2090 Merge pull request #68009 from tshortli/deprecate-warn-on-potentially-unavailable-enum-case
Frontend: Deprecate -warn-on-potentially-unavailable-enum-case option
2023-08-18 12:37:46 -07:00
Slava Pestov
c2f1193ae3 Merge pull request #67952 from slavapestov/tuple-conformance-tbd-etc
A pile of mostly unrelated one-liners
2023-08-18 15:31:26 -04:00
Artem Chikin
faa9751c37 [Compile Time Constant Extraction] Emit underlying types for typealias types
Resolves rdar://113402135
2023-08-18 10:44:46 -07:00
Allan Shortlidge
be70c568cb Frontend: Deprecate -warn-on-potentially-unavailable-enum-case option.
When `-warn-on-potentially-unavailable-enum-case` was introduced, the build
system was required to invoke `swift-frontend` at artificially low deployment
targets when emitting `.swiftinterface` files for legacy architectures. Because
the deployment target was low, some availability diagnostics needed to be
de-fanged in order to allow module interface emission to succeed. Today, the
build system is able to use the correct deployment target when emitting module
interfaces and the `-warn-on-potentially-unavailable-enum-case` is superfluous,
so deprecate it.

Resolves rdar://114092047
2023-08-18 10:02:39 -07:00
Slava Pestov
bea1ba412a AST: Add breadcrumb for crashes in GenericFunctionType canonicalization 2023-08-18 12:13:23 -04:00
Slava Pestov
212b10a7fc TBDGen: Pass useResolver=true to forEachValueWitness() 2023-08-18 12:12:50 -04:00
Slava Pestov
30ec935b81 TBDGen: Use IterableDeclContext::getABIMembers() instead of getMembers() 2023-08-18 12:12:50 -04:00
Slava Pestov
90562a0fe9 IRGen: Fix linkage of opaque type descriptor with @_alwaysEmitIntoClient owner decl 2023-08-18 12:12:50 -04:00
Slava Pestov
eadffd3c6c AST: Don't look at PatternBindingDecl in usesBuiltinType()
Type-checking patterns is not fully requestified, so the
ASTPrinter should not assume this has been filled in.

It appears sufficient to just visit the associated VarDecl,
as we do already.
2023-08-18 12:12:50 -04:00
Slava Pestov
010415f4f3 Sema: Force destructor synthesis in evaluateMembersRequest() 2023-08-18 12:12:50 -04:00
Slava Pestov
99d68ba14c IRGen: Some progress toward tuple conformances 2023-08-18 12:12:50 -04:00
zachary0kent
802e63a778 Merge pull request #67973 from zachary0kent/lazy-immediate-globals
[Immediate] JIT'ing Globals
2023-08-18 08:53:18 -07:00
Egor Zhdan
46f86f0870 [cxx-interop] Import custom NS_OPTIONS correctly
This changes the heuristic that we use to detect `CF_OPTIONS`/`NS_OPTIONS` instantiations in C++ language mode.

Since libraries sometimes declare custom option types that break the assumptions about the names of such types, this lifts the requirements on the type name.

rdar://113524090
rdar://113279214
2023-08-18 15:41:50 +01:00
Konrad `ktoso` Malawski
13605b8285 [Executors] isStdlibDefaultImplDecl must guard from null values, coming from Backdeploy library
resolves rdar://114029779
2023-08-18 23:07:56 +09:00