Skip to content

[pull] master from apple:master #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 602 commits into from
Jul 6, 2020
Merged

[pull] master from apple:master #27

merged 602 commits into from
Jul 6, 2020

Conversation

pull[bot]
Copy link

@pull pull bot commented Jul 6, 2020

See Commits and Changes for more details.


Created by pull[bot]. Want to support this open source service? Please star it : )

slavapestov and others added 30 commits June 26, 2020 22:56
…-inference

Try to derive a type witness in a known conformance before attempting associated type inference
…nting relative to their first line.

doStuffWithList([
    firstItem
    .map { $0 }       // This line should be indented further.
    .append(\.foo),   // And so should this one.
    secondItem
])

Resolves rdar://problem/64834040
- update the diagnostic error message
- add educational notes
test: xfail Constraints/operator.swift
Instead of XFAILing whole `test/Constraints/operator.swift`
let's adjust diagnostic responsible for flakiness.
[TypeChecker] NFC: Clarify flaky diagnostic XFAIL
CMake: Remove workaround fixed in CMake 2.8.4
Undent the code that was mis-indended leading to a warning with clang.
SourceKit: silence as `-Wmisleading-indent` warning (NFCI)
Copy out the result rather than form a dangling pointer.  This fixes the
incorrect usage that the compiler flags.
This simplifies the test pattern.
Use the Unix style path for the test.
SwiftPrivateThreadExtras: correct misuse of API
Use the proper division operation as the test otherwise generates
different patterns.
…457b84176753ff

[ownership] Move the stdlib ome point to before global opt.
test: unixise path for Parse.source_locs (NFCI)
test: unixise some paths in diagnostics tests (NFCI)
Attempt to properly quote the python interpreter path in the lit
configuration. This was quoted in some places but not others. This
attempts to homogenise the path quoting.
This change improves slightly the quality of the diagnostics and detects
the use of local SPI types on public property with a default value.
test: make stdlib.NumericParsing Python 3 friendly
…d-arguments

[SourceKit/CursorInfo] Still print implicit decls in cursorinfo to handle compiler synthesized decls
Move 'MetadataSections' from 'ImageInspectionElf.h' to SwiftShims
MForster and others added 28 commits July 3, 2020 11:06
This adds support to `ClangImporter` to import C++ member function operators as static methods into Swift, which is part of SR-12748.

The left-hand-side operand, which gets passed as the `this` pointer to the C++ function is represented as an additional first parameter in the Swift method. It gets mapped back in SILGen.

Two of the tests are disabled on Windows because we can't yet call member functions correctly on Windows (SR-13129).
[SIL] NFC: Move #include of CanTypeVisitor.h
[SIL] NFC: Add more paranoia checks to SILType
…eric specialization tests behind a flag.

The idea is that this will let me remove these assertions that were in place to
make sure we were really conservative around specializing ownership code. For me
to remove that I need to be able to actually test out this code (since I think
there are some code paths where this will trigger in other parts of the compiler
now).

So to work out the kinks, I added a flag that allows for the generic specializer
to process ownership code and translated most of the .sil test cases/fixed any
bugs that I found. This hopefully will expose anything that is missing.

NOTE: I have not enabled the generic specializer running in ownership in the
pipeline. This is just a step in that direction by adding tests/etc.
Array literals only need to be finalized, if the array is really allocated.
In case of zero elements, no allocation is done, but the empty-array singleton is used.
"Finalization" means to emit an end_cow_mutation instruction on the array.
As the empty-array singleton is a read-only and shared object, it's not legal to do a end_cow_mutation on it.
…builds.

This was blocked by an LLDB problem, which is now fixed (swiftlang/llvm-project#1333)
…eralKeyPath)"

This reinstates commit d7d829c with a fix for C tail-allocated arrays.

Replace a call of the getter of AnyKeyPath._storedInlineOffset with a "constant" offset, in case of a keypath literal.
"Constant" offset means a series of struct_element_addr and tuple_element_addr instructions with a 0-pointer as base address.
These instructions can then be lowered to "real" constants in IRGen for concrete types, or to metatype offset lookups for generic or resilient types.

Replace:
  %kp = keypath ...
  %offset = apply %_storedInlineOffset_method(%kp)
with:
  %zero = integer_literal $Builtin.Word, 0
  %null_ptr = unchecked_trivial_bit_cast %zero to $Builtin.RawPointer
  %null_addr = pointer_to_address %null_ptr
  %projected_addr = struct_element_addr %null_addr
   ... // other address projections
  %offset_ptr = address_to_pointer %projected_addr
  %offset_builtin_int = unchecked_trivial_bit_cast %offset_ptr
  %offset_int = struct $Int (%offset_builtin_int)
  %offset = enum $Optional<Int>, #Optional.some!enumelt, %offset_int

rdar://problem/53309403
stdlib: enable runtime checking for COW support by default in assert builds.
Attempt to appease the python linter
Reinstate "SILCombine: Constant-fold MemoryLayout<T>.offset(of: \.literalKeyPath)"
test: make `validate_parse` more python3 friendly
…7c43d7b3a743d5

[ownership] Loosen restrictions around what we specialize and add generic specialization tests behind a flag.
…32670)

Add base type parameter to `TangentStoredPropertyRequest`.

Use `TypeBase::getTypeOfMember` instead of `VarDecl::getType` to correctly
compute the member type of original stored properties, using the base type.

Resolves SR-13134.
…#32714)

Reject `@differentiable` and `@derivative` attribute for original
functions with opaque result types.

It is not possible to support derivative registration nor the
differentiation transform for such functions.

Resolves SR-12656.
Improve `@derivative` and `@transpose` type-checking diagnostics for resolving
the referenced original declaration.

Previously, an error was produced on one invalid candidate at the attribute's
location. This did not indicate the invalid candidate's location or the total
number of invalid candidates.

Now:
- Diagnostic notes are produced on all invalid candidates at their location.
  Invalid candidates' descriptive declaration kind are shown for clarity.
- Derivative registration for protocol requirements (not yet supported, TF-982)
  now has a clear, dedicated diagnostic.
- The "original declaration type mismatch" diagnostic is improved for expected
  original function types with generic signatures. The message now accurately
  reads "candidate does not have type equal to *or less constrained than* ...",
  instead of "candidate does not have expected type ...".

Resolves SR-13150.
Paves the way for future diagnostic improvements: SR-13151, SR-13152.
@pull pull bot merged commit c7cd497 into MaxDesiatov:master Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.