Commit Graph

7248 Commits

Author SHA1 Message Date
Alex Hoppen
edfd3fde38 Merge pull request #64506 from ahoppen/ahoppen/no-begin-end-completions
[IDE] Remove "Begin completions" and "End completions" from test cases
2023-03-22 17:21:37 -07:00
Alex Hoppen
32eff21977 [IDE] Remove "Begin completions" and "End completions" from test cases
These test lines weren't actually providing any value and were annoying to write. Let's jut remove them.
2023-03-22 09:07:17 -07:00
Anthony Latsis
c9b1071456 Merge pull request #64428 from AnthonyLatsis/xcode-gen-opt
build-script: Don't build LLVM testing tools when generating Xcode projects
2023-03-20 20:32:57 +03:00
Guillaume Lessard
d6a02682ad Merge pull request #64393 from glessard/rdar106656555-slowtest
[test] fix compilation performance issues in validation-test/stdlib/UnsafeBufferPointerSlices.swift
2023-03-17 10:22:07 -07:00
Anthony Latsis
e8be44d14e Merge pull request #64324 from AnthonyLatsis/cse-open-exist
SILOptimizer: Fix some issues with CSE of `open_existential_ref`
2023-03-17 17:26:09 +03:00
Allan Shortlidge
ca5acf3255 Merge pull request #64412 from tshortli/relax-unsafe-main-actor-availability-checking
Sema: Relax availability checking for `@MainActor`
2023-03-16 19:38:31 -07:00
Pavel Yaskevich
26c0d0a0c9 Merge pull request #64433 from xedin/remove-old-result-builder-impl
[BuilderTransform] NFC: Remove original result builder implementation
2023-03-16 16:12:53 -07:00
Allan Shortlidge
fb03b4aa04 Sema: Relax availability checking for @MainActor.
The `@MainActor` global actor constraint on a declaration does not carry an
inherent ABI impact and therefore use of this constraint should not be limited
to OS versions where Swift concurrency is available.

Resolves rdar://105610970
2023-03-16 14:23:36 -07:00
Saleem Abdulrasool
f8aaf18093 Merge pull request #64419 from mhjacobson/freebsd-implement-POSIXErrorCode
stdlib: implement POSIXErrorCode for FreeBSD
2023-03-16 11:14:56 -07:00
Anthony Latsis
f94f401a06 build-script: Don't build LLVM testing tools when generating Xcode projects 2023-03-16 20:58:14 +03:00
Matt Jacobson
2febbb4aaf stdlib: implement POSIXErrorCode for FreeBSD
It shares many of the same values as OpenBSD (which both inherited from 4.4BSD),
and we wouldn't expect those to diverge due to the respective platforms'
bincompat goals.
2023-03-16 01:20:56 -04:00
Pavel Yaskevich
36c61bdd3e [Tests] NFC: Remove ResultBuilderASTTransform references from tests 2023-03-15 14:29:04 -07:00
Guillaume Lessard
a441756ff4 [test] re-enable test/stdlib/UnsafeBufferPointerSlices 2023-03-15 10:54:24 -07:00
Guillaume Lessard
c5a59054d6 [test] simplify needlessly complex test expressions 2023-03-15 10:51:19 -07:00
Alejandro Alonso
09b1476ddf Stop building Reflection 2023-03-14 11:49:38 -07:00
Pavel Yaskevich
52f9d845da [Tests] NFC: Adjust REQUIRES declaration for UnsafeBufferPointerSlices validation test 2023-03-14 11:16:16 -07:00
Alejandro Alonso
0fd1fde7c3 Merge pull request #64352 from Azoy/disable-ubps
[Test] Disable UnsafeBufferPointerSlices.swift to unblock CI
2023-03-14 09:48:42 -07:00
Alejandro Alonso
b1107e4a3d Update UnsafeBufferPointerSlices.swift 2023-03-14 09:47:34 -07:00
Allan Shortlidge
4058ad1421 AST: Improved inferred availability accuracy.
Previously, when creating availability attributes for synthesized declarations
we would identify some set of reference declarations that the synthesized
declaration should be as-available-as. The availability attributes of the
reference declarations would then be merged together to create the attributes
for the synthesized declaration. The problem with this approach is that the
reference declarations themselves may implicitly inherit availability from their
enclosing scopes, so the resulting merged attributes could be incomplete. The
fix is to walk though the enclosing scopes of the reference declarations,
merging the availability attributes found at each level.

