Commit Graph

39091 Commits

Author SHA1 Message Date
swift-ci
6dd358d0d7 Merge pull request #30062 from CodaFi/les-mots-circulaire 2020-02-25 17:03:11 -08:00
Hamish Knight
63e4ec6bdd Merge pull request #30038 from hamishknight/plenty-of-scope-for-requestification
Requestify scoped import validation
2020-02-25 16:40:00 -08:00
Doug Gregor
8482516412 [Constraint system] Properly deal with "as" patterns.
Teach pattern matching involving "as" patterns to work properly in
function builders. The code almost handled this, but prematurely
prechecking expressions in patterns broke it.
2020-02-25 16:29:07 -08:00
Doug Gregor
cc8db01ba9 Merge pull request #30045 from DougGregor/function-builders-if-let
[Constraint system] Support if let / if case in function builders.
2020-02-25 16:24:09 -08:00
Rintaro Ishizaki
0a0cde92a4 [CodeCompletion] Fast completion for top-level code in single file script
e.g. Playground.
A single file script is like a single function body; the interface of
the file does not affect any other files.
So when a completion happens in a single file script, re-parse the whole
file. But we are still be able to reuse imported modules.

rdar://problem/58378157
2020-02-25 15:56:28 -08:00
Xi Ge
baa83f53d7 Merge pull request #30048 from nkcsgexi/disable-lock-file-interface-for-test
Front-end: add an option to not lock interface file when building module
2020-02-25 15:46:38 -08:00
Michael Gottesman
59823811b5 [stdlib] Mark Unmanaged._withUnsafeGuaranteedRef as _transparent and add a test/comments as requested in the original PR where this landed.
rdar://59735604
2020-02-25 15:46:19 -08:00
swift-ci
d22e15a482 Merge pull request #30052 from apple/shahmishal/fix-non_executable-tests 2020-02-25 15:38:04 -08:00
Robert Widmann
f9d1f700e5 [SR-12236] Commit a regression test
This is technically a source break, but it was always a circularity
issue. It will compile fine in isolation, but all attempts to lookup
nested type via qualified lookup (e.g. witness matching) will re-enter
themselves and potentially produce inconsistent results.

Commit a regression test so we nail down this behavior to see if we can
revisit this.
2020-02-25 15:19:14 -08:00
Slava Pestov
4b9c82de5b SILGen: Fix substitution map when calling property wrapper backing initializer
If we're emitting a designated constructor inside a constrained extension,
we have to use the correct substitution map for calling the property wrapper
backing initializer.

Factor out the computation of this substitution map and use it consistently.

Fixes <rdar://problem/59245068>.
2020-02-25 18:18:54 -05:00
Ravi Kandhadai
7c9ddca1d4 [os log][stdlib/private] Enable precision and alignment values to be dynamic.
The format specifier constructed by the os log implementation uses '*' for
width and precision, and passes those values to the os_log ABIs as additional
arguments of the message. (The precision/alignment arguments have the
type: count).

Update tests to handle this change.
2020-02-25 15:11:48 -08:00
swift-ci
2ffeb3608c Merge pull request #30051 from gottesmm/pr-7908b92ced8c329c27b870832c793311a91089b0 2020-02-25 14:23:54 -08:00
Slava Pestov
2a865a06b6 SILGen: Fix crash when emitting vtable thunk for a generic subclass of non-generic base class
Fixes <rdar://problem/59669591>.
2020-02-25 16:56:04 -05:00
Slava Pestov
10c37c6565 SILGen: Work around for stored property keypath components not supporting generic resilient classes
A keypath component for a stored property can take one of several forms:

- The property offset is known to be constant at compile-time.

  This is used in the simplest cases for classes and structs.

- The property offset is not constant, but can be loaded from a global.

  This is used for classes that require runtime resilient layout, but where
  the offsets do not depend on the generic context.

- The property offset is not constant, and must be loaded from metadata.

  This is the case where the offset depends on the generic context. Here,
  we were only set up to load it from a fixed offset in the metadata.
  This works for generic structs, or generic classes where the superclass
  chain does not cross a resilience boundary.

  However, if a resilience boundary is crossed, the offset of the field
  offset in the metadata must itself be obtained at runtime by adding a
  constant to a value loaded from a global. This case is not supported by
  the current keypath ABI due to an oversight.

