Skip to content

Commit 20049fc

Browse files
authored
---
yaml --- r: 314239 b: refs/heads/rxwei-patch-6 c: 3691944 h: refs/heads/master i: 314237: f1dd8cc 314235: 3179342 314231: 7a490d2 314223: 48e2025 314207: 289870e 314175: 1a66358 314111: e45cced
1 parent 1cddf91 commit 20049fc

File tree

150 files changed

+3091
-1492
lines changed

Some content is hidden

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

150 files changed

+3091
-1492
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ refs/heads/remove-AlignedCharArray: a09ee8660ce66898d5a5a04e2adb4a5ecf1c4644
14221422
refs/heads/revert-25193-gsoc-2019-parser: c66a8be4eb8cea9e606bcbfce52820ad02f23413
14231423
refs/heads/revert-25911-revert-25766-reenable-test-tsan-norace-deinit: 0f330b25b83d3c83ce993f535d4a83bb626aafa3
14241424
refs/heads/revert-26183-rename-adjoint-to-pullback: b16bd9f4bc54ae8ec31f412ac542dcf6f522d9ee
1425-
refs/heads/rxwei-patch-6: 9627a05e005277752492f57cd0fed33de2a739b8
1425+
refs/heads/rxwei-patch-6: 369194427ef1750a7dd1a7880a6030244f7ae38e
14261426
refs/heads/shahmishal-patch-3: f3e0bc73927d564bb35354dc6473a1981f2a864e
14271427
refs/heads/shahmishal/pr-swiftsyntax-test: 64ff140a6dfa78ecea27eeb6d29582650198f3e0
14281428
refs/heads/test-libdispatch-preset-on-swift-5.1-branch: 2ab0acdec00ee31d21490154081c3001648a8b85

branches/rxwei-patch-6/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Please make sure you use Python 2.x. Python 3.x is not supported currently.
7676

7777
#### macOS
7878