Additionally, the merging algorithm that produces inferred availability
attributes failed to deal with conflicts between platform specific and platform
agnostic availability. Now the merging algorithm notices when platform agnostic
availability should take precedence and avoids generating conflicting platform
specific attributes.

Resolves rdar://106575142
2023-03-13 18:27:03 -07:00
Anthony Latsis
d650ce47f3 SILOptimizer: Fix some issues with CSE of open_existential_ref
* A direct user might have a dependent result
* An indirect user can also be a terminator instruction
2023-03-13 21:41:02 +03:00
eeckstein
d154dfda60 Merge pull request #64204 from eeckstein/fix-dce
SILOptimizer: fix a stack overflow in DCE
2023-03-08 17:50:07 +01:00
Erik Eckstein
ca14a08f09 tests: disable many_trys.swift for iOS
For some reason this test times out sometimes when bulding for iOS

rdar://106375480
2023-03-08 12:55:43 +01:00
Erik Eckstein
b741aa0018 SILOptimizer: fix a stack overflow in DCE
For very large control flow graphs the markControllingTerminatorsLive can stack overflow.
Fix this by doing the work iteratively instead of recursively.

rdar://106198943
2023-03-08 12:20:45 +01:00
Mishal Shah
e256b56545 Merge branch 'main' into rebranch 2023-03-02 18:25:09 -08:00
swift-ci
8dac45ed0d Merge pull request #63725 from phausler/pr/observation
Observation and associated macros
2023-03-02 18:02:14 -08:00
Andrew Trick
f1ff6958a3 Merge pull request #63825 from atrick/diagnose-implicit-raw-bitwise
Warn on implicit pointer conversion from nontrivial inout values.
2023-03-02 10:57:30 -08:00
Ben Barham
59afba5bf9 Manually merge branch 'main' into rebranch 2023-03-01 14:13:50 -08:00
Pavel Yaskevich
08e62a35ed Merge pull request #63947 from xedin/rdar-105149979
[ConstraintSystem] Dependent member simplification should be attempte…
2023-02-28 09:12:51 -08:00
swift-ci
622d0b2aa2 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-28 07:14:26 -08:00
Alex Hoppen
0ed6deea9b Merge pull request #63712 from ahoppen/ahoppen/completion-misc
[CodeCompletion] Collection of minor changes to prepare migrating remaining completion kinds to solver-based
2023-02-28 16:02:58 +01:00
Andrew Trick
a354f26d55 Fix unit tests that relied on nontrivial to raw conversion. 2023-02-27 21:51:17 -08:00
Philippe Hausler
8a7f6009b9 Initial draft of observation 2023-02-27 17:09:00 -08:00
Pavel Yaskevich
e450047c6b [ConstraintSystem] Dependent member simplification should be attempted if it has type variable in any position
Current logic attempts simplification of the base type only if it's
a type variable or a dependent member type. That's valid for correct
code but not for invalid code e.g. `(($T) -> Void).Element` is not
going to be simplified even if `$T` is bound, which causes crashes
in diagnostic mode because `matchTypes` is going to re-introduce
constraint with partially resolved dependent member types and by
doing so make it stale forever which trips constraint system state
verification logic.

Resolves: rdar://105149979
2023-02-27 12:41:42 -08:00
Arnold Schwaighofer
1dfc30eb1f Merge remote-tracking branch 'origin/main' into rebranch 2023-02-27 09:18:56 -08:00
Erik Eckstein
2d88482c9f EscapeUtils: add a computational limit to avoid quadratic complexity in some corner cases.
The `isEscaping` function is called a lot from ARCSequenceOpt and ReleaseHoisting.
To avoid quadratic complexity for large functions, limit the amount of work what the EscapeUtils are allowed to to.
This keeps the complexity linear.

The arbitrary limit is good enough for almost all functions.
It lets the EscapeUtils do several hundred up/down walks which is much more than needed in most cases.

