Skip to content

Commit 897bbe6

Browse files
committed
---
yaml --- r: 294239 b: refs/heads/tensorflow c: 0b2c004 h: refs/heads/master i: 294237: c29baf2 294235: f80555b 294231: 45c9d0b 294223: 3f19246 294207: 00e11ba
1 parent b3c0a67 commit 897bbe6

39 files changed

+535
-651
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: 99134680b3b727e2166823dbf36b373ae7d5e627
819+
refs/heads/tensorflow: 0b2c004d0d5c811bd3c8b17ee5e4365e5aec5a2e
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,12 @@ endif()
10511051
# https://bugs.swift.org/browse/SR-5975
10521052
if(SWIFT_BUILD_STDLIB)
10531053
add_subdirectory(stdlib)
1054+
else()
1055+
# Some tools (e.g. swift-reflection-dump) rely on a host swiftReflection, so
1056+
# ensure we build that when building tools.
1057+
if(SWIFT_INCLUDE_TOOLS)
1058+
add_subdirectory(stdlib/public/Reflection)
1059+
endif()
10541060
endif()
10551061

10561062
if(SWIFT_INCLUDE_APINOTES)

branches/tensorflow/include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -857,10 +857,6 @@ ERROR(did_not_call_method,none,
857857
"method %0 was used as a property; add () to call it",
858858
(Identifier))
859859

860-
ERROR(init_not_instance_member_use_assignment,none,
861-
"'init' is a member of the type; use assignment "
862-
"to initalize the value instead", ())
863-
864860
ERROR(init_not_instance_member,none,
865861
"'init' is a member of the type; use 'type(of: ...)' to initialize "
866862
"a new object of the same dynamic type", ())