79-
To build for macOS, you need [Xcode 11 beta 4](https://developer.apple.com/xcode/downloads/).
79+
To build for macOS, you need [Xcode 11 beta 5](https://developer.apple.com/xcode/downloads/).
8080
The required version of Xcode changes frequently, and is often a beta release.
8181
Check this document or the host information on <https://ci.swift.org> for the
8282
current required version.

branches/rxwei-patch-6/include/swift/ABI/TrailingObjects.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,27 +97,20 @@ class TrailingObjectsBase {
9797
template <typename T> struct OverloadToken {};
9898
};
9999

100-
/// This helper template works-around MSVC 2013's lack of useful
101-
/// alignas() support. The argument to LLVM_ALIGNAS(), in MSVC, is
102-
/// required to be a literal integer. But, you *can* use template
103-
/// specialization to select between a bunch of different LLVM_ALIGNAS
104-
/// expressions...
105100
template <int Align>
106101
class TrailingObjectsAligner : public TrailingObjectsBase {};
107102
template <>
108-
class LLVM_ALIGNAS(1) TrailingObjectsAligner<1> : public TrailingObjectsBase {};
103+
class alignas(1) TrailingObjectsAligner<1> : public TrailingObjectsBase {};
109104
template <>
110-
class LLVM_ALIGNAS(2) TrailingObjectsAligner<2> : public TrailingObjectsBase {};
105+
class alignas(2) TrailingObjectsAligner<2> : public TrailingObjectsBase {};
111106
template <>
112-
class LLVM_ALIGNAS(4) TrailingObjectsAligner<4> : public TrailingObjectsBase {};
107+
class alignas(4) TrailingObjectsAligner<4> : public TrailingObjectsBase {};
113108
template <>
114-
class LLVM_ALIGNAS(8) TrailingObjectsAligner<8> : public TrailingObjectsBase {};
109+
class alignas(8) TrailingObjectsAligner<8> : public TrailingObjectsBase {};
115110
template <>
116-
class LLVM_ALIGNAS(16) TrailingObjectsAligner<16> : public TrailingObjectsBase {
117-
};
111+
class alignas(16) TrailingObjectsAligner<16> : public TrailingObjectsBase {};
118112
template <>
119-
class LLVM_ALIGNAS(32) TrailingObjectsAligner<32> : public TrailingObjectsBase {
120-
};
113+
class alignas(32) TrailingObjectsAligner<32> : public TrailingObjectsBase {};
121114

122115
// Just a little helper for transforming a type pack into the same
123116
// number of a different type. e.g.:

branches/rxwei-patch-6/include/swift/AST/ASTContext.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,20 @@ class ASTContext final {
899899
CanGenericSignature getExistentialSignature(CanType existential,
900900
ModuleDecl *mod);
901901

902-
GenericSignature *getOverrideGenericSignature(ValueDecl *base,
903-
ValueDecl *derived);
902+
GenericSignature *getOverrideGenericSignature(const ValueDecl *base,
903+
const ValueDecl *derived);
904+
905+
enum class OverrideGenericSignatureReqCheck {
906+
/// Base method's generic requirements are satisifed by derived method
907+
BaseReqSatisfiedByDerived,
908+
909+
/// Derived method's generic requirements are satisifed by base method
910+
DerivedReqSatisfiedByBase
911+
};
912+
913+
bool overrideGenericSignatureReqsSatisfied(
914+
const ValueDecl *base, const ValueDecl *derived,
915+
const OverrideGenericSignatureReqCheck direction);
904916

905917
/// Whether our effective Swift version is at least 'major'.
906918
///

branches/rxwei-patch-6/include/swift/AST/ASTTypeIDZone.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ SWIFT_TYPEID_NAMED(ValueDecl *, ValueDecl)
2020
SWIFT_TYPEID_NAMED(ProtocolDecl *, ProtocolDecl)
2121
SWIFT_TYPEID_NAMED(Decl *, Decl)
2222
SWIFT_TYPEID(Type)
23+
SWIFT_TYPEID(TypePair)
2324
SWIFT_TYPEID(PropertyWrapperBackingPropertyInfo)
2425
SWIFT_TYPEID(PropertyWrapperTypeInfo)
2526
SWIFT_TYPEID(CtorInitializerKind)

branches/rxwei-patch-6/include/swift/AST/ASTTypeIDs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class Type;
3030
class VarDecl;
3131
class TypeAliasDecl;
3232
class Type;
33+
struct TypePair;
3334

3435
#define SWIFT_AST_TYPEID_ZONE 1
3536

branches/rxwei-patch-6/include/swift/AST/ASTWalker.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,15 @@ class ASTWalker {
221221
/// bodies of closures that have not yet been type checked.
222222
virtual bool shouldWalkIntoNonSingleExpressionClosure() { return true; }
223223

224+
/// This method configures whether the walker should exhibit the legacy
225+
/// behavior where accessors appear as peers of their storage, rather
226+
/// than children nested inside of it.
227+
///
228+
/// Please don't write new ASTWalker implementations that override this
229+
/// method to return true; instead, refactor existing code as needed
230+
/// until eventually we can remove this altogether.
231+
virtual bool shouldWalkAccessorsTheOldWay() { return false; }
232+
224233
/// walkToParameterListPre - This method is called when first visiting a
225234
/// ParameterList, before walking into its parameters. If it returns false,
226235
/// the subtree is skipped.

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

Lines changed: 62 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,15 @@ class alignas(1 << DeclAlignInBits) Decl {
445445
SelfAccess : 2
446446
);
447447

448-
SWIFT_INLINE_BITFIELD(AccessorDecl, FuncDecl, 4,
448+
SWIFT_INLINE_BITFIELD(AccessorDecl, FuncDecl, 4+1+1,
449449
/// The kind of accessor this is.
450-
AccessorKind : 4
450+
AccessorKind : 4,
451+
452+
/// Whether the accessor is transparent.
453+
IsTransparent : 1,
454+
455+
/// Whether we have computed the above.
456+
IsTransparentComputed : 1
451457
);
452458

453459
SWIFT_INLINE_BITFIELD(ConstructorDecl, AbstractFunctionDecl, 3+2+1,
@@ -2582,12 +2588,6 @@ class ValueDecl : public Decl {
25822588
void setInterfaceType(Type type);
25832589

25842590
bool hasValidSignature() const;
2585-
2586-
/// isSettable - Determine whether references to this decl may appear
2587-
/// on the left-hand side of an assignment or as the operand of a
2588-
/// `&` or 'inout' operator.
2589-
bool isSettable(const DeclContext *UseDC,
2590-
const DeclRefExpr *base = nullptr) const;
25912591

25922592
/// isInstanceMember - Determine whether this value is an instance member
25932593
/// of an enum or protocol.
@@ -4389,6 +4389,9 @@ class AbstractStorageDecl : public ValueDecl {
43894389
friend class IsSetterMutatingRequest;
43904390
friend class OpaqueReadOwnershipRequest;
43914391
friend class StorageImplInfoRequest;
4392+
friend class RequiresOpaqueAccessorsRequest;
4393+
friend class RequiresOpaqueModifyCoroutineRequest;
4394+
friend class SynthesizeAccessorRequest;
43924395

43934396
public:
43944397
static const size_t MaxNumAccessors = 255;
@@ -4452,11 +4455,18 @@ class AbstractStorageDecl : public ValueDecl {
44524455
unsigned OpaqueReadOwnershipComputed : 1;
44534456
unsigned OpaqueReadOwnership : 2;
44544457
unsigned ImplInfoComputed : 1;
4458+
unsigned RequiresOpaqueAccessorsComputed : 1;
4459+
unsigned RequiresOpaqueAccessors : 1;
4460+
unsigned RequiresOpaqueModifyCoroutineComputed : 1;
4461+
unsigned RequiresOpaqueModifyCoroutine : 1;
44554462
} LazySemanticInfo = { };
44564463

44574464
/// The implementation info for the accessors.
44584465
StorageImplInfo ImplInfo;
44594466

4467+
/// Add a synthesized accessor.
4468+
void setSynthesizedAccessor(AccessorKind kind, AccessorDecl *getter);
4469+
44604470
protected:
44614471
AbstractStorageDecl(DeclKind Kind, bool IsStatic, DeclContext *DC,
44624472
DeclName Name, SourceLoc NameLoc,
@@ -4530,6 +4540,12 @@ class AbstractStorageDecl : public ValueDecl {
45304540
return getImplInfo().supportsMutation();
45314541
}
45324542

4543+
/// isSettable - Determine whether references to this decl may appear
4544+
/// on the left-hand side of an assignment or as the operand of a
4545+
/// `&` or 'inout' operator.
4546+
bool isSettable(const DeclContext *UseDC,
4547+
const DeclRefExpr *base = nullptr) const;
4548+
45334549
/// Are there any accessors for this declaration, including implicit ones?
45344550
bool hasAnyAccessors() const {
45354551
return !getAllAccessors().empty();
@@ -4570,6 +4586,12 @@ class AbstractStorageDecl : public ValueDecl {
45704586
return {};
45714587
}
45724588

4589+
/// Return an accessor that this storage is expected to have, synthesizing
4590+
/// one if necessary. Note that will always synthesize one, even if the
4591+
/// accessor is not part of the expected opaque set for the storage, so use
4592+
/// with caution.
4593+
AccessorDecl *getSynthesizedAccessor(AccessorKind kind) const;
4594+
45734595
/// Visit all the opaque accessors that this storage is expected to have.
45744596
void visitExpectedOpaqueAccessors(
45754597
llvm::function_ref<void (AccessorKind)>) const;
@@ -4585,17 +4607,8 @@ class AbstractStorageDecl : public ValueDecl {
45854607
/// This should only be used by the ClangImporter.
45864608
void setComputedSetter(AccessorDecl *Set);
45874609

4588-
/// Add a synthesized getter.
4589-
void setSynthesizedGetter(AccessorDecl *getter);
4590-
4591-
/// Add a synthesized setter.
4592-
void setSynthesizedSetter(AccessorDecl *setter);
4593-
4594-
/// Add a synthesized read coroutine.
4595-
void setSynthesizedReadCoroutine(AccessorDecl *read);
4596-
4597-
/// Add a synthesized modify coroutine.
4598-
void setSynthesizedModifyCoroutine(AccessorDecl *modify);
4610+
/// Does this storage require opaque accessors of any kind?
4611+
bool requiresOpaqueAccessors() const;
45994612

46004613
/// Does this storage require an opaque accessor of the given kind?
46014614
bool requiresOpaqueAccessor(AccessorKind kind) const;
@@ -4634,6 +4647,10 @@ class AbstractStorageDecl : public ValueDecl {
46344647

46354648
AccessLevel getSetterFormalAccess() const;
46364649

4650+
AccessScope
4651+
getSetterFormalAccessScope(const DeclContext *useDC = nullptr,
4652+
bool treatUsableFromInlineAsPublic = false) const;
4653+
46374654
void setSetterAccess(AccessLevel accessLevel) {
46384655
assert(!Accessors.getInt().hasValue());
46394656
overwriteSetterAccess(accessLevel);
@@ -5472,9 +5489,6 @@ class SubscriptDecl : public GenericContext, public AbstractStorageDecl {
54725489
/// element types.
54735490
void computeType();
54745491

5475-
/// Returns whether the result of the subscript operation can be set.
5476-
bool isSettable() const;
5477-
54785492
/// Determine the kind of Objective-C subscripting this declaration
54795493
/// implies.
54805494
ObjCSubscriptKind getObjCSubscriptKind() const;
@@ -5853,10 +5867,6 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
58535867
return cast_or_null<AbstractFunctionDecl>(ValueDecl::getOverriddenDecl());
58545868
}
58555869

5856-
/// Returns true if a function declaration overrides a given
5857-
/// method from its direct or indirect superclass.
5858-
bool isOverridingDecl(const AbstractFunctionDecl *method) const;
5859-
58605870
/// Whether the declaration is later overridden in the module
58615871
///
58625872
/// Overrides are resolved during type checking; only query this field after
@@ -6155,6 +6165,14 @@ class AccessorDecl final : public FuncDecl {
61556165
DeclContext *parent,
61566166
ClangNode clangNode);
61576167

6168+
Optional<bool> getCachedIsTransparent() const {
6169+
if (Bits.AccessorDecl.IsTransparentComputed)
6170+
return Bits.AccessorDecl.IsTransparent;
6171+
return None;
6172+
}
6173+
6174+
friend class IsAccessorTransparentRequest;
6175+
61586176
public:
61596177
static AccessorDecl *createDeserialized(ASTContext &ctx,
61606178
SourceLoc declLoc,
@@ -6233,6 +6251,11 @@ class AccessorDecl final : public FuncDecl {
62336251
llvm_unreachable("bad accessor kind");
62346252
}
62356253

6254+
void setIsTransparent(bool transparent) {
6255+
Bits.AccessorDecl.IsTransparent = transparent;
6256+
Bits.AccessorDecl.IsTransparentComputed = 1;
6257+
}
6258+
62366259
static bool classof(const Decl *D) {
62376260
return D->getKind() == DeclKind::Accessor;
62386261
}
@@ -7041,22 +7064,14 @@ class MissingMemberDecl : public Decl {
70417064
}
70427065
public:
70437066
static MissingMemberDecl *
7044-
forMethod(ASTContext &ctx, DeclContext *DC, DeclName name,
7045-
bool hasNormalVTableEntry) {
7046-
assert(!name || name.isCompoundName());
7047-
return new (ctx) MissingMemberDecl(DC, name, hasNormalVTableEntry, 0);
7048-
}
7067+
create(ASTContext &ctx, DeclContext *DC, DeclName name,
7068+
unsigned numVTableEntries, bool hasStorage) {
7069+
assert(!numVTableEntries || isa<ProtocolDecl>(DC) || isa<ClassDecl>(DC) &&
7070+
"Only classes and protocols have vtable/witness table entries");
7071+
assert(!hasStorage || !isa<ProtocolDecl>(DC) &&
7072+
"Protocols cannot have missing stored properties");
70497073

7050-
static MissingMemberDecl *
7051-
forInitializer(ASTContext &ctx, DeclContext *DC, DeclName name,
7052-
bool hasVTableEntry) {
7053-
unsigned entries = hasVTableEntry ? 1 : 0;
7054-
return new (ctx) MissingMemberDecl(DC, name, entries, 0);
7055-
}
7056-
7057-
static MissingMemberDecl *
7058-
forStoredProperty(ASTContext &ctx, DeclContext *DC, DeclName name) {
7059-
return new (ctx) MissingMemberDecl(DC, name, 0, 1);
7074+
return new (ctx) MissingMemberDecl(DC, name, numVTableEntries, hasStorage);
70607075
}
70617076

70627077
DeclName getFullName() const {
@@ -7084,14 +7099,13 @@ class MissingMemberDecl : public Decl {
70847099
}
70857100
};
70867101

7087-
inline bool ValueDecl::isSettable(const DeclContext *UseDC,
7088-
const DeclRefExpr *base) const {
7089-
if (auto vd = dyn_cast<VarDecl>(this)) {
7102+
inline bool AbstractStorageDecl::isSettable(const DeclContext *UseDC,
7103+
const DeclRefExpr *base) const {
7104+
if (auto vd = dyn_cast<VarDecl>(this))
70907105
return vd->isSettable(UseDC, base);
7091-
} else if (auto sd = dyn_cast<SubscriptDecl>(this)) {
7092-
return sd->isSettable();
7093-
} else
7094-
return false;
7106+
7107+
auto sd = cast<SubscriptDecl>(this);
7108+
return sd->supportsMutation();
70957109
}
70967110

70977111
inline void

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4480,7 +4480,7 @@ NOTE(property_wrapper_declared_here,none,
44804480

44814481
ERROR(property_wrapper_mutating_get_composed_to_get_only,none,
44824482
"property wrapper %0 with a mutating getter cannot be composed inside "
4483-
"get-only property wrapper %1", (Type, Type))
4483+
"get-only property wrapper %1", (TypeLoc, TypeLoc))
44844484

44854485
ERROR(property_wrapper_local,none,
44864486
"property wrappers are not yet supported on local properties", ())

branches/rxwei-patch-6/include/swift/AST/StorageImpl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ class StorageImplInfo {
383383
}
384384
};
385385

386+
StringRef getAccessorLabel(AccessorKind kind);
387+
void simple_display(llvm::raw_ostream &out, AccessorKind kind);
388+
386389
} // end namespace swift
387390

388391
#endif

0 commit comments

Comments
 (0)