Skip to content

Merge swift-DEVELOPMENT-SNAPSHOT-2019-07-22-a into tensorflow. #26341

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 399 commits into from
Jul 25, 2019

Conversation

bgogul
Copy link
Contributor

@bgogul bgogul commented Jul 24, 2019

No description provided.

vguerra and others added 30 commits July 14, 2019 14:30
The compiler allows unavailable types to be extended as long as the
extension itself is marked unavailable:

@available(macOS, unavailable)
struct UnavailableStruct { }

@available(macOS, unavailable)
extension UnavailableStruct { } // no-error

However, this doesn't work when the extension is inside a #if. The
availability logic that finds the containing ExtensionDecl based on
a source range gets confused and finds the IfConfigDecl instead.

To fix this, change that logic to ignore IfConfigDecls. Members of
an active #if are also represented in the enclosing context, as
sibling of the IfConfigDecl, so the compiler will find the extension
declaration there.

rdar://problem/53079366
This extends the WinSDK module definition further to better modularise
the headers.  This should improve the header organisation as well as
setup additional autolink rules.
`RefCount.h` can be included in a C context - e.g. building the
SwiftShims module.  Restrict the C++ overloads to the C++ context only.
This partially improves the build for Windows ARM64.
AST: attempt to rewrite the expression to be more legible
The memcpy in the type layout verifier was not correct for big-
endian systems. While we are here change 'long long' to a fixed
width unsigned type (uint64_t). It doesn't really make sense to
print the value as a signed number since we have zero extended
it from its original bit width using the memcpy.
Runtime: print type layout values correctly on big-endian systems
Revert "Better runtime failure messages (not yet enabled by default)"
Solution based on the outline in the issue description.

Also fixes the corresponding rdar://problem/46644027.
…cety-rdar51599533

[CodeCompletion] Add defensive nullptr check
…ion-body

[Type checker] Requestify type checking of a function body
Identify constant definitions that look like include guard definitions
… for exhaustive switching over builtin types.

I am going to use this to refactor some code in ASTPrinter onto BuiltinType
wherein I use an exhaustive switch to print things as appropriate. Exhaustive
switching over all builtin types just seems like a useful thing to have as well.
This commit centralizes the code that converts variable length
tag values, stored in enum payloads and extra tag bytes, to and
from the 4-byte integer values that the runtime uses to represent
the enum case.

Note that currently big endian machines will store the tag value
in the first word of the destination. This reflects the current
behaviour of the compiler. I am however expecting to change this
so that the value is stored as a true variable-length big-endian
integer in the near future, so the tag value will be stored in
the last 4 bytes of payloads rather than the first 4 bytes like
they are on little-endian systems.
hborla and others added 28 commits July 19, 2019 10:22
…quest

Sema: implement `existentialConformsToSelf` using a request evaluator.
Within invalid code, we might encounter expressions without type
information yet. Check for NULL here.

Fixes crash from rdar://problem/53120878.
Fixes issue SR-10571 and corresponding rdar://problem/50337188.
…s to the evaluator model

These APIs are 'canDeclProvideDefaultImplementationFor' and 'collectAllOverriddenDecls'.
…f6e47d8ce5eb00

[benchmark][readme] Add docs on how to edit the benchmarks in xcode/b…
…ecls

IDE+Evaluator: refactor the implementation of two common IDE utilities to the evaluator model
…x wrapped property refereces

Fixes SR-11149 / rdar://problem/53204113
I needed this functionality to fix an edge case bug in closure lifetime fixup.
Given certain CFGs, the SSA updater will insert unnecessary phi arguments that
all take the same "initial" value (the .none from the entry block). As an
example, consider the following CFG:

```
+-------+     +------+
|   2   | <-- |  0   |
+-------+     +------+
  |             |
  |             |
  |             v
  |           +------+     +---+
  |           |  1   | --> | 3 |
  |           +------+     +---+
  |             |            |
  |             |            |
  |             v            |
  |           +------+       |
  |           |  4   |       |
  |           +------+       |
  |             |            |
  |             |            |
  |             v            |
  |           +------+       |
  +---------> |  5   |       |
              +------+       |
                |            |
                |            |
                v            |
+-------+     +------+       |
| Throw | <-- |  6   |       |
+-------+     +------+       |
                |            |
                |            |
                v            |
              +------+       |
              | Exit | <-----+
              +------+
```

In this case, if our some value is actually in BB3, we will actually insert a
phi node in BB5 that has all .none incoming values. This is causing us from the
perspective of the ownership verifier to be leaking that phi node in
BBThrow. The reason why is that arguments are a location in SIL where the
specific case of the enum is erased, forcing us to use @owned if the enum has
any non-trivial cases. These of course will not be balanced by any
destroy_values reachable from the copy_value (since otherwise, we would have a
.some definition along that path), so it makes sense. Rather than try to insert
destroy_values, we just realize that in this case we know that all the incoming
values are really the .none from the entry block and delete the argument,
eliminating the problem.
Use name mangling to disambiguate field names when types are anonymous.
…alidate-args

[Qol] Driver toolchain validate args
 [Type checker] Substitute into alternate properties when trying to fix wrapped property references
…4959d83d1bf8bd

[closure-lifetime-fixup] Delete dead trivial phi nodes.
…ted types.

The code here was not correct in a situation where an opaque type had constraints that were
refinements of the protocol requirements of an associated type, as in:

```
protocol ParentProtocol {}
protocol SubProtocol: ParentProtocol {}

protocol P {
  associatedtype A: ParentProtocol
  func foo() -> A
}

struct S: P {
  func foo() -> some SubProtocol
}
```

because it assumed that the conformance could be found directly on the opaque type instead of
potentially via an arbitrary MetadataPath. Falling through to the code that already correctly
handles archetype conformances right below the removed code does the right thing. Fixes
rdar://problem/53081207.
…s-protocol-refinement

IRGen: Use correct archetype conformance code path for opaque associated types.
…InMiddleOfBlock for getting values in exits.

Otherwise we will leak values if the copy block is in the same block as the
terminator and we fail to identify a single destroy for the copy block. We are
generally pretty good at identifying those single destroy cases, so I am not
sure how often this actually happens.

Found by the ownership verifier.
…467a74540e4a9c

[closure-lifetime-fixup] Use GetValueAtEndOfBlock instead of GetValue…
…05b074b064e388

Revert "Revert "[ownership] Verify functions before we strip ownershi…
#26255)

Unresolved imports all have the "same" ModuleDecl: nullptr. But that's
not really an inconsistency, and even if there *is* a true
inconsistency among unresolved imports, it can be dealt with when the
developer fixes their search paths. (Or the imports. Whichever is
wrong.)

rdar://problem/52943397
…erge

Tag build swift-DEVELOPMENT-SNAPSHOT-2019-07-22-a
@bgogul
Copy link
Contributor Author

bgogul commented Jul 24, 2019

@swift-ci please clean test tensorflow

@bgogul bgogul merged commit 0e08cd5 into tensorflow Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.