Skip to content

Commit cc6ec95

Browse files
committed
---
yaml --- r: 327649 b: refs/heads/tensorflow c: 27d3331 h: refs/heads/master i: 327647: 597a54a
1 parent 26f6833 commit cc6ec95

File tree

24 files changed

+49
-153
lines changed

24 files changed

+49
-153
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: d67443f13919900c9790af2b843a7257bd51d2cd
819+
refs/heads/tensorflow: 27d333109d95c595531e51ba3259f3fcf18ccac5
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/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
| **OS** | **Architecture** | **Build** |
1616
|---|:---:|:---:|
17+
|**[Debian 9.1 (Raspberry Pi)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/armv7_debian_stretch.json)** | ARMv7 | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_1/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_1)|
18+
|**[Fedora 27](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_fedora_27.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-fedora-27/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-fedora-27)|
19+
|**[Ubuntu 16.04](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04)|
1720
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/ppc64le_ubuntu_16_04.json)** | PPC64LE |[![Build Status](https://ci-external.swift.org/job/oss-swift-5.1-RA-linux-ubuntu-16.04-ppc64le/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-5.1-RA-linux-ubuntu-16.04-ppc64le)|
1821
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_ubuntu_16.04.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64)|
1922
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | ARMv7 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android)|

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ ERROR(new_decl_without_intro,none,"%0 is a new API without @available attribute"
9898

9999
ERROR(objc_name_change,none,"%0 has ObjC name change from %1 to %2", (StringRef, StringRef, StringRef))
100100

101-
ERROR(desig_init_added,none,"%0 has been added as a designated initializer to an open class", (StringRef))
102-
103101
#ifndef DIAG_NO_UNDEF
104102
# if defined(DIAG)
105103
# undef DIAG

branches/tensorflow/include/swift/IDE/DigesterEnums.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ KEY_STRING(IntrotvOS, intro_tvOS)
152152
KEY_STRING(IntrowatchOS, intro_watchOS)
153153
KEY_STRING(Introswift, intro_swift)
154154
KEY_STRING(ObjCName, objc_name)
155-
KEY_STRING(InitKind, init_kind)
156155

157156
KEY_STRING_ARR(SuperclassNames, superclassNames)
158157
KEY_STRING_ARR(ToolArgs, tool_arguments)

branches/tensorflow/lib/AST/Type.cpp

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,11 @@ bool TypeBase::isExactSuperclassOf(Type ty) {
14791479
ty->getSuperclass()->getAnyNominal()->hasClangNode())))
14801480
return false;
14811481