I filed <rdar://problem/59777983> to track extending the ABI to handle
this more elegantly in the future.

Fixes <rdar://problem/59617119>.
2020-02-25 16:39:50 -05:00
Hamish Knight
ab9b6d7e11 Requestify scoped import validation
Move the validation of scoped imports into a
request, and force the request when we're
type-checking a primary file. This has the nice
bonus of no longer running the validation for
secondary files.

The use of `ModuleDecl::getTopLevelModule` also
allows us to correctly retrieve the top-level
module for a Clang submodule, rather than
potentially retrieving the Swift module in a mixed
source project.

Resolves SR-12265.
2020-02-25 13:29:52 -08:00
eeckstein
49017c8ee8 Merge pull request #30042 from eeckstein/reinstate-inliner-change
Reinstate "Inliner: inline generic thunks which return a partial_apply."
2020-02-25 22:04:45 +01:00
Mishal Shah
02823682ac Fix the REQUIRES to executable_test from executable_only 2020-02-26 02:32:46 +05:30
Mishal Shah
94db94741d [Test] Mark the tests to run on executable_only to avoid failure (59774397) 2020-02-26 02:24:38 +05:30
Michael Gottesman
5237bcd3b1 [silcombine] Eliminate mark_dependence whose base is a trivial object.
This pattern comes up when faking a base using
Builtin.convertUnsafeUnownedToGuaranteed.

rdar://59735604
2020-02-25 12:32:24 -08:00
Arnold Schwaighofer
f6651d6d45 IRGen: Enable TypeLayout based value witness generation
rdar://51988441
2020-02-25 12:31:30 -08:00
Xi Ge
8c2a041822 Front-end: add an option to not lock interface file when building module
This could help fix a flaky test.

Related to: rdar://58578342
2020-02-25 12:13:14 -08:00
swift-ci
09c199b452 Merge pull request #30044 from aschwaighofer/irgen_test_case_spelling 2020-02-25 10:54:33 -08:00
Rintaro Ishizaki
571d09a8a2 Merge pull request #29955 from AnthonyLatsis/operator-diag-qoi
[Parse] Improve recovery from and diagnostics for invalid operator names
2020-02-25 10:11:26 -08:00
Joe Groff
0a318a39f1 Merge pull request #29644 from jckarter/subst-function-type-shakeout
Enable substituted SIL function types
2020-02-25 09:47:10 -08:00
Doug Gregor
4830c48960 [Constraint system] Support if let / if case in function builders.
Use the generalized constraint generation and binding for patterns to
introduce support for if-let and if-case in function builders, handling
arbitrary patterns.

Part of function builder generalization, rdar://problem/50426203.
2020-02-25 09:44:06 -08:00
Arnold Schwaighofer
7391d9593d Fix incorrect spelling in IRGen test case partial_apply_forwarder.sil 2020-02-25 09:01:28 -08:00
Pavel Yaskevich
7d4db41180 [TypeChecker] NFC: Add one more test-case for SR-11743 2020-02-25 08:55:00 -08:00
Erik Eckstein
2f6c9f3a28 Reinstate "Inliner: inline generic thunks which return a partial_apply.""
This reinstates commit 92a764d9f6.

rdar://problem/59061452
2020-02-25 17:49:50 +01:00
Arnold Schwaighofer
5b046c691c Merge pull request #30037 from aschwaighofer/irgen_fix_partial_apply_conditional_conf_2nd
IRGen: Fix specialized conformances with abstract conditional requirements in the partial apply forwarder
2020-02-25 06:27:19 -08:00
Daniel Rodríguez Troitiño
073e44d6e8 Merge pull request #29296 from buttaface/droid
[android] Get build scripts working natively, fix tests and install
2020-02-24 21:05:47 -08:00
Doug Gregor
fe5c068ffb Merge pull request #29879 from DougGregor/constraint-system-patterns
[Constraint system] Generate constraints from patterns
2020-02-24 20:41:14 -08:00
Pavel Yaskevich
2cdd78501c [ConstraintSystem] Look through l-value while checking whether dynamic key path is recursive
Fix a crash in dynamic member lookup attempting to recursively
lookup a member on the same base type.

