Skip to content

Commit 11743b5

Browse files
---
yaml --- r: 349159 b: refs/heads/master-next c: 7189c09 h: refs/heads/master i: 349157: 82cfd28 349155: 832fa1d 349151: 6cb0da7
1 parent c9bb6cf commit 11743b5

File tree

160 files changed

+2011
-1376
lines changed

Some content is hidden

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

160 files changed

+2011
-1376
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 874bb1df259607ffe3f03e294a41e7b6048738ed
3+
refs/heads/master-next: 7189c09720307d198bed5d43ce7cff27b51c9061
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Swift Next
8181
mutableSelf.someProperty = newValue // Okay
8282
}
8383
}
84-
```
84+
```
8585

8686
* [SE-0253][]:
8787

@@ -145,6 +145,8 @@ Swift Next
145145
Swift 5.1
146146
---------
147147

148+
### 2019-09-20 (Xcode 11.0)
149+
148150
* [SR-8974][]:
149151

150152
Duplicate tuple element labels are no longer allowed, because it leads

branches/master-next/cmake/modules/SwiftSource.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,13 @@ function(_compile_swift_files
310310
set(module_base "${module_dir}/${SWIFTFILE_MODULE_NAME}")
311311
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
312312
set(specific_module_dir "${module_base}.swiftmodule")
313+
set(specific_module_private_dir "${specific_module_dir}/Private")
314+
set(source_info_file "${specific_module_private_dir}/${SWIFTFILE_ARCHITECTURE}.swiftsourceinfo")
313315
set(module_base "${module_base}.swiftmodule/${SWIFTFILE_ARCHITECTURE}")
314316
else()
315317
set(specific_module_dir)
318+
set(specific_module_private_dir)
319+
set(source_info_file "${module_base}.swiftsourceinfo")
316320
endif()
317321
set(module_file "${module_base}.swiftmodule")
318322
set(module_doc_file "${module_base}.swiftdoc")
@@ -322,6 +326,8 @@ function(_compile_swift_files
322326
set(sib_file "${module_base}.Onone.sib")
323327
set(sibopt_file "${module_base}.O.sib")
324328
set(sibgen_file "${module_base}.sibgen")
329+
list(APPEND swift_module_flags
330+
"-emit-module-source-info-path" "${source_info_file}")
325331

326332
if(SWIFT_ENABLE_MODULE_INTERFACES)
327333
set(interface_file "${module_base}.swiftinterface")
@@ -349,7 +355,8 @@ function(_compile_swift_files
349355
swift_install_in_component(DIRECTORY "${specific_module_dir}"
350356
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
351357
COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT}"
352-
OPTIONAL)
358+
OPTIONAL
359+
PATTERN "Private" EXCLUDE)
353360
else()
354361
swift_install_in_component(FILES ${module_outputs}
355362
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
@@ -490,6 +497,7 @@ function(_compile_swift_files
490497
COMMAND
491498
"${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir}
492499
${specific_module_dir}
500+
${specific_module_private_dir}
493501
COMMAND
494502
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
495503
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"

branches/master-next/docs/ABI/Mangling.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ Entities
290290
entity-spec ::= type 'fu' INDEX // implicit anonymous closure
291291
entity-spec ::= 'fA' INDEX // default argument N+1 generator
292292
entity-spec ::= 'fi' // non-local variable initializer
293+
entity-spec ::= 'fP' // property wrapper backing initializer
293294
entity-spec ::= 'fD' // deallocating destructor; untyped
294295
entity-spec ::= 'fd' // non-deallocating destructor; untyped
295296
entity-spec ::= 'fE' // ivar destroyer; untyped

branches/master-next/include/swift/AST/ASTMangler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ class ASTMangler : public Mangler {
124124
SymbolKind SKind);
125125

126126
std::string mangleInitializerEntity(const VarDecl *var, SymbolKind SKind);
127+
std::string mangleBackingInitializerEntity(const VarDecl *var,
128+
SymbolKind SKind);
127129

128130
std::string mangleNominalType(const NominalTypeDecl *decl);
129131

@@ -311,6 +313,7 @@ class ASTMangler : public Mangler {
311313
void appendDefaultArgumentEntity(const DeclContext *ctx, unsigned index);
312314

313315
void appendInitializerEntity(const VarDecl *var);
316+
void appendBackingInitializerEntity(const VarDecl *var);
314317

315318
CanType getDeclTypeForMangling(const ValueDecl *decl,
316319
GenericSignature *&genericSig,

branches/master-next/include/swift/AST/ASTTypeIDZone.def

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,29 @@
1414
// for use with the TypeID template.
1515
//
1616
//===----------------------------------------------------------------------===//
17-
SWIFT_TYPEID_NAMED(NominalTypeDecl *, NominalTypeDecl)
18-
SWIFT_TYPEID_NAMED(VarDecl *, VarDecl)
19-
SWIFT_TYPEID_NAMED(ValueDecl *, ValueDecl)
20-
SWIFT_TYPEID_NAMED(ProtocolDecl *, ProtocolDecl)
21-
SWIFT_TYPEID_NAMED(Decl *, Decl)
22-
SWIFT_TYPEID_NAMED(ModuleDecl *, ModuleDecl)
23-
SWIFT_TYPEID(Type)
24-
SWIFT_TYPEID(TypePair)
17+
18+
SWIFT_TYPEID(AncestryFlags)
19+
SWIFT_TYPEID(CtorInitializerKind)
2520
SWIFT_TYPEID(PropertyWrapperBackingPropertyInfo)
2621
SWIFT_TYPEID(PropertyWrapperTypeInfo)
27-
SWIFT_TYPEID(CtorInitializerKind)
22+
SWIFT_TYPEID(Requirement)
2823
SWIFT_TYPEID(ResilienceExpansion)
29-
SWIFT_TYPEID_NAMED(Optional<PropertyWrapperMutability>, PropertyWrapperMutability)
24+
SWIFT_TYPEID(Type)
25+
SWIFT_TYPEID(TypePair)
3026
SWIFT_TYPEID_NAMED(CustomAttr *, CustomAttr)
31-
SWIFT_TYPEID_NAMED(OperatorDecl *, OperatorDecl)
32-
SWIFT_TYPEID_NAMED(TypeAliasDecl *, TypeAliasDecl)
33-
SWIFT_TYPEID(AncestryFlags)
27+
SWIFT_TYPEID_NAMED(Decl *, Decl)
28+
SWIFT_TYPEID_NAMED(GenericParamList *, GenericParamList)
3429
SWIFT_TYPEID_NAMED(GenericSignature *, GenericSignature)
3530
SWIFT_TYPEID_NAMED(GenericTypeParamType *, GenericTypeParamType)
36-
SWIFT_TYPEID(Requirement)
31+
SWIFT_TYPEID_NAMED(InfixOperatorDecl *, InfixOperatorDecl)
3732
SWIFT_TYPEID_NAMED(IterableDeclContext *, IterableDeclContext)
38-
SWIFT_TYPEID_NAMED(GenericParamList *, GenericParamList)
33+
SWIFT_TYPEID_NAMED(ModuleDecl *, ModuleDecl)
34+
SWIFT_TYPEID_NAMED(NominalTypeDecl *, NominalTypeDecl)
35+
SWIFT_TYPEID_NAMED(OperatorDecl *, OperatorDecl)
36+
SWIFT_TYPEID_NAMED(Optional<PropertyWrapperMutability>,
37+
PropertyWrapperMutability)
38+
SWIFT_TYPEID_NAMED(PrecedenceGroupDecl *, PrecedenceGroupDecl)
39+
SWIFT_TYPEID_NAMED(ProtocolDecl *, ProtocolDecl)
40+
SWIFT_TYPEID_NAMED(TypeAliasDecl *, TypeAliasDecl)
41+
SWIFT_TYPEID_NAMED(ValueDecl *, ValueDecl)
42+
SWIFT_TYPEID_NAMED(VarDecl *, VarDecl)

branches/master-next/include/swift/AST/ASTTypeIDs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ class Decl;
2626
class GenericParamList;
2727
class GenericSignature;
2828
class GenericTypeParamType;
29+
class InfixOperatorDecl;
2930
class IterableDeclContext;
3031
class ModuleDecl;
3132
class NominalTypeDecl;
3233
class OperatorDecl;
34+
class PrecedenceGroupDecl;
3335
struct PropertyWrapperBackingPropertyInfo;
3436
struct PropertyWrapperTypeInfo;
3537
enum class CtorInitializerKind;

branches/master-next/include/swift/AST/Decl.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6909,7 +6909,6 @@ class OperatorDecl : public Decl {
69096909
/// \endcode
69106910
class InfixOperatorDecl : public OperatorDecl {
69116911
SourceLoc ColonLoc;
6912-
PrecedenceGroupDecl *PrecedenceGroup = nullptr;
69136912

69146913
public:
69156914
InfixOperatorDecl(DeclContext *DC, SourceLoc operatorLoc, Identifier name,
@@ -6920,14 +6919,6 @@ class InfixOperatorDecl : public OperatorDecl {
69206919
identifiers, identifierLocs),
69216920
ColonLoc(colonLoc) {}
69226921

6923-
InfixOperatorDecl(DeclContext *DC, SourceLoc operatorLoc, Identifier name,
6924-
SourceLoc nameLoc, SourceLoc colonLoc,
6925-
PrecedenceGroupDecl *precedenceGroup,
6926-
ArrayRef<NominalTypeDecl *> designatedNominalTypes)
6927-
: OperatorDecl(DeclKind::InfixOperator, DC, operatorLoc, name, nameLoc,
6928-
designatedNominalTypes),
6929-
ColonLoc(colonLoc), PrecedenceGroup(precedenceGroup) {}
6930-
69316922
SourceLoc getEndLoc() const {
69326923
auto identifierLocs = getIdentifierLocs();
69336924
if (identifierLocs.empty())
@@ -6942,10 +6933,7 @@ class InfixOperatorDecl : public OperatorDecl {
69426933

69436934
SourceLoc getColonLoc() const { return ColonLoc; }
69446935

6945-
PrecedenceGroupDecl *getPrecedenceGroup() const { return PrecedenceGroup; }
6946-
void setPrecedenceGroup(PrecedenceGroupDecl *PGD) {
6947-
PrecedenceGroup = PGD;
6948-
}
6936+
PrecedenceGroupDecl *getPrecedenceGroup() const;
69496937

69506938
/// True if this decl's attributes conflict with those declared by another
69516939
/// operator.

branches/master-next/include/swift/AST/DiagnosticsFrontend.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ ERROR(error_mode_cannot_emit_module,none,
124124
"this mode does not support emitting modules", ())
125125
ERROR(error_mode_cannot_emit_module_doc,none,
126126
"this mode does not support emitting module documentation files", ())
127+
ERROR(error_mode_cannot_emit_module_source_info,none,
128+
"this mode does not support emitting module source info files", ())
127129
ERROR(error_mode_cannot_emit_interface,none,
128130
"this mode does not support emitting module interface files", ())
129131

branches/master-next/include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4528,8 +4528,6 @@ ERROR(property_wrapper_wrong_initial_value_init, none,
45284528
(DeclName, Type, Type))
45294529
ERROR(property_wrapper_failable_init, none,
45304530
"%0 cannot be failable", (DeclName))
4531-
ERROR(property_wrapper_ambiguous_initial_value_init, none,
4532-
"property wrapper type %0 has multiple initial-value initializers", (Type))
45334531
ERROR(property_wrapper_ambiguous_default_value_init, none,
45344532
"property wrapper type %0 has multiple default-value initializers", (Type))
45354533
ERROR(property_wrapper_type_requirement_not_accessible,none,

branches/master-next/include/swift/AST/NameLookupRequests.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "swift/AST/SimpleRequest.h"
2020
#include "swift/AST/ASTTypeIDs.h"
2121
#include "swift/Basic/Statistic.h"
22+
#include "llvm/ADT/Hashing.h"
2223
#include "llvm/ADT/TinyPtrVector.h"
2324

2425
namespace swift {
@@ -273,6 +274,56 @@ class GenericParamListRequest :
273274
void cacheResult(GenericParamList *value) const;
274275
};
275276

277+
struct PrecedenceGroupDescriptor {
278+
DeclContext *dc;
279+
Identifier ident;
280+
SourceLoc nameLoc;
281+
282+
SourceLoc getLoc() const;
283+
284+
friend llvm::hash_code hash_value(const PrecedenceGroupDescriptor &owner) {
285+
return hash_combine(llvm::hash_value(owner.dc),
286+
llvm::hash_value(owner.ident.getAsOpaquePointer()),
287+
llvm::hash_value(owner.nameLoc.getOpaquePointerValue()));
288+
}
289+
290+
friend bool operator==(const PrecedenceGroupDescriptor &lhs,
291+
const PrecedenceGroupDescriptor &rhs) {
292+
return lhs.dc == rhs.dc &&
293+
lhs.ident == rhs.ident &&
294+
lhs.nameLoc == rhs.nameLoc;
295+
}
296+
297+
friend bool operator!=(const PrecedenceGroupDescriptor &lhs,
298+
const PrecedenceGroupDescriptor &rhs) {
299+
return !(lhs == rhs);
300+
}
301+
};
302+
303+
void simple_display(llvm::raw_ostream &out, const PrecedenceGroupDescriptor &d);
304+
305+
class LookupPrecedenceGroupRequest
306+
: public SimpleRequest<LookupPrecedenceGroupRequest,
307+
PrecedenceGroupDecl *(PrecedenceGroupDescriptor),
308+
CacheKind::Cached> {
309+
public:
310+
using SimpleRequest::SimpleRequest;
311+
312+
private:
313+
friend SimpleRequest;
314+
315+
// Evaluation.
316+
llvm::Expected<PrecedenceGroupDecl *>
317+
evaluate(Evaluator &evaluator, PrecedenceGroupDescriptor descriptor) const;
318+
319+
public:
320+
// Source location
321+
SourceLoc getNearestLoc() const;
322+
323+
// Separate caching.
324+
bool isCached() const { return true; }
325+
};
326+
276327
#define SWIFT_TYPEID_ZONE NameLookup
277328
#define SWIFT_TYPEID_HEADER "swift/AST/NameLookupTypeIDZone.def"
278329
#include "swift/Basic/DefineTypeIDZone.h"

branches/master-next/include/swift/AST/NameLookupTypeIDZone.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ SWIFT_REQUEST(NameLookup, InheritedDeclsReferencedRequest,
3030
DirectlyReferencedTypeDecls(
3131
llvm::PointerUnion<TypeDecl *, ExtensionDecl *>, unsigned),
3232
Uncached, HasNearestLocation)
33+
SWIFT_REQUEST(NameLookup, LookupPrecedenceGroupRequest,
34+
PrecedenceGroupDecl *(DeclContext *, Identifier, SourceLoc),
35+
Cached, NoLocationInfo)
3336
SWIFT_REQUEST(NameLookup, SelfBoundsFromWhereClauseRequest,
3437
SelfBounds(llvm::PointerUnion<TypeDecl *, ExtensionDecl *>),
3538
Uncached, NoLocationInfo)

branches/master-next/include/swift/AST/PropertyWrappers.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ struct PropertyWrapperTypeInfo {
3535
/// directed.
3636
VarDecl *valueVar = nullptr;
3737

38-
/// The initializer init(wrappedValue:) that will be called when the
38+
/// Whether there is an init(wrappedValue:) that will be called when the
3939
/// initializing the property wrapper type from a value of the property type.
40-
///
41-
/// This initializer is optional, but if present will be used for the `=`
42-
/// initialization syntax.
43-
ConstructorDecl *wrappedValueInit = nullptr;
40+
enum {
41+
NoWrappedValueInit = 0,
42+
HasWrappedValueInit,
43+
HasInitialValueInit
44+
} wrappedValueInit = NoWrappedValueInit;
4445

4546
/// The initializer `init()` that will be called to default-initialize a
4647
/// value with an attached property wrapper.

branches/master-next/include/swift/AST/TypeCheckRequests.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class AbstractStorageDecl;
3333
class AccessorDecl;
3434
enum class AccessorKind;
3535
class GenericParamList;
36+
class PrecedenceGroupDecl;
3637
struct PropertyWrapperBackingPropertyInfo;
3738
struct PropertyWrapperMutability;
3839
class RequirementRepr;
@@ -1094,7 +1095,7 @@ class InferredGenericSignatureRequest :
10941095
public SimpleRequest<InferredGenericSignatureRequest,
10951096
GenericSignature *(ModuleDecl *,
10961097
GenericSignature *,
1097-
SmallVector<GenericParamList *, 2>,
1098+
GenericParamList *,
10981099
SmallVector<Requirement, 2>,
10991100
SmallVector<TypeLoc, 2>,
11001101
bool),
@@ -1110,7 +1111,7 @@ class InferredGenericSignatureRequest :
11101111
evaluate(Evaluator &evaluator,
11111112
ModuleDecl *module,
11121113
GenericSignature *baseSignature,
1113-
SmallVector<GenericParamList *, 2> addedParameters,
1114+
GenericParamList *gpl,
11141115
SmallVector<Requirement, 2> addedRequirements,
11151116
SmallVector<TypeLoc, 2> inferenceSources,
11161117
bool allowConcreteGenericParams) const;
@@ -1209,6 +1210,25 @@ class UnderlyingTypeRequest :
12091210
void cacheResult(Type value) const;
12101211
};
12111212

1213+
class OperatorPrecedenceGroupRequest
1214+
: public SimpleRequest<OperatorPrecedenceGroupRequest,
1215+
PrecedenceGroupDecl *(InfixOperatorDecl *),
1216+
CacheKind::Cached> {
1217+
public:
1218+
using SimpleRequest::SimpleRequest;
1219+
1220+
private:
1221+
friend SimpleRequest;
1222+
1223+
// Evaluation.
1224+
llvm::Expected<PrecedenceGroupDecl *>
1225+
evaluate(Evaluator &evaluator, InfixOperatorDecl *PGD) const;
1226+
1227+
public:
1228+
// Separate caching.
1229+
bool isCached() const { return true; }
1230+
};
1231+
12121232
// Allow AnyValue to compare two Type values, even though Type doesn't
12131233
// support ==.
12141234
template<>

branches/master-next/include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ SWIFT_REQUEST(NameLookup, GenericSignatureRequest,
5454
SeparatelyCached, NoLocationInfo)
5555
SWIFT_REQUEST(TypeChecker, InferredGenericSignatureRequest,
5656
GenericSignature *(ModuleDecl *, GenericSignature *,
57-
SmallVector<GenericParamList *, 2>,
57+
GenericParamList *,
5858
SmallVector<Requirement, 2>,
5959
SmallVector<TypeLoc, 2>, bool),
6060
Cached, NoLocationInfo)
@@ -85,6 +85,9 @@ SWIFT_REQUEST(TypeChecker, MangleLocalTypeDeclRequest,
8585
SWIFT_REQUEST(TypeChecker, OpaqueReadOwnershipRequest,
8686
OpaqueReadOwnership(AbstractStorageDecl *), SeparatelyCached,
8787
NoLocationInfo)
88+
SWIFT_REQUEST(TypeChecker, OperatorPrecedenceGroupRequest,
89+
PrecedenceGroupDecl *(PrecedenceGroupDecl *),
90+
Cached, NoLocationInfo)
8891
SWIFT_REQUEST(TypeChecker, OverriddenDeclsRequest,
8992
llvm::TinyPtrVector<ValueDecl *>(ValueDecl *), SeparatelyCached,
9093
NoLocationInfo)

branches/master-next/include/swift/Basic/FileTypes.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ TYPE("autolink", AutolinkFile, "autolink", "")
5050
TYPE("swiftmodule", SwiftModuleFile, "swiftmodule", "")
5151
TYPE("swiftdoc", SwiftModuleDocFile, "swiftdoc", "")
5252
TYPE("swiftinterface", SwiftModuleInterfaceFile, "swiftinterface", "")
53+
TYPE("swiftsourceinfo", SwiftSourceInfoFile, "swiftsourceinfo", "")
5354
TYPE("assembly", Assembly, "s", "")
5455
TYPE("raw-sil", RawSIL, "sil", "")
5556
TYPE("raw-sib", RawSIB, "sib", "")

0 commit comments

Comments
 (0)