Commit Graph

2727 Commits

Author SHA1 Message Date
Mykola Pokhylets
f04f1de75e Fixed some typos 2024-07-11 13:09:07 +02:00
Mykola Pokhylets
95079aff06 Don't generate isolating destructor if dealloc was explicitly isolated in ObjC 2024-07-11 13:09:06 +02:00
Mykola Pokhylets
10ee94885e Generating errors when isolation of the subclass deinit is not compatible with superclass deinit 2024-07-11 13:09:05 +02:00
Ellie Shin
18681c43fb Drop experimental prefixes from PackageCMO flags.
Deprecate experimental- flags with prompts to use the proper flags.

rdar://131498517
2024-07-10 16:19:16 -07:00
Meghana Gupta
154989463b Add support for lifetime dependence in parameter position 2024-07-10 14:20:03 -07:00
Pavel Yaskevich
65fb35c3bd Revert "Convert ActorIsolationRequest to use split caching"
There are a few spots in `ActorIsolationRequest` that produce
`unspecified` isolation with `preconcurrency` bit set and diagnostics
rely on that to make downgrade decisions in Swift 5 mode.

This reverts commit 0097ef68a6.
2024-07-09 13:34:25 -07:00
Slava Pestov
4c7ca3ea72 Convert ApplyAccessNoteRequest to use separate caching 2024-07-06 23:36:00 -04:00
Slava Pestov
ec28d62d61 Convert AttachedPropertyWrappersRequest to use split caching 2024-07-06 23:36:00 -04:00
Slava Pestov
6489b60f8a Convert DynamicallyReplacedDeclRequest to use split caching 2024-07-06 23:36:00 -04:00
Slava Pestov
010ddfc816 Convert LifetimeDependenceInfoRequest to use split caching 2024-07-06 23:36:00 -04:00
Slava Pestov
0097ef68a6 Convert ActorIsolationRequest to use split caching 2024-07-06 23:36:00 -04:00
Slava Pestov
6b9267aaac Convert ExpandPeerMacroRequest to use split caching 2024-07-06 23:35:59 -04:00
Slava Pestov
edf8237df2 Convert SPIGroupsRequest to use split caching 2024-07-06 23:35:59 -04:00
Slava Pestov
80ddc3275f Convert PropertyWrapperAuxiliaryVariablesRequest to use split caching 2024-07-06 23:35:59 -04:00
Slava Pestov
9d163c4139 Convert GlobalActorAttributeRequest to use split caching 2024-07-06 23:35:59 -04:00
Slava Pestov
8a92c9cfc5 Convert ExpandMemberAttributeMacros to use split caching 2024-07-06 23:35:59 -04:00
Hamish Knight
0f30a1ab35 [Completion] Handle body macro attribute completion
Add support for function-attached macros, and
complete body and preamble macros in those
positions.

rdar://130740590
2024-07-02 09:44:32 +01:00
Ben Barham
d8f381e660 Merge pull request #74804 from bnbarham/rename-equals
Update `StringRef::equals` references to `operator==`
2024-06-28 11:22:20 -07:00
Ben Barham
d72f5b12c4 Update StringRef::equals references to operator==
`equals` has been deprecated upstream, use `operator==` instead.
2024-06-27 19:14:06 -07:00
Kavon Farvardin
4b98498bf2 Merge pull request #74672 from kavon/post-vacation-misc-cleanups
Handful of small NoncopyableGenerics fixes / cleanups.
2024-06-25 18:35:40 -07:00
Slava Pestov
17a6a80204 AST: Use separate caching for ProtocolDecl::getAllInheritedProtocols() 2024-06-25 15:20:42 -04:00
Kavon Farvardin
80c99973d7 NFC: introduce isAddingConformanceToInvertible
Removes duplicated code between Sema and the ASTPrinter.
2024-06-24 15:34:58 -07:00
Meghana Gupta
470fa2f365 Remove resultDependsOn/resultDependsOnSelf 2024-06-05 11:36:16 -07:00
Doug Gregor
525e245e0a Merge pull request #73909 from DougGregor/let-instance-property-mutability-fix
Ensure that we do not turn rvalues into lvalues
2024-05-24 22:34:58 -07:00
Doug Gregor
d051b62676 Ensure that we do not turn rvalues into lvalues
The computation that determined whether an access to a `let` instance
property within a constructor should be an initialization conflated the
cases of "we don't have a base expression" and "the base expression is
not something that could be `self`", and incorrectly identified rvalue
bases as being "initializable". Make the interface properly separate
out these cases, so we don't turn an lvalue into an rvalue access.

Fixes rdar://128661833.
2024-05-24 18:22:04 -07:00
Ellie Shin
c0720d5fb3 Merge pull request #73686 from apple/elsh/ir-global-accessor
Fix global accessor and class linker errors in package.
2024-05-21 22:59:10 -07:00
Ellie Shin
063d159d1b Rename isFragile() as isStrictlyResilient() in var decl.
Add isStrictlyResilient() to nominal type and module decl.
2024-05-21 18:25:10 -07:00
Becca Royal-Gordon
d9912009b0 Merge pull request #73309 from beccadax/objcimpl-category-on-objc 2024-05-21 10:19:14 -07:00
Ellie Shin
80855c872b Fix global accessor and class linker errors.
Add global accessors to symbol list if VarDecl is fragile, i.e.
is non-resilient or its defining module allows non-resilient
access.

Don't set the class decl to hidden if it's in a package resilience
domain; even though its defining module is built resilently, the
class symbol should be visible across modules if they are in the
same package with resilience-bypass optimization. In such case,
treat its SubclassScope to Internal.

