Skip to content

Commit e9b10ad

Browse files
committed
---
yaml --- r: 340343 b: refs/heads/rxwei-patch-1 c: 105e4ad h: refs/heads/master i: 340341: 6f5213e 340339: 87eaa77 340335: d93e375
1 parent 1faa598 commit e9b10ad

File tree

178 files changed

+728
-1251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+728
-1251
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 7beb3585d5edfc24e945afca513c24205e7a47a5
1018+
refs/heads/rxwei-patch-1: 105e4ad592b4a462b03e68136b2d8e39ff40ab8e
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/include/swift/AST/Decl.h

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class alignas(1 << DeclAlignInBits) Decl {
553553
NumRequirementsInSignature : 16
554554
);
555555

556-
SWIFT_INLINE_BITFIELD(ClassDecl, NominalTypeDecl, 1+2+1+2+1+6+1+1+1+1,
556+
SWIFT_INLINE_BITFIELD(ClassDecl, NominalTypeDecl, 1+2+1+2+1+6+1+1+1,
557557
/// Whether this class requires all of its instance variables to
558558
/// have in-class initializers.
559559
RequiresStoredPropertyInits : 1,
@@ -581,11 +581,7 @@ class alignas(1 << DeclAlignInBits) Decl {
581581
AncestryComputed : 1,
582582

583583
HasMissingDesignatedInitializers : 1,
584-
HasMissingVTableEntries : 1,
585-
586-
/// Whether instances of this class are incompatible
587-
/// with weak and unowned references.
588-
IsIncompatibleWithWeakReferences : 1
584+
HasMissingVTableEntries : 1
589585
);
590586

591587
SWIFT_INLINE_BITFIELD(StructDecl, NominalTypeDecl, 1,
@@ -3864,17 +3860,6 @@ class ClassDecl final : public NominalTypeDecl {
38643860
Bits.ClassDecl.HasMissingVTableEntries = newValue;
38653861
}
38663862

3867-
/// Returns true if this class cannot be used with weak or unowned
3868-
/// references.
3869-
///
3870-
/// Note that this is true if this class or any of its ancestor classes
3871-
/// are marked incompatible.
3872-
bool isIncompatibleWithWeakReferences() const;
3873-
3874-
void setIsIncompatibleWithWeakReferences(bool newValue = true) {
3875-
Bits.ClassDecl.IsIncompatibleWithWeakReferences = newValue;
3876-
}
3877-
38783863
/// Find a method of a class that overrides a given method.
38793864
/// Return nullptr, if no such method exists.
38803865
AbstractFunctionDecl *findOverridingDecl(

branches/rxwei-patch-1/include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,12 +2538,6 @@ NOTE(decodable_suggest_overriding_init_here,none,
25382538
NOTE(codable_suggest_overriding_init_here,none,
25392539
"did you mean to override 'init(from:)' and 'encode(to:)'?", ())
25402540

2541-
NOTE(missing_member_type_conformance_prevents_synthesis, none,
2542-
"%select{associated value|stored property}0 type %1 does not conform to "
2543-
"protocol %2, preventing synthesized conformance "
2544-
"of %3 to %2",
2545-
(unsigned, Type, Type, Type))
2546-
25472541
// Dynamic Self
25482542
ERROR(dynamic_self_non_method,none,
25492543
"%select{global|local}0 function cannot return 'Self'", (bool))
@@ -3156,7 +3150,7 @@ ERROR(jump_out_of_defer,none,
31563150
(StringRef))
31573151

31583152
WARNING(defer_stmt_at_block_end,none,
3159-
"'defer' statement at end of scope always executes immediately; "
3153+
"'defer' statement before end of scope always executes immediately; "
31603154
"replace with 'do' statement to silence this warning", ())
31613155

31623156
ERROR(return_invalid_outside_func,none,
@@ -3571,9 +3565,6 @@ ERROR(invalid_ownership_protocol_type,none,
35713565
"%0 must not be applied to non-class-bound %1; "
35723566
"consider adding a protocol conformance that has a class bound",
35733567
(ReferenceOwnership, Type))
3574-
ERROR(invalid_ownership_incompatible_class,none,
3575-
"%0 is incompatible with %1 references",
3576-
(Type, ReferenceOwnership))
35773568
ERROR(invalid_ownership_with_optional,none,
35783569
"%0 variable cannot have optional type", (ReferenceOwnership))
35793570
ERROR(invalid_ownership_not_optional,none,

branches/rxwei-patch-1/include/swift/AST/Expr.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,6 @@ class ObjectLiteralExpr final
11351135
Expr *Arg;
11361136
Expr *SemanticExpr;
11371137
SourceLoc PoundLoc;
1138-
ConcreteDeclRef Initializer;
11391138

11401139
ObjectLiteralExpr(SourceLoc PoundLoc, LiteralKind LitKind,
11411140
Expr *Arg,
@@ -1196,15 +1195,6 @@ class ObjectLiteralExpr final
11961195

11971196
StringRef getLiteralKindPlainName() const;
11981197

1199-
/// Retrieve the initializer that will be used to construct the 'object'
1200-
/// literal from the result of the initializer.
1201-
ConcreteDeclRef getInitializer() const { return Initializer; }
1202-
1203-
/// Set the initializer that will be used to construct the 'object' literal.
1204-
void setInitializer(ConcreteDeclRef initializer) {
1205-
Initializer = initializer;
1206-
}
1207-
12081198
static bool classof(const Expr *E) {
12091199
return E->getKind() == ExprKind::ObjectLiteral;
12101200
}

branches/rxwei-patch-1/include/swift/AST/KnownIdentifiers.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ IDENTIFIER(Any)
3131
IDENTIFIER(ArrayLiteralElement)
3232
IDENTIFIER(atIndexedSubscript)
3333
IDENTIFIER_(bridgeToObjectiveC)
34-
IDENTIFIER(Change)
3534
IDENTIFIER_WITH_NAME(code_, "_code")
3635
IDENTIFIER(CodingKeys)
3736
IDENTIFIER(combine)

branches/rxwei-patch-1/include/swift/AST/KnownStdlibTypes.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ KNOWN_STDLIB_TYPE_DECL(Array, NominalTypeDecl, 1)
5454
KNOWN_STDLIB_TYPE_DECL(Set, NominalTypeDecl, 1)
5555
KNOWN_STDLIB_TYPE_DECL(Sequence, NominalTypeDecl, 1)
5656
KNOWN_STDLIB_TYPE_DECL(Dictionary, NominalTypeDecl, 2)
57-
KNOWN_STDLIB_TYPE_DECL(CollectionDifference, NominalTypeDecl, 1)
5857
KNOWN_STDLIB_TYPE_DECL(AnyHashable, NominalTypeDecl, 0)
5958
KNOWN_STDLIB_TYPE_DECL(MutableCollection, ProtocolDecl, 1)
6059
KNOWN_STDLIB_TYPE_DECL(Hasher, NominalTypeDecl, 0)

branches/rxwei-patch-1/include/swift/AST/ParameterList.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ class alignas(ParamDecl *) ParameterList final :
9797

9898
const ParamDecl *operator[](unsigned i) const { return get(i); }
9999
ParamDecl *&operator[](unsigned i) { return get(i); }
100-
bool hasInternalParameter(StringRef prefix) const;
101-
100+
102101
/// Change the DeclContext of any contained parameters to the specified
103102
/// DeclContext.
104103
void setDeclContextOfParamDecls(DeclContext *DC);

branches/rxwei-patch-1/include/swift/SIL/SILVTable.h

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
//
1313
// This file defines the SILVTable class, which is used to map dynamically
1414
// dispatchable class methods and properties to their concrete implementations
15-
// for a dynamic type. This information is used by IRGen to emit class vtables,
16-
// by the devirtualization pass to promote class_method instructions to static
17-
// function_refs.
18-
//
19-
// Note that vtable layout itself is implemented in SILVTableLayout.h and is
20-
// independent of the SILVTable; in general, for a class from another module we
21-
// might not have a SILVTable to deserialize, and for a class in a different
22-
// translation in the same module the SILVTable is not available either.
15+
// for a dynamic type. This information is (FIXME will be) used by IRGen to lay
16+
// out class vtables, and can be used by devirtualization passes to promote
17+
// class_method instructions to static function_refs.
2318
//
2419
//===----------------------------------------------------------------------===//
2520

@@ -61,10 +56,16 @@ class SILVTable : public llvm::ilist_node<SILVTable>,
6156
};
6257

6358
Entry()
64-
: Implementation(nullptr), TheKind(Kind::Normal) { }
59+
: Implementation(nullptr),
60+
TheKind(Kind::Normal),
61+
Linkage(SILLinkage::Private) { }
6562

66-
Entry(SILDeclRef Method, SILFunction *Implementation, Kind TheKind)
67-
: Method(Method), Implementation(Implementation), TheKind(TheKind) { }
63+
Entry(SILDeclRef Method, SILFunction *Implementation,
64+
Kind TheKind, SILLinkage Linkage)
65+
: Method(Method),
66+
Implementation(Implementation),
67+
TheKind(TheKind),
68+
Linkage(Linkage) { }
6869

6970
/// The declaration reference to the least-derived method visible through
7071
/// the class.
@@ -75,6 +76,14 @@ class SILVTable : public llvm::ilist_node<SILVTable>,
7576

7677
/// The entry kind.
7778
Kind TheKind;
79+
80+
/// The linkage of the implementing function.
81+
///
82+
/// This is usually the same as
83+
/// stripExternalFromLinkage(Implementation->getLinkage())
84+
/// except if Implementation is a thunk (which has private or shared
85+
/// linkage).
86+
SILLinkage Linkage;
7887
};
7988

8089
// Disallow copying into temporary objects.

branches/rxwei-patch-1/include/swift/Serialization/ModuleFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
5252
/// describe what change you made. The content of this comment isn't important;
5353
/// it just ensures a conflict if two people change the module format.
5454
/// Don't worry about adhering to the 80-column limit for this line.
55-
const uint16_t SWIFTMODULE_VERSION_MINOR = 494; // remove linkage from SILVTable
55+
const uint16_t SWIFTMODULE_VERSION_MINOR = 493; // dependency types for structs
5656

5757
using DeclIDField = BCFixed<31>;
5858

branches/rxwei-patch-1/lib/AST/ASTContext.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4189,10 +4189,6 @@ bool ASTContext::isTypeBridgedInExternalModule(
41894189
nominal == getFloatDecl() ||
41904190
nominal == getDoubleDecl() ||
41914191
nominal == getArrayDecl() ||
4192-
nominal == getCollectionDifferenceDecl() ||
4193-
(nominal->getDeclContext()->getAsDecl() ==
4194-
getCollectionDifferenceDecl() &&
4195-
nominal->getBaseName() == Id_Change) ||
41964192
nominal == getDictionaryDecl() ||
41974193
nominal == getSetDecl() ||
41984194
nominal == getStringDecl() ||

branches/rxwei-patch-1/lib/AST/ASTDumper.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,8 +1967,6 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
19671967
void visitObjectLiteralExpr(ObjectLiteralExpr *E) {
19681968
printCommon(E, "object_literal")
19691969
<< " kind='" << E->getLiteralKindPlainName() << "'";
1970-
PrintWithColorRAII(OS, LiteralValueColor) << " initializer=";
1971-
E->getInitializer().dump(PrintWithColorRAII(OS, LiteralValueColor).getOS());
19721970
printArgumentLabels(E->getArgumentLabels());
19731971
OS << "\n";
19741972
printRec(E->getArg());

branches/rxwei-patch-1/lib/AST/Decl.cpp

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -531,17 +531,6 @@ bool AbstractFunctionDecl::isTransparent() const {
531531
return false;
532532
}
533533

534-
bool ParameterList::hasInternalParameter(StringRef Prefix) const {
535-
for (auto param : *this) {
536-
if (param->hasName() && param->getNameStr().startswith(Prefix))
537-
return true;
538-
auto argName = param->getArgumentName();
539-
if (!argName.empty() && argName.str().startswith(Prefix))
540-
return true;
541-
}
542-
return false;
543-
}
544-
545534
bool Decl::isPrivateStdlibDecl(bool treatNonBuiltinProtocolsAsPublic) const {
546535
const Decl *D = this;
547536
if (auto ExtD = dyn_cast<ExtensionDecl>(D)) {
@@ -563,15 +552,26 @@ bool Decl::isPrivateStdlibDecl(bool treatNonBuiltinProtocolsAsPublic) const {
563552
FU->getKind() != FileUnitKind::SerializedAST)
564553
return false;
565554

555+
auto hasInternalParameter = [](const ParameterList *params) -> bool {
556+
for (auto param : *params) {
557+
if (param->hasName() && param->getNameStr().startswith("_"))
558+
return true;
559+
auto argName = param->getArgumentName();
560+
if (!argName.empty() && argName.str().startswith("_"))
561+
return true;
562+
}
563+
return false;
564+
};
565+
566566
if (auto AFD = dyn_cast<AbstractFunctionDecl>(D)) {
567567
// If it's a function with a parameter with leading underscore, it's a
568568
// private function.
569-
if (AFD->getParameters()->hasInternalParameter("_"))
569+
if (hasInternalParameter(AFD->getParameters()))
570570
return true;
571571
}
572572

573573
if (auto SubscriptD = dyn_cast<SubscriptDecl>(D)) {
574-
if (SubscriptD->getIndices()->hasInternalParameter("_"))
574+
if (hasInternalParameter(SubscriptD->getIndices()))
575575
return true;
576576
}
577577

@@ -3691,7 +3691,6 @@ ClassDecl::ClassDecl(SourceLoc ClassLoc, Identifier Name, SourceLoc NameLoc,
36913691
Bits.ClassDecl.AncestryComputed = 0;
36923692
Bits.ClassDecl.HasMissingDesignatedInitializers = 0;
36933693
Bits.ClassDecl.HasMissingVTableEntries = 0;
3694-
Bits.ClassDecl.IsIncompatibleWithWeakReferences = 0;
36953694
}
36963695

36973696
bool ClassDecl::hasResilientMetadata() const {
@@ -3775,16 +3774,6 @@ bool ClassDecl::hasMissingVTableEntries() const {
37753774
return Bits.ClassDecl.HasMissingVTableEntries;
37763775
}
37773776

3778-
bool ClassDecl::isIncompatibleWithWeakReferences() const {
3779-
if (Bits.ClassDecl.IsIncompatibleWithWeakReferences) {
3780-
return true;
3781-
}
3782-
if (auto superclass = getSuperclassDecl()) {
3783-
return superclass->isIncompatibleWithWeakReferences();
3784-
}
3785-
return false;
3786-
}
3787-
37883777
bool ClassDecl::inheritsSuperclassInitializers(LazyResolver *resolver) {
37893778
// Check whether we already have a cached answer.
37903779
if (addedImplicitInitializers())
@@ -5444,6 +5433,9 @@ PropertyWrapperTypeInfo VarDecl::getAttachedPropertyWrapperTypeInfo() const {
54445433

54455434
Type VarDecl::getAttachedPropertyWrapperType() const {
54465435
auto &ctx = getASTContext();
5436+
if (!ctx.getLazyResolver())
5437+
return nullptr;
5438+
54475439
auto mutableThis = const_cast<VarDecl *>(this);
54485440
return evaluateOrDefault(ctx.evaluator,
54495441
AttachedPropertyWrapperTypeRequest{mutableThis},
@@ -5452,6 +5444,9 @@ Type VarDecl::getAttachedPropertyWrapperType() const {
54525444

54535445
Type VarDecl::getPropertyWrapperBackingPropertyType() const {
54545446
ASTContext &ctx = getASTContext();
5447+
if (!ctx.getLazyResolver())
5448+
return nullptr;
5449+
54555450
auto mutableThis = const_cast<VarDecl *>(this);
54565451
return evaluateOrDefault(
54575452
ctx.evaluator, PropertyWrapperBackingPropertyTypeRequest{mutableThis},
@@ -5461,6 +5456,9 @@ Type VarDecl::getPropertyWrapperBackingPropertyType() const {
54615456
PropertyWrapperBackingPropertyInfo
54625457
VarDecl::getPropertyWrapperBackingPropertyInfo() const {
54635458
auto &ctx = getASTContext();
5459+
if (!ctx.getLazyResolver())
5460+
return PropertyWrapperBackingPropertyInfo();
5461+
54645462
auto mutableThis = const_cast<VarDecl *>(this);
54655463
return evaluateOrDefault(
54665464
ctx.evaluator,

branches/rxwei-patch-1/lib/AST/ProtocolConformance.cpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -966,23 +966,8 @@ Witness SelfProtocolConformance::getWitness(ValueDecl *requirement,
966966
ConcreteDeclRef
967967
RootProtocolConformance::getWitnessDeclRef(ValueDecl *requirement,
968968
LazyResolver *resolver) const {
969-
if (auto witness = getWitness(requirement, resolver)) {
970-
auto *witnessDecl = witness.getDecl();
971-
972-
// If the witness is generic, you have to call getWitness() and build
973-
// your own substitutions in terms of the synthetic environment.
974-
if (auto *witnessDC = dyn_cast<DeclContext>(witnessDecl))
975-
assert(!witnessDC->isInnermostContextGeneric());
976-
977-
// If the witness is not generic, use type substitutions from the
978-
// witness's parent. Don't use witness.getSubstitutions(), which
979-
// are written in terms of the synthetic environment.
980-
auto subs =
981-
getType()->getContextSubstitutionMap(getDeclContext()->getParentModule(),
982-
witnessDecl->getDeclContext());
983-
return ConcreteDeclRef(witness.getDecl(), subs);
984-
}
985-
969+
if (auto witness = getWitness(requirement, resolver))
970+
return witness.getDeclRef();
986971
return ConcreteDeclRef();
987972
}
988973

@@ -1135,6 +1120,11 @@ SpecializedProtocolConformance::getWitnessDeclRef(
11351120
auto witnessMap = baseWitness.getSubstitutions();
11361121

11371122
auto combinedMap = witnessMap.subst(specializationMap);
1123+
1124+
// Fast path if the substitutions didn't change.
1125+
if (combinedMap == baseWitness.getSubstitutions())
1126+
return baseWitness;
1127+
11381128
return ConcreteDeclRef(witnessDecl, combinedMap);
11391129
}
11401130

branches/rxwei-patch-1/lib/AST/TypeCheckRequests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ void PropertyWrapperBackingPropertyTypeRequest::noteCycleStep(
648648
DiagnosticEngine &diags) const {
649649
std::get<0>(getStorage())->diagnose(diag::circular_reference_through);
650650
}
651-
652651
bool PropertyWrapperBackingPropertyInfoRequest::isCached() const {
653652
auto var = std::get<0>(getStorage());
654653
return !var->getAttrs().isEmpty();

branches/rxwei-patch-1/lib/ClangImporter/ImportDecl.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4692,9 +4692,6 @@ namespace {
46924692
}
46934693
#include "InferredAttributes.def"
46944694

4695-
if (decl->isArcWeakrefUnavailable())
4696-
result->setIsIncompatibleWithWeakReferences();
4697-
46984695
result->setMemberLoader(&Impl, 0);
46994696
result->addImplicitDestructor();
47004697

branches/rxwei-patch-1/lib/IDE/Formatting.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -481,25 +481,6 @@ class FormatContext {
481481
}
482482
}
483483

484-
// Chained trailing closures shouldn't require additional indentation.
485-
// a.map {
486-
// ...
487-
// }.filter { <--- No indentation here.
488-
// ...
489-
// }.map { <--- No indentation here.
490-
// ...
491-
// }
492-
if (AtExprEnd && AtCursorExpr &&
493-
(isa<CallExpr>(AtExprEnd) || isa<SubscriptExpr>(AtExprEnd))) {
494-
if (auto *UDE = dyn_cast<UnresolvedDotExpr>(AtCursorExpr)) {
495-
if (auto *Base = UDE->getBase()) {
496-
if (exprEndAtLine(Base, Line))
497-
return false;
498-
}
499-
}
500-
}
501-
502-
503484
// Indent another level from the outer context by default.
504485
return true;
505486
}

0 commit comments

Comments
 (0)