Skip to content

Commit 61bdf24

Browse files
authored
---
yaml --- r: 349222 b: refs/heads/master-next c: 0967783 h: refs/heads/master
1 parent 1392416 commit 61bdf24

File tree

253 files changed

+8382
-3075
lines changed

Some content is hidden

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

253 files changed

+8382
-3075
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: 1cce12f20c283d980d017f12324eb42b6f9bf298
3+
refs/heads/master-next: 096778317048303b95a7aa56d1de9601829bee69
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: 8 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")
@@ -349,7 +353,8 @@ function(_compile_swift_files
349353
swift_install_in_component(DIRECTORY "${specific_module_dir}"
350354
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
351355
COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT}"
352-
OPTIONAL)
356+
OPTIONAL
357+
PATTERN "Private" EXCLUDE)
353358
else()
354359
swift_install_in_component(FILES ${module_outputs}
355360
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
@@ -490,9 +495,11 @@ function(_compile_swift_files
490495
COMMAND
491496
"${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir}
492497
${specific_module_dir}
498+
${specific_module_private_dir}
493499
COMMAND
494500
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
495501
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"
502+
"-emit-module-source-info-path" "${source_info_file}"
496503
${swift_flags} ${swift_module_flags} "@${file_path}"
497504
${command_touch_module_outputs}
498505
OUTPUT ${module_outputs}

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ SWIFT_TYPEID_NAMED(Decl *, Decl)
2828
SWIFT_TYPEID_NAMED(GenericParamList *, GenericParamList)
2929
SWIFT_TYPEID_NAMED(GenericSignature *, GenericSignature)
3030
SWIFT_TYPEID_NAMED(GenericTypeParamType *, GenericTypeParamType)
31+
SWIFT_TYPEID_NAMED(InfixOperatorDecl *, InfixOperatorDecl)
3132
SWIFT_TYPEID_NAMED(IterableDeclContext *, IterableDeclContext)
3233
SWIFT_TYPEID_NAMED(ModuleDecl *, ModuleDecl)
3334
SWIFT_TYPEID_NAMED(NominalTypeDecl *, NominalTypeDecl)
3435
SWIFT_TYPEID_NAMED(OperatorDecl *, OperatorDecl)
3536
SWIFT_TYPEID_NAMED(Optional<PropertyWrapperMutability>,
3637
PropertyWrapperMutability)
38+
SWIFT_TYPEID_NAMED(PrecedenceGroupDecl *, PrecedenceGroupDecl)
3739
SWIFT_TYPEID_NAMED(ProtocolDecl *, ProtocolDecl)
3840
SWIFT_TYPEID_NAMED(TypeAliasDecl *, TypeAliasDecl)
3941
SWIFT_TYPEID_NAMED(ValueDecl *, ValueDecl)

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@
2121
#include "swift/Basic/TypeID.h"
2222
namespace swift {
2323

24+
class AbstractFunctionDecl;
25+
class BraceStmt;
2426
class CustomAttr;
2527
class Decl;
2628
class GenericParamList;
2729
class GenericSignature;
2830
class GenericTypeParamType;
31+
class InfixOperatorDecl;
2932
class IterableDeclContext;
3033
class ModuleDecl;
3134
class NominalTypeDecl;
3235
class OperatorDecl;
36+
class PrecedenceGroupDecl;
3337
struct PropertyWrapperBackingPropertyInfo;
3438
struct PropertyWrapperTypeInfo;
3539
enum class CtorInitializerKind;

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

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5689,7 +5689,8 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
56895689
/// Note that a true return value does not imply that the body was actually
56905690
/// parsed.
56915691
bool hasBody() const {
5692-
return getBodyKind() != BodyKind::None;
5692+
return getBodyKind() != BodyKind::None &&
5693+
getBodyKind() != BodyKind::Skipped;
56935694
}
56945695

56955696
/// Returns true if the text of this function's body can be retrieved either
@@ -5716,14 +5717,22 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
57165717
/// Note that the body was skipped for this function. Function body
57175718
/// cannot be attached after this call.
57185719
void setBodySkipped(SourceRange bodyRange) {
5719-
assert(getBodyKind() == BodyKind::None);
5720+
// FIXME: Remove 'Parsed' from this once we can delay parsing function
5721+
// bodies. Right now -experimental-skip-non-inlinable-function-bodies
5722+
// requires being able to change the state from Parsed to Skipped,
5723+
// because we're still eagerly parsing function bodies.
5724+
assert(getBodyKind() == BodyKind::None ||
5725+
getBodyKind() == BodyKind::Unparsed ||
5726+
getBodyKind() == BodyKind::Parsed);
5727+
assert(bodyRange.isValid());
57205728
BodyRange = bodyRange;
57215729
setBodyKind(BodyKind::Skipped);
57225730
}
57235731

57245732
/// Note that parsing for the body was delayed.
57255733
void setBodyDelayed(SourceRange bodyRange) {
57265734
assert(getBodyKind() == BodyKind::None);
5735+
assert(bodyRange.isValid());
57275736
BodyRange = bodyRange;
57285737
setBodyKind(BodyKind::Unparsed);
57295738
}
@@ -5769,6 +5778,10 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
57695778
return getBodyKind() == BodyKind::TypeChecked;
57705779
}
57715780

5781+
bool isBodySkipped() const {
5782+
return getBodyKind() == BodyKind::Skipped;
5783+
}
5784+
57725785
bool isMemberwiseInitializer() const {
57735786
return getBodyKind() == BodyKind::MemberwiseInitializer;
57745787
}
@@ -6329,9 +6342,7 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63296342

63306343
/// The raw value literal for the enum element, or null.
63316344
LiteralExpr *RawValueExpr;
6332-
/// The type-checked raw value expression.
6333-
Expr *TypeCheckedRawValueExpr = nullptr;
6334-
6345+
63356346
public:
63366347
EnumElementDecl(SourceLoc IdentifierLoc, DeclName Name,
63376348
ParameterList *Params,
@@ -6364,13 +6375,6 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63646375
bool hasRawValueExpr() const { return RawValueExpr; }
63656376
LiteralExpr *getRawValueExpr() const { return RawValueExpr; }
63666377
void setRawValueExpr(LiteralExpr *e) { RawValueExpr = e; }
6367-
6368-
Expr *getTypeCheckedRawValueExpr() const {
6369-
return TypeCheckedRawValueExpr;
6370-
}
6371-
void setTypeCheckedRawValueExpr(Expr *e) {
6372-
TypeCheckedRawValueExpr = e;
6373-
}
63746378

63756379
/// Return the containing EnumDecl.
63766380
EnumDecl *getParentEnum() const {
@@ -6909,7 +6913,6 @@ class OperatorDecl : public Decl {
69096913
/// \endcode
69106914
class InfixOperatorDecl : public OperatorDecl {
69116915
SourceLoc ColonLoc;
6912-
PrecedenceGroupDecl *PrecedenceGroup = nullptr;
69136916

69146917
public:
69156918
InfixOperatorDecl(DeclContext *DC, SourceLoc operatorLoc, Identifier name,
@@ -6920,14 +6923,6 @@ class InfixOperatorDecl : public OperatorDecl {
69206923
identifiers, identifierLocs),
69216924
ColonLoc(colonLoc) {}
69226925

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-
69316926
SourceLoc getEndLoc() const {
69326927
auto identifierLocs = getIdentifierLocs();
69336928
if (identifierLocs.empty())
@@ -6942,10 +6937,7 @@ class InfixOperatorDecl : public OperatorDecl {
69426937

69436938
SourceLoc getColonLoc() const { return ColonLoc; }
69446939

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

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

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,15 @@ class alignas(1 << DeclContextAlignInBits) DeclContext {
409409
const_cast<DeclContext *>(this)->getInnermostDeclarationDeclContext();
410410
}
411411

412+
/// Returns the innermost context that is an AbstractFunctionDecl whose
413+
/// body has been skipped.
414+
LLVM_READONLY
415+
DeclContext *getInnermostSkippedFunctionContext();
416+
const DeclContext *getInnermostSkippedFunctionContext() const {
417+
return
418+
const_cast<DeclContext *>(this)->getInnermostSkippedFunctionContext();
419+
}
420+
412421
/// Returns the semantic parent of this context. A context has a
413422
/// parent if and only if it is not a module context.
414423
DeclContext *getParent() const {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
#ifndef SWIFT_BASIC_DIAGNOSTICENGINE_H
1919
#define SWIFT_BASIC_DIAGNOSTICENGINE_H
2020

21-
#include "swift/AST/Attr.h"
2221
#include "swift/AST/TypeLoc.h"
2322
#include "swift/AST/DeclNameLoc.h"
2423
#include "swift/AST/DiagnosticConsumer.h"
2524
#include "llvm/ADT/StringMap.h"
2625
#include "llvm/Support/Allocator.h"
26+
#include "llvm/Support/VersionTuple.h"
2727

2828
namespace swift {
2929
class Decl;
30+
class DeclAttribute;
3031
class DiagnosticEngine;
3132
class SourceManager;
3233
class ValueDecl;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,13 @@ 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", ())
131+
ERROR(cannot_emit_ir_skipping_function_bodies,none,
132+
"-experimental-skip-non-inlinable-function-bodies does not support "
133+
"emitting IR", ())
129134

130135
WARNING(emit_reference_dependencies_without_primary_file,none,
131136
"ignoring -emit-reference-dependencies (requires -primary-file)", ())

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,8 @@ ERROR(missing_argument_named,none,
11161116
"missing argument for parameter %0 in call", (Identifier))
11171117
ERROR(missing_argument_positional,none,
11181118
"missing argument for parameter #%0 in call", (unsigned))
1119+
ERROR(missing_arguments_in_call,none,
1120+
"missing arguments for parameters %0 in call", (StringRef))
11191121
ERROR(extra_argument_named,none,
11201122
"extra argument %0 in call", (Identifier))
11211123
ERROR(extra_argument_positional,none,
@@ -3493,6 +3495,10 @@ ERROR(single_tuple_parameter_mismatch_normal,none,
34933495
(DescriptiveDeclKind, DeclBaseName, Type, StringRef))
34943496
ERROR(unknown_single_tuple_parameter_mismatch,none,
34953497
"single parameter of type %0 is expected in call", (Type))
3498+
ERROR(cannot_convert_single_tuple_into_multiple_arguments,none,
3499+
"%0 %select{%1 |}2expects %3 separate arguments"
3500+
"%select{|; remove extra parentheses to change tuple into separate arguments}4",
3501+
(DescriptiveDeclKind, DeclName, bool, unsigned, bool))
34963502

34973503
ERROR(enum_element_pattern_assoc_values_mismatch,none,
34983504
"pattern with associated values does not match enum case %0",
@@ -4528,8 +4534,6 @@ ERROR(property_wrapper_wrong_initial_value_init, none,
45284534
(DeclName, Type, Type))
45294535
ERROR(property_wrapper_failable_init, none,
45304536
"%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))
45334537
ERROR(property_wrapper_ambiguous_default_value_init, none,
45344538
"property wrapper type %0 has multiple default-value initializers", (Type))
45354539
ERROR(property_wrapper_type_requirement_not_accessible,none,

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020
#include "swift/AST/CaptureInfo.h"
2121
#include "swift/AST/ConcreteDeclRef.h"
22+
#include "swift/AST/DeclContext.h"
2223
#include "swift/AST/DeclNameLoc.h"
2324
#include "swift/AST/FunctionRefKind.h"
2425
#include "swift/AST/ProtocolConformanceRef.h"
2526
#include "swift/AST/TrailingCallArguments.h"
2627
#include "swift/AST/TypeAlignments.h"
2728
#include "swift/AST/TypeLoc.h"
28-
#include "swift/AST/TypeRepr.h"
2929
#include "swift/AST/Availability.h"
3030
#include "swift/Basic/InlineBitfield.h"
3131
#include "llvm/Support/TrailingObjects.h"
@@ -40,7 +40,9 @@ namespace swift {
4040
class ArchetypeType;
4141
class ASTContext;
4242
class AvailabilitySpec;
43+
class IdentTypeRepr;
4344
class Type;
45+
class TypeRepr;
4446
class ValueDecl;
4547
class Decl;
4648
class DeclRefExpr;

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"

0 commit comments

Comments
 (0)