Fixes a compiler hang
https://github.com/apple/swift/issues/63846
rdar://105795976
2023-02-24 18:58:01 +01:00
swift-ci
aaa54e3e58 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-23 00:33:41 -08:00
Alex Hoppen
46f5119113 [CodeCompletion] Don’t crash if constructors in member lookup have an error type 2023-02-22 22:33:42 +01:00
Pavel Yaskevich
29725e8209 [Sema/Tests] NFC: Limit a couple of perf tests to macOS
Helps to avoid flakiness on simulators/devices.

Resolves: rdar://105752467
2023-02-22 00:30:39 -08:00
swift-ci
4c9032a9df Merge remote-tracking branch 'origin/main' into rebranch 2023-02-15 10:34:25 -08:00
Tim Kientzle
791d780da4 Merge pull request #59488 from tbkka/tbkka-remoteMirrorIndirectEnums
Test support for indirect enums in RemoteMirror
2023-02-15 10:30:08 -08:00
swift-ci
80446e28eb Merge remote-tracking branch 'origin/main' into rebranch 2023-02-15 08:53:03 -08:00
Daniel Rodríguez Troitiño
8be7136a0b Change experimental reflection lit feature to reflection_runtime (#63670)
The feature "reflection" was already used in the tests (enabled with
SWIFT_ENABLE_REFLECTION). The new feature tests were triggered even if
the experimental feature was not enabled in people builds.

Change the spelling to "reflection_runtime" to not clash with the
existing feature. Change all the tests I found added lately that has the
existing spelling.
2023-02-15 08:40:39 -08:00
Tim Kientzle
017373b899 Add more detail to test 2023-02-14 10:41:15 -08:00
swift-ci
9ca01155df Merge remote-tracking branch 'origin/main' into rebranch 2023-02-13 22:14:24 -08:00
Karoy Lorentey
2e8ae40344 Merge pull request #63592 from lorentey/rework-string-breadcrumbs
[stdlib] Rework String breadcrumbs initialization/loading
2023-02-13 22:11:57 -08:00
swift-ci
9b8c8421c5 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-10 21:54:43 -08:00
Karoy Lorentey
73f349cb15 [stdlib] Rework String breadcrumbs initialization/loading
This is a wild guess at what might be causing our persistent, random
String failures on the main branch:

```
  Swift(macosx-x86_64) :: Prototypes/CollectionTransformers.swift
  Swift(macosx-x86_64) :: stdlib/NSSlowString.swift
  Swift(macosx-x86_64) :: stdlib/NSStringAPI.swift
  Swift(macosx-x86_64) :: stdlib/StringIndex.swift
  Swift-validation(macosx-x86_64) :: stdlib/String.swift
  Swift-validation(macosx-x86_64) :: stdlib/StringBreadcrumbs.swift
  Swift-validation(macosx-x86_64) :: stdlib/StringUTF8.swift
```

FWIW, it appears this is *not* caused by https://github.com/apple/swift/pull/62717:
that change has also landed on release/5.8, and I haven’t seen these
issues on that branch.

Our atomic breadcrumbs initialization vs its non-atomic loading
gives me an uneasy feeling that this may in fact be a long standing
synchronization issue that is only now causing problems (for whatever
reason). I am unable to reproduce these issues locally, so this guess
may be (and probably is) wildly off the mark, but this PR is likely
to be a good idea anyway, if only to rule out this possibility.

rdar://104751936
2023-02-10 20:23:56 -08:00
Pavel Yaskevich
bffb8d9ee2 Revert "[CSGen] Handle recursive use of variable declarations" 2023-02-10 16:45:59 -08:00
swift-ci
5127f32808 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-09 11:33:33 -08:00
Pavel Yaskevich
83dd93ad2e [CSGen] Handle recursive use of variable declarations
It's possible for out-of-scope type variable to be the type of
declaration if such declaration is recursively referenced in
the body of a closure located in its initializer expression.
In such cases type of the variable declaration cannot be connected
to the closure because its not known in advance (determined by the
initializer itself).

Resolves: https://github.com/apple/swift/issues/63455
2023-02-07 17:48:26 -08:00