The problem is related to `isSelfRecursiveKeyPathDynamicMemberLookup`
which failed to look through l-value wrapping base type on each side of
the comparison, that's important because it's possible to have l-value
mismatch due to the fact that implicit call always gets l-value base
type but actual subscript which triggered dynamic lookup might be r-value.

Resolves: [SR-11743](https://bugs.swift.org/browse/SR-11743)
Resolves: rdar://problem/57091169
2020-02-24 19:38:20 -08:00
swift-ci
31d63a384c Merge pull request #30039 from vedantk/master 2020-02-24 18:05:19 -08:00
Joe Groff
059f1de9ac Merge pull request #30036 from jckarter/trivial-vs-static-metadata
IRGen: Separate the concept of "metadata should be cached" from "statically referenced"
2020-02-24 17:40:34 -08:00
Vedant Kumar
5fe5fcccc3 [Profiler] Don't crash visiting IfExpr in argument initializer
When visiting an expression in a function argument initializer, there
may not be an active region on the region stack, so don't try to access
it.

rdar://59695604
2020-02-24 16:01:24 -08:00
Doug Gregor
644ed76a01 [Constraint system] Prefer enum cases to static members when pattern matching. 2020-02-24 15:00:39 -08:00
Xi Ge
853c0f545b Merge pull request #29974 from nkcsgexi/53776566
ABIChecker: ignore accessors with forced static dispatch
2020-02-24 14:25:06 -08:00
Arnold Schwaighofer
449766f32a IRGen: Fix specialized conformances with abstract conditional requirements in the partial apply forwarder
2nd attempt.

rdar://59723512
2020-02-24 14:23:19 -08:00
Pavel Yaskevich
b926250c70 Merge pull request #30006 from xedin/rdar-56212087
[ConstraintSystem] Make it possible to infer subtype bindings through argument conversions
2020-02-24 14:18:35 -08:00
Joe Groff
7ec52e6329 IRGen: Separate the concept of "metadata should be cached" from "statically referenced"
Some metadata may require instantiation, but not in a way that requires us to put an additional
cache layer in front of it. `Self` metadata is also trivial to access from the local cache, but
isn't statically referenceable. Split these concepts and update code to use one or the other
appropriately. This catches an issue with metadata prespecialization where it would try to
make records for dynamic `Self` incorrectly.
2020-02-24 13:58:57 -08:00
Xi Ge
71a73a9551 test: update ABI/API baselines for stdlib 2020-02-24 12:23:24 -08:00
Xi Ge
c585fd6748 ABIChecker: contains only opaque accessors for ABI/API checking
rdar://53776566
2020-02-24 12:23:03 -08:00
Joe Groff
3d377fb1fc Update resilient_assign_by_wrapper test for subst function types 2020-02-24 12:14:21 -08:00
Joe Groff
b5c150287a SILGen: +1 function when converting for a reabstraction 2020-02-24 12:14:21 -08:00
Joe Groff
eef57a5fa7 Update test 2020-02-24 12:14:21 -08:00
Joe Groff
bdece4bae5 OSLogOptimization: Codegen array elements according to the correct maximally-abstracted element type 2020-02-24 12:14:21 -08:00
Joe Groff
834360305c Update test/SILOptimizer/for_each_loop_unroll_test.sil for substituted function types 2020-02-24 12:14:21 -08:00
Joe Groff
1b16cd42d3 SIL type lowering: Rearrange assertion so it won't fire on generic subclass overrides 2020-02-24 12:14:21 -08:00
Joe Groff
cf0e09d9c5 Preserve conformances for upper bound constraints when lowering SILFunctionTypes 2020-02-24 12:14:21 -08:00
Joe Groff
31a9c8daef Fix IsBindableVisitor with nested BoundGenericTypes not to redundantly collect the parent parameters 2020-02-24 12:14:21 -08:00