1482+
SmallPtrSet<ClassDecl *, 8> seen;
14821483
do {
1484+
if (auto *classDecl = ty->getClassOrBoundGenericClass())
1485+
if (!seen.insert(classDecl).second)
1486+
return false;
14831487
if (ty->isEqual(this))
14841488
return true;
14851489
} while ((ty = ty->getSuperclass()));
@@ -1510,6 +1514,10 @@ bool TypeBase::isBindableTo(Type b) {
15101514
if (orig->requiresClass() && !subst->satisfiesClassConstraint())
15111515
return false;
15121516

1517+
if (auto superclass = orig->getSuperclass())
1518+
if (!superclass->isBindableToSuperclassOf(subst))
1519+
return false;
1520+
15131521
// TODO: If the archetype has a superclass constraint, check that the
15141522
// substitution is a subclass.
15151523

@@ -1528,7 +1536,7 @@ bool TypeBase::isBindableTo(Type b) {
15281536
if (CanType(orig) == subst)
15291537
return true;
15301538

1531-
llvm_unreachable("not a valid canonical type substitution");
1539+
return false;
15321540
}
15331541

15341542
bool visitNominalType(NominalType *nom, CanType subst) {
@@ -1580,17 +1588,20 @@ bool TypeBase::isBindableTo(Type b) {
15801588
}
15811589

15821590
bool visitDependentMemberType(DependentMemberType *dt, CanType subst) {
1583-
llvm_unreachable("can't visit dependent types");
1591+
return true;
15841592
}
15851593
bool visitGenericTypeParamType(GenericTypeParamType *dt, CanType subst) {
1586-
llvm_unreachable("can't visit dependent types");
1594+
return true;
15871595
}
15881596

15891597
bool visitFunctionType(FunctionType *func, CanType subst) {
15901598
if (auto substFunc = dyn_cast<FunctionType>(subst)) {
15911599
if (func->getExtInfo() != substFunc->getExtInfo())
15921600
return false;
15931601

1602+
if (func->getParams().size() != substFunc->getParams().size())
1603+
return false;
1604+
15941605
for (unsigned i : indices(func->getParams())) {
15951606
if (!visit(func->getParams()[i].getOldType(),
15961607
substFunc.getParams()[i].getOldType()))
@@ -1708,20 +1719,13 @@ bool TypeBase::isBindableToSuperclassOf(Type ty) {
17081719
if (!ty->mayHaveSuperclass())
17091720
return false;
17101721

1711-
// If the type is itself an archetype, we could always potentially bind it
1712-
// to the superclass (via external retroactive conformance, even if the
1713-
// type isn't statically known to conform).
1714-
//
1715-
// We could theoretically reject cases where the set of conformances is known
1716-
// (say the protocol or classes are private or internal).
1717-
if (is<ArchetypeType>())
1718-
return true;
1719-
1722+
SmallPtrSet<ClassDecl *, 8> seen;
17201723
do {
1724+
if (auto *classDecl = ty->getClassOrBoundGenericClass())
1725+
if (!seen.insert(classDecl).second)
1726+
return false;
17211727
if (isBindableTo(ty))
17221728
return true;
1723-
if (ty->getAnyNominal() && ty->getAnyNominal()->isInvalid())
1724-
return false;
17251729
} while ((ty = ty->getSuperclass()));
17261730
return false;
17271731
}

branches/tensorflow/lib/FrontendTool/FrontendTool.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,12 +1122,10 @@ static bool performCompile(CompilerInstance &Instance,
11221122
if (Action == FrontendOptions::ActionType::Typecheck) {
11231123
if (emitIndexData(Invocation, Instance))
11241124
return true;
1125-
if (opts.InputsAndOutputs.isWholeModule()) {
1126-
if (emitAnyWholeModulePostTypeCheckSupplementaryOutputs(Instance,
1127-
Invocation,
1128-
moduleIsPublic)) {
1129-
return true;
1130-
}
1125+
if (emitAnyWholeModulePostTypeCheckSupplementaryOutputs(Instance,
1126+
Invocation,
1127+
moduleIsPublic)) {
1128+
return true;
11311129
}
11321130
return false;
11331131
}

branches/tensorflow/lib/Sema/CSSimplify.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3901,6 +3901,11 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
39013901
return recordFix(fix) ? SolutionKind::Error : SolutionKind::Solved;
39023902
}
39033903

3904+
// Let's not try to fix missing conformance for Void
3905+
// or Never because that doesn't really make sense.
3906+
if (type->isVoid() || type->isUninhabited())
3907+
return SolutionKind::Error;
3908+
39043909
if (path.back().is<LocatorPathElt::AnyRequirement>()) {
39053910
// If this is a requirement associated with `Self` which is bound
39063911
// to `Any`, let's consider this "too incorrect" to continue.

branches/tensorflow/test/Constraints/rdar44770297.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ protocol P {
44
associatedtype A
55
}
66

7-
func foo<T: P>(_: () throws -> T) -> T.A? { // expected-note {{where 'T' = 'Never'}}
7+
func foo<T: P>(_: () throws -> T) -> T.A? { // expected-note {{in call to function 'foo'}}
88
fatalError()
99
}
1010

11-
let _ = foo() {fatalError()} & nil // expected-error {{global function 'foo' requires that 'Never' conform to 'P'}}
11+
let _ = foo() {fatalError()} & nil // expected-error {{generic parameter 'T' could not be inferred}}

branches/tensorflow/test/Index/Store/driver-index-with-auxiliary-outputs.swift

Lines changed: 0 additions & 35 deletions
This file was deleted.

branches/tensorflow/test/api-digester/Inputs/cake_baseline/cake.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,3 @@ public class SwiftObjcClass {
201201
@objc(OldObjCFool:OldObjCA:OldObjCB:)
202202
public func foo(a:Int, b:Int, c: Int) {}
203203
}
204-
205-
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
206-
open class AddingNewDesignatedInit {
207-
public init() {}
208-
public convenience init(foo: Int) {
209-
self.init()
210-
print(foo)
211-
}
212-
}

branches/tensorflow/test/api-digester/Inputs/cake_current/cake.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,3 @@ public class SwiftObjcClass {
208208
@objc(NewObjCFool:NewObjCA:NewObjCB:)
209209
public func foo(a:Int, b:Int, c: Int) {}
210210
}
211-
212-
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
213-
open class AddingNewDesignatedInit {
214-
public init(_ b: Bool) {}
215-
public init() {}
216-
public convenience init(foo: Int) {
217-
self.init()
218-
print(foo)
219-
}
220-
}

branches/tensorflow/test/api-digester/Outputs/Cake-abi.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,3 @@ cake: Var RequiementChanges.addedVar has been added as a protocol requirement
115115
cake: Class C4 has changed its super class from APINotesTest.OldType to APINotesTest.NewType
116116
cake: Class SubGenericClass has changed its super class from cake.GenericClass<cake.P1> to cake.GenericClass<cake.P2>
117117
cake: Class SuperClassRemoval has removed its super class cake.C3
118-
cake: Constructor AddingNewDesignatedInit.init(_:) has been added as a designated initializer to an open class

branches/tensorflow/test/api-digester/Outputs/Cake.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ cake: Accessor ClassWithOpenMember.property.Get() is no longer open for subclass
6464
cake: Class C4 has changed its super class from APINotesTest.OldType to APINotesTest.NewType
6565
cake: Class SubGenericClass has changed its super class from cake.GenericClass<cake.P1> to cake.GenericClass<cake.P2>
6666
cake: Class SuperClassRemoval has removed its super class cake.C3
67-
cake: Constructor AddingNewDesignatedInit.init(_:) has been added as a designated initializer to an open class
6867
cake: Func ClassWithOpenMember.bar() is no longer open for subclassing
6968
cake: Func ClassWithOpenMember.foo() is no longer open for subclassing
7069
cake: Var ClassWithOpenMember.property is no longer open for subclassing

branches/tensorflow/test/api-digester/Outputs/cake-abi.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,7 @@
564564
"implicit": true,
565565
"declAttributes": [
566566
"Inlinable"
567-
],
568-
"init_kind": "Designated"
567+
]
569568
},
570569
{
571570
"kind": "Var",
@@ -1824,5 +1823,5 @@
18241823
]
18251824
}
18261825
],
1827-
"json_format_version": 6
1826+
"json_format_version": 5
18281827
}

branches/tensorflow/test/api-digester/Outputs/cake.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,7 @@
584584
"implicit": true,
585585
"declAttributes": [
586586
"Inlinable"
587-
],
588-
"init_kind": "Designated"
587+
]
589588
},
590589
{
591590
"kind": "Var",
@@ -1675,5 +1674,5 @@
16751674
]
16761675
}
16771676
],
1678-
"json_format_version": 6
1677+
"json_format_version": 5
16791678
}