Resolves rdar://127321129
2024-05-20 14:39:37 -07:00
Becca Royal-Gordon
cf541c1da9 [NFC] Hoist getAttributeInsertionLoc() up to Decl
This functionality was previously reserved for ValueDecls. Move it all the way up to Decl; in the process, make it correctly handle EnumElementDecls and EnumCaseDecls.

This change also allows us to generalize `swift::fixDeclarationObjCName()` to work on extensions, though we do not use that capability in this commit.
2024-05-16 18:05:23 -07:00
Becca Royal-Gordon
07b9fe9ce6 Support @objc(CustomName) on extensions
This now specifies a category name that’s used in TBDGen, IRGen, and PrintAsClang. There are also now category name conflict diagnostics; these subsume some @implementation diagnostics.

(It turns out there was already a check for @objc(CustomName) to make sure it wasn’t a selector!)
2024-05-16 13:40:13 -07:00
Michael Gottesman
e3e78ad6bb [sending] Change the internals of sending to be based around 'sending' instead of 'transferring'.
We still only parse transferring... but this sets us up for adding the new
'sending' syntax by first validating that this internal change does not mess up
the current transferring impl since we want both to keep working for now.

rdar://128216574
2024-05-16 12:20:45 -07:00
Doug Gregor
b641c54ee2 Generalize AbstractStorageDecl::isSettable() to return a three-state value
This operation determines whether a particular storage declaration,
when accessed from a particular location, is mutable or not. It has a
particular semantic that `let` declarations, when accessed from an
initializer, are considered mutable even though they can only be
assigned. There is similar logic for init accessors.

Tease apart "truly mutable" from "initializable because we're in an
initializer", introducing AbstractStorageDecl::mutability() to
represent all three states. isSettable() remains available as a thin
shim over mutability() and all clients are unchanged thus far, making
this a no-op refactoring.
2024-05-14 14:35:11 -07:00
Slava Pestov
7e36060331 AST: Remove VarDecl::getOpenedElementEnvironment() 2024-05-10 17:21:17 -04:00
Becca Royal-Gordon
c3225b066e [NFC] Merge two category name accessors 2024-05-01 12:18:19 -07:00
Ellie Shin
3f047102c2 Merge pull request #72937 from apple/elsh/pkg-sil-verify
Add a package serialization bit to Module for SIL verifier in Package CMO mode.
2024-04-22 12:44:28 -07:00
Slava Pestov
e342a38b87 Sema: Convert TypeChecker::computeCaptures() into two requests
We now compute captures of functions and default arguments
lazily, instead of as a side effect of primary file checking.

Captures of closures are computed as part of the enclosing
context, not lazily, because the type checking of a single
closure body is not lazy.

This fixes a specific issue with the `-experimental-skip-*` flags,
where functions declared after a top-level `guard` statement are
considered to have local captures, but nothing was forcing these
captures to be computed.

Fixes rdar://problem/125981663.
2024-04-20 22:16:25 -04:00
Slava Pestov
55ff73f205 AST: Stronger assertions around CaptureInfo 2024-04-19 17:59:58 -04:00
Anthony Latsis
4af5140d8b Merge pull request #70579 from AnthonyLatsis/super-sema
Move unsupported `super` use diagnosis from Parse to Sema
2024-04-19 20:07:12 +03:00
Anthony Latsis
fa6924a34e ParamDecl: Defend against default argument kind overwrites 2024-04-19 16:57:05 +03:00
Anthony Latsis
1d3a5860e2 [NFC] ParamDecl: Extract write of type-checked default expr into its own method 2024-04-19 16:57:05 +03:00
Anthony Latsis
61bdbd2fe3 Move unsupported super use diagnosis form Parse to Sema 2024-04-19 16:57:04 +03:00
Slava Pestov
3e637b0afb Merge pull request #73129 from slavapestov/local-function-isolation-change
Local functions inherit isolation from context instead of captures
2024-04-19 08:32:46 -04:00
Slava Pestov
d222470a0b AST: Remove unused methods from CaptureInfo 2024-04-18 22:47:23 -04:00
Ellie Shin
0c0d8c0316 Merge branch 'main' into elsh/pkg-sil-verify 2024-04-18 13:34:29 -07:00
nate-chandler
b00b5aad4f Merge pull request #72646 from nate-chandler/bitwise-copyable/20240327/1
[BitwiseCopyable] Allow suppression via ~.
2024-04-18 07:05:10 -07:00
Ellie Shin
45e8454a9e Merge branch 'main' into elsh/pkg-sil-verify 2024-04-17 22:46:55 -07:00
Ellie Shin
fbb3382e21 During Package CMO, SIL cloning happens during which
SILOptions::EnableSerializePackage info is lost.

SILVerifier needs this info to determine whether resilience
can be bypassed for decls serialized in a resiliently
built module when Package CMO optimization enabled.

This PR adds SerializePackageEnabled bit to Module format
and uses that in SILVerifier.

Resolves rdar://126157356
2024-04-17 22:37:48 -07:00
Allan Shortlidge
bd59db6e15 AST: Refactor missing import diagnostic into standalone utility.
NFC.
2024-04-16 16:29:51 -07:00
Nate Chandler
ba467d2bd2 [Sema] Enable suppression of inferred conformances.
Add the machinery to support suppression of inference of conformance to
protocols that would otherwise be derived automatically.

This commit does not enable any conformances to be suppressed.
2024-04-15 16:46:22 -07:00