Commit Graph

22 Commits

Author SHA1 Message Date
Doug Gregor
9579390024 [SE-0304] Rename ConcurrentValue to Sendable 2021-03-18 22:48:20 -07:00
Doug Gregor
866a8d8944 Introduce checking for ConcurrentValue conformance across actors.
When referring to an actor-isolated declaration from outside of the
actor, ensure that the types involved conform to the `ConcurrentValue`
protocol. Otherwise, produce a diagnostic stating that it is unsafe to
pass such types across actors.

Apply the same rule to local captures within concurrent code.
2021-02-03 17:37:43 -08:00
Doug Gregor
5d43c8705a Update test case 2021-01-06 15:17:50 -08:00
Doug Gregor
3a651a61b7 [Concurrency] Fix circular reference on isolation propagation. 2020-10-13 22:57:06 -07:00
Robert Widmann
3cee2af345 Remove Cascading Verification from the Dependency Verifier`
Now that the frontend no longer produces these edges, we do not need to assert about them.
2020-09-21 14:47:39 -06:00
Robert Widmann
1b7c713820 [NFC] Only Register Primaries As Dependency Sources
Now that the top-level source file is the only dependency source that
matters, the only case that matters is when request evaluation enters
a primary file. For non-primaries, there will be no corresponding
swiftdeps file to emit references into, so we're just wasting time and
memory keeping track of anything that happens there.

This is only possible after we removed cascading dependencies because
unqualified lookups had to be charged to the files they originated in.
Now, we charge those lookups to the primary that initiated the request.
2020-09-21 10:42:33 -06:00
Robert Widmann
78e78a23c4 Drop Legacy Tests 2020-09-21 10:42:33 -06:00
Doug Gregor
ae4fbb6716 [AST] Generalize and rename ClassDecl::getEmittedMembers()
Generalize `ClassDecl::getEmittedMembers()` to operate on an
`IterableDeclContext`, so that it can be for other nominal types,
extensions, etc. Rename to `getSemanticMembers()` to indicate that
these are all of the members that are semantically part of that
context.

Clean up the implementation slightly so it only forces type checking
for the conformances within that particular context (using
`getLocalConformances()`) and doesn't need to list out each of the
protocols it cares about.
2020-09-01 13:01:10 -07:00
tbkka
421ebd2788 [Python3] Fix "undefined symbol 'unicode'" from python_lint (#33146)
* [Python3] Fix "undefined symbol 'unicode'" from python_lint

This is a little tricky.

Python 2 "unicode" was renamed to "str" in Python 3.

For Python 2 compatibility, we need to use "unicode" in a couple
of places, but that's not defined on Python 3, which causes
python_lint errors (even if the reference is never actually executed).

To workaround this, when running in Python 3, define "unicode"
as a synonym for "str".  This defines the symbol (avoiding the
"undefined symbol" error from python lint) while preserving
the correct functionality on both Python 2 and Python 3.

When we drop Python 2 support (which we should do as soon as
possible), we can drop this workaround and globally replace
"unicode" with "str" to get the right Python 3-only functionality.
2020-07-28 11:47:25 -07:00
tbkka
12b7f94c94 [Python3] Lint fix (#33099)
Remove redundant import
2020-07-25 11:16:23 -07:00
Saleem Abdulrasool
112af9e571 test: adjust style for python linter (NFC)
Reflow some text to appease the python linter.
2020-06-29 13:26:35 -07:00
Saleem Abdulrasool
12f4db3933 test: make gen-output-file-map Python 3 friendly
Adjust `gen-output-file-map.py` to be friendly to Python 3 by using
`io.open` instead of `open`.  This allow the use of `encoding` and
`newline` named parameters to write out files using UTF-8 encoded, UNIX
newline delimited files.
2020-06-29 13:24:46 -07:00
Robert Widmann
3228a5903a [NFC] Rename Flags
-enable-experimental-private-intransitive-dependencies -> -enable-direct-intramodule-dependencies
-disable-experimental-private-intransitive-dependencies -> -disable-direct-intramodule-dependencies

While we're here, rename DependencyCollector::Mode's constants and clean
up the documentation.
2020-06-09 16:00:59 -07:00
Robert Widmann
fdf31c88a6 Add Flags to Enable or Disable EnableExperientalPrivateIntransitiveDependencies
Turn the existing flag into an on-off switch and migrate all the tests in preparation for it being on by default
2020-06-09 12:24:57 -07:00
Robert Widmann
975ff757bc Perform The Dependency Unioning Step During Replay
In order for private dependencies to be completely correct, it must perform the name lookup unioning step when a cached request is replayed - not just when lookups are first performed. In order to reduce the overhead of this union operation, it is not necessary to walk the entire active request stack, just walk to the nearest cached request in the stack and union into that. When it is popped, its replay step will itself union into the next cached request.

To see why, consider a request graph:

A* -> B -> C*
         |
          -> D*

where A, C, and D are cached.

If a caller were to force C and D, then force A independenty, today we would *only* replay the names looked up by C and D the first time A was evaluated. That is, subsequent evaluations of A do not replay the correct set of names. If we were to perform the union step during replay as well, requests that force A would also see C and D’s lookups.

Without this, callers that force requests like the DeclChecker have to be wary of the way they force the interface type request so other files see the right name sets.

rdar://64008262
2020-06-05 11:42:29 -07:00
Robert Widmann
0215e373bc Add Verifier Tests for A Tricky Typealias Miscompile 2020-06-04 20:17:46 -07:00
Robert Widmann
ddaa3be2a3 Verify The Entire Compilation Session
The old tests were just running the type checker because we used to only emit reference dependencies after Sema. Now that we emit them after the pipeline has run, let's upgrade these tests to capture these new references.
2020-06-04 18:27:19 -07:00
Doug Gregor
8e0ec601db Merge pull request #32005 from DougGregor/function-builder-infer
[Function builders] Infer function builder from a protocol requirement.
2020-05-26 10:59:42 -07:00
Doug Gregor
5d9d4f9434 [Tests] Add newly-introduced dependencies to the incremental verifier. 2020-05-25 13:39:17 -07:00
Robert Widmann
537c3867d7 Use the New Evaluator-Based Dependency Enumerator in the Dependency Verifier 2020-05-21 18:54:14 -07:00
Robert Widmann
b06211eac4 Initial plumbing for private dependencies
Add a mode bit to the dependency collector that respects the frontend flag in the previous commit.

Notably, we now write over the dependency files at the end of the compiler pipeline when this flag is on so that dependency from SILGen and IRGen are properly written to disk.
2020-05-05 13:48:25 -07:00
Robert Widmann
8aede31c2c [Gardening] Reshuffle Some Tests
Move reference dependency tests out of NameLookup and into
Incremental/Dependencies. These tests will need to be specialized for
the upcoming private dependencies code.
2020-05-05 10:55:58 -07:00