branches/tensorflow/test/api-digester/Outputs/clang-module-dump.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@
105105
"Override",
106106
"ObjC",
107107
"Dynamic"
108-
],
109-
"init_kind": "Designated"
108+
]
110109
}
111110
],
112111
"declKind": "Class",
@@ -184,5 +183,5 @@
184183
]
185184
}
186185
],
187-
"json_format_version": 6
186+
"json_format_version": 5
188187
}

branches/tensorflow/test/api-digester/Outputs/empty-baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"kind": "Root",
33
"name": "TopLevel",
44
"printedName": "TopLevel",
5-
"json_format_version": 6
5+
"json_format_version": 5
66
}

branches/tensorflow/test/type/opaque.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,8 @@ func recursion(x: Int) -> some P {
172172
return recursion(x: x - 1)
173173
}
174174

175-
func noReturnStmts() -> some P {} // expected-error {{function declares an opaque return type, but has no return statements in its body from which to infer an underlying type}}
176-
177-
func returnUninhabited() -> some P { // expected-note {{opaque return type declared here}}
178-
fatalError() // expected-error{{return type of global function 'returnUninhabited()' requires that 'Never' conform to 'P'}}
179-
}
175+
// FIXME: We need to emit a better diagnostic than the failure to convert Never to opaque.
176+
func noReturnStmts() -> some P { fatalError() } // expected-error{{cannot convert return expression of type 'Never' to return type 'some P'}} expected-error{{no return statements}}
180177