branches/tensorflow/include/swift/AST/SILOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class SILOptions {
5151
bool RemoveRuntimeAsserts = false;
5252

5353
/// Enable existential specializer optimization.
54-
bool ExistentialSpecializer = false;
54+
bool ExistentialSpecializer = true;
5555

5656
/// Controls whether the SIL ARC optimizations are run.
5757
bool EnableARCOptimizations = true;

branches/tensorflow/lib/Sema/CSDiagnostics.cpp

Lines changed: 5 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -101,35 +101,6 @@ Expr *FailureDiagnostic::getArgumentExprFor(Expr *anchor) const {
101101
return nullptr;
102102
}
103103

104-
// TODO: Replace duplications of this logic with calls to this.
105-
Optional<SelectedOverload> FailureDiagnostic::getChoiceFor(Expr *expr) {
106-
auto &cs = getConstraintSystem();
107-
ConstraintLocator *locator = nullptr;
108-
109-
if (auto *AE = dyn_cast<ApplyExpr>(expr)) {
110-
if (auto *TE = dyn_cast<TypeExpr>(AE->getFn())) {
111-
locator = cs.getConstraintLocator(AE,
112-
{ConstraintLocator::ApplyFunction,
113-
ConstraintLocator::ConstructorMember},
114-
/*summaryFlags=*/0);
115-
}
116-
return getChoiceFor(AE->getFn());
117-
} else if (auto *UDE = dyn_cast<UnresolvedDotExpr>(expr)) {
118-
locator = cs.getConstraintLocator(UDE, ConstraintLocator::Member);
119-
} else if (auto *UME = dyn_cast<UnresolvedMemberExpr>(expr)) {
120-
locator = cs.getConstraintLocator(UME, ConstraintLocator::UnresolvedMember);
121-
} else if (auto *SE = dyn_cast<SubscriptExpr>(expr)) {
122-
locator = cs.getConstraintLocator(SE, ConstraintLocator::SubscriptMember);
123-
} else {
124-
locator = cs.getConstraintLocator(expr);
125-
}
126-
127-
if (!locator)
128-
return None;
129-
130-
return getOverloadChoiceIfAvailable(locator);
131-
}
132-
133104
Type RequirementFailure::getOwnerType() const {
134105
return getType(getRawAnchor())
135106
->getInOutObjectType()
@@ -2048,7 +2019,6 @@ bool MissingMemberFailure::diagnoseAsError() {
20482019
bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
20492020
auto loc = getAnchor()->getLoc();
20502021
auto &cs = getConstraintSystem();
2051-
auto *DC = getDC();
20522022
auto locator = getLocator();
20532023

20542024
if (loc.isInvalid()) {
@@ -2106,43 +2076,11 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
21062076
emitDiagnostic(loc, diag::super_initializer_not_in_initializer);
21072077
return true;
21082078
}
2109-
2110-
auto isCallArgument = [this](Expr *expr) {
2111-
auto &cs = getConstraintSystem();
2112-
auto argExpr = cs.getParentExpr(expr);
2113-
if (!argExpr)
2114-
return false;
2115-
auto possibleApplyExpr = cs.getParentExpr(expr);
2116-
return possibleApplyExpr && isa<ApplyExpr>(possibleApplyExpr);
2117-
};
2118-
2119-
auto *initCall = cs.getParentExpr(cs.getParentExpr(ctorRef));
2120-
2121-
auto isMutable = [&DC](ValueDecl *decl) {
2122-
if (auto *storage = dyn_cast<AbstractStorageDecl>(decl))
2123-
return storage->isSettable(DC) && storage->isSetterAccessibleFrom(DC);
2124-
2125-
return true;
2126-
};
2127-
2128-
auto selection = getChoiceFor(ctorRef->getBase());
2129-
if (selection) {
2130-
OverloadChoice choice = selection->choice;
2131-
if (choice.isDecl() && isMutable(choice.getDecl()) &&
2132-
!isCallArgument(initCall) &&
2133-
cs.getContextualTypePurpose() == CTP_Unused) {
2134-
auto fixItLoc = ctorRef->getBase()->getSourceRange().End;
2135-
emitDiagnostic(loc, diag::init_not_instance_member_use_assignment)
2136-
.fixItInsertAfter(fixItLoc, " = ");
2137-
return true;
2138-
}
2139-
2140-
SourceRange fixItRng = ctorRef->getNameLoc().getSourceRange();
2141-
emitDiagnostic(loc, diag::init_not_instance_member)
2142-
.fixItInsert(fixItRng.Start, "type(of: ")
2143-
.fixItInsertAfter(fixItRng.End, ")");
2144-
return true;
2145-
}
2079+
SourceRange fixItRng = ctorRef->getNameLoc().getSourceRange();
2080+
emitDiagnostic(loc, diag::init_not_instance_member)
2081+
.fixItInsert(fixItRng.Start, "type(of: ")
2082+
.fixItInsertAfter(fixItRng.End, ")");
2083+
return true;
21462084
}
21472085
}
21482086

branches/tensorflow/lib/Sema/CSDiagnostics.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ class FailureDiagnostic {
155155
/// reference or subscript, nullptr otherwise.
156156
Expr *getArgumentExprFor(Expr *anchor) const;
157157

158-
Optional<SelectedOverload> getChoiceFor(Expr *);
159-
160158
private:
161159
/// Compute anchor expression associated with current diagnostic.
162160
std::pair<Expr *, bool> computeAnchor() const;

branches/tensorflow/lib/Sema/TypeCheckConstraints.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,12 +2646,9 @@ bool TypeChecker::typeCheckBinding(Pattern *&pattern, Expr *&initializer,
26462646
auto contextualPurpose = CTP_Unused;
26472647
TypeCheckExprOptions flags = TypeCheckExprFlags::ConvertTypeIsOnlyAHint;
26482648

2649-
// Set the contextual purpose even if the pattern doesn't have a type so
2650-
// if there's an error we can use that information to inform diagnostics.
2651-
contextualPurpose = CTP_Initialization;
2652-
26532649
if (pattern->hasType()) {
26542650
contextualType = TypeLoc::withoutLoc(pattern->getType());
2651+
contextualPurpose = CTP_Initialization;
26552652

26562653
// If we already had an error, don't repeat the problem.
26572654
if (contextualType.getType()->hasError())

branches/tensorflow/stdlib/public/Darwin/Accelerate/AccelerateBuffer.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public protocol AccelerateBuffer {
2626
/// Calls a closure with a pointer to the object's contiguous storage.
2727
func withUnsafeBufferPointer<R>(
2828
_ body: (UnsafeBufferPointer<Element>) throws -> R
29-
) rethrows -> R
29+
) rethrows -> R
3030
}
3131

3232
/// A mutable object composed of count elements that are stored contiguously
@@ -40,25 +40,23 @@ public protocol AccelerateMutableBuffer: AccelerateBuffer {
4040
/// contiguous storage.
4141
mutating func withUnsafeMutableBufferPointer<R>(
4242
_ body: (inout UnsafeMutableBufferPointer<Element>) throws -> R
43-
) rethrows -> R
43+
) rethrows -> R
4444
}
4545

4646
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
4747
public extension AccelerateBuffer where Self: Collection {
48-
@inlinable
4948
func withUnsafeBufferPointer<R>(
5049
_ body: (UnsafeBufferPointer<Element>) throws -> R
51-
) rethrows -> R {
50+
) rethrows -> R {
5251
return try withContiguousStorageIfAvailable(body)!
5352
}
5453
}
5554

5655
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
5756
extension AccelerateMutableBuffer where Self: MutableCollection {
58-
@inlinable
5957
public mutating func withUnsafeMutableBufferPointer<R>(
6058
_ body: (inout UnsafeMutableBufferPointer<Element>) throws -> R
61-
) rethrows -> R {
59+
) rethrows -> R {
6260
return try withContiguousMutableStorageIfAvailable(body)!
6361
}
6462
}

0 commit comments

Comments
 (0)