181178
func mismatchedReturnTypes(_ x: Bool, _ y: Int, _ z: String) -> some P { // expected-error{{do not have matching underlying types}}
182179
if x {

branches/tensorflow/tools/swift-api-digester/ModuleAnalyzerNodes.cpp

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ SDKNodeDeclFunction::SDKNodeDeclFunction(SDKNodeInitInfo Info):
132132
FuncSelfKind(Info.FuncSelfKind) {}
133133

134134
SDKNodeDeclConstructor::SDKNodeDeclConstructor(SDKNodeInitInfo Info):
135-
SDKNodeDeclAbstractFunc(Info, SDKNodeKind::DeclConstructor), InitKind(Info.InitKind) {}
135+
SDKNodeDeclAbstractFunc(Info, SDKNodeKind::DeclConstructor) {}
136136

137137
SDKNodeDeclAccessor::SDKNodeDeclAccessor(SDKNodeInitInfo Info):
138138
SDKNodeDeclAbstractFunc(Info, SDKNodeKind::DeclAccessor),
@@ -1271,30 +1271,6 @@ static std::vector<DeclAttrKind> collectDeclAttributes(Decl *D) {
12711271
return Results;
12721272
}
12731273

1274-
CtorInitializerKind SDKNodeDeclConstructor::getInitKind() const {
1275-
#define CASE(KIND) if (InitKind == #KIND) return CtorInitializerKind::KIND;
1276-
CASE(Designated)
1277-
CASE(Convenience)
1278-
CASE(ConvenienceFactory)
1279-
CASE(Factory)
1280-
#undef CASE
1281-
llvm_unreachable("unhandled init kind");
1282-
}
1283-
1284-
StringRef SDKContext::getInitKind(Decl *D) {
1285-
if (auto *CD = dyn_cast<ConstructorDecl>(D)) {
1286-
switch(CD->getInitKind()) {
1287-
#define CASE(KIND) case CtorInitializerKind::KIND: return #KIND;
1288-
CASE(Designated)
1289-
CASE(Convenience)
1290-
CASE(ConvenienceFactory)
1291-
CASE(Factory)
1292-
#undef CASE
1293-
}
1294-
}
1295-
return StringRef();
1296-
}
1297-
12981274
SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, Decl *D):
12991275
Ctx(Ctx), DKind(D->getKind()),
13001276
Location(calculateLocation(Ctx, D)),
@@ -1309,7 +1285,6 @@ SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, Decl *D):
13091285
IntrowatchOS(Ctx.getPlatformIntroVersion(D, PlatformKind::watchOS)),
13101286
Introswift(Ctx.getLanguageIntroVersion(D)),
13111287
ObjCName(Ctx.getObjcName(D)),
1312-
InitKind(Ctx.getInitKind(D)),
13131288
IsImplicit(D->isImplicit()),
13141289
IsDeprecated(D->getAttrs().getDeprecated(D->getASTContext())),
13151290
IsABIPlaceholder(isABIPlaceholderRecursive(D)),
@@ -1941,11 +1916,6 @@ void SDKNodeDeclFunction::jsonize(json::Output &out) {
19411916
output(out, KeyKind::KK_funcSelfKind, FuncSelfKind);
19421917
}
19431918

1944-
void SDKNodeDeclConstructor::jsonize(json::Output &out) {
1945-
SDKNodeDeclAbstractFunc::jsonize(out);
1946-
output(out, KeyKind::KK_init_kind, InitKind);
1947-
}
1948-
19491919
void SDKNodeDeclType::jsonize(json::Output &out) {
19501920
SDKNodeDecl::jsonize(out);
19511921
output(out, KeyKind::KK_superclassUsr, SuperclassUsr);

branches/tensorflow/tools/swift-api-digester/ModuleAnalyzerNodes.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace api {
6262
///
6363
/// When the json format changes in a way that requires version-specific handling, this number should be incremented.
6464
/// This ensures we could have backward compatibility so that version changes in the format won't stop the checker from working.
65-
const uint8_t DIGESTER_JSON_VERSION = 6; // Add initkind for constructors
65+
const uint8_t DIGESTER_JSON_VERSION = 5; // Populate ObjC, Dynamic and Final to attribute list
6666
const uint8_t DIGESTER_JSON_DEFAULT_VERSION = 0; // Use this version number for files before we have a version number in json.
6767

6868
class SDKNode;
@@ -218,7 +218,6 @@ class SDKContext {
218218
StringRef getPlatformIntroVersion(Decl *D, PlatformKind Kind);
219219
StringRef getLanguageIntroVersion(Decl *D);
220220
StringRef getObjcName(Decl *D);
221-
StringRef getInitKind(Decl *D);
222221
bool isEqual(const SDKNode &Left, const SDKNode &Right);
223222
bool checkingABI() const { return Opts.ABI; }
224223
AccessLevel getAccessLevel(const ValueDecl *VD) const;
@@ -678,12 +677,9 @@ class SDKNodeDeclFunction: public SDKNodeDeclAbstractFunc {
678677
};
679678

680679
class SDKNodeDeclConstructor: public SDKNodeDeclAbstractFunc {
681-
StringRef InitKind;
682680
public:
683681
SDKNodeDeclConstructor(SDKNodeInitInfo Info);
684682
static bool classof(const SDKNode *N);
685-
CtorInitializerKind getInitKind() const;
686-
void jsonize(json::Output &Out) override;
687683
};
688684

689685
class SDKNodeDeclAccessor: public SDKNodeDeclAbstractFunc {

0 commit comments

Comments